473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to integrate an array?

I need to compute integral of some array function, something
like:

from scipy import *
f = lambda x: array( [sin(x),cos(x)] )
integrate.quad(f, 0, 1)
Unfortunately integrate.quad requires Float type.

Any ideas how to perform this?

Thanks,
T.Kaz.
Sep 4 '05 #1
3 9439
Tom Kaz wrote:
I need to compute integral of some array function, something
like:

from scipy import *
f = lambda x: array( [sin(x),cos(x)] )
integrate.quad(f, 0, 1)

Unfortunately integrate.quad requires Float type.

Any ideas how to perform this?


Do each function separately. The routine that scipy.integrate.quad uses
adapts to the local conditions of the function (when the function is
flat, it uses fewer samples; when steep, more).

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

Sep 4 '05 #2
Do each function separately. The routine that scipy.integrate.quad uses
adapts to the local conditions of the function (when the function is
flat, it uses fewer samples; when steep, more).


It's not so easy to do it separately. I want to integrate function that
includes linalg.expm - as you see calculation the function is quite
expensive.

T.Kaz.
Sep 4 '05 #3
Tom Kaz wrote:

[I wrote:] (please attribute quotes)
Do each function separately. The routine that scipy.integrate.quad uses
adapts to the local conditions of the function (when the function is
flat, it uses fewer samples; when steep, more).


It's not so easy to do it separately. I want to integrate function that
includes linalg.expm - as you see calculation the function is quite
expensive.


I understand, but the good integration algorithms really do need to
evaluate each dimension separately.

If you can bear algorithms that only use samples from fixed intervals,
then you can use the functions romb(), simps(), or trapz() in
scipy.integrate.

BTW, a better place to ask scipy questions would be the scipy mailing list.

http://scipy.net/mailman/listinfo/scipy-user

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

Sep 4 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
by: Swartz | last post by:
Hi all. I'm working here on a small project of mine. I'm not new to programming, but I'm new to PHP. You have to understand that I'm coming from C++, OOP world, so my code might seems a little...
0
by: glin | last post by:
Hi I am trying to integrate the xmlrpc server into a class, does anyone know how to get it working? test.html: <html> <head> <title>XMLRPC Test</title> <script src="jsolait/init.js"></script>...
0
by: Rob R. Ainscough | last post by:
I'm looking for some Knowledge base tools that would integrate into VS.2003 and be flexible. My developers would us it to house important tips, tricks, and other information -- needs to have...
5
by: Marcelo | last post by:
How can I integrate c++ programs inside a GUI java interface? I would like to get the results from a c++ program and integrate them inside a java GUI. thanks Marcelo
1
by: Johnny Meredith | last post by:
Dear All, I have an Access database that tracks the progress of income tax audits. When the taxing authorities make a change (an "Adjustment"), I record the pertinent information in the...
0
by: P McGinness | last post by:
Basically, I've a JS function called ValidateForm(), which returns true or false and controls if the form submits. When I integrate this with .NET validators, the .NET always adds it's own call...
2
by: pdmountaineer | last post by:
hi, I am writing a C program and I would like to integrate some executables (.EXE files) from my C program. Is this possible and how should one do this exactly? kind regards
6
by: neha_chhatre | last post by:
hello i have a problem... have written two separate c files named read.c and twinkle.c the file read.c, after running stores some values in an array name average and it has a count variable...
6
by: najmi | last post by:
hai.. i have used jquery fullcalendar for my application and i have one problem that is how to display the event from the database.i have found the sample given in php but i want it in jsp.can...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.