473,320 Members | 2,071 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,320 software developers and data experts.

Antwort: How to calculate definite integral with python

Searching the web I have found:

from numpy import *
def simple_integral(func,a,b,dx = 0.001):
return sum(map(lambda x:dx*x, func(arange(a,b,dx))))
simple_integral(sin,0,2*pi)
Or in
http://pylab.sourceforge.net/
quadrature.py

Cheers.

py************************************************ ***@python.org schrieb
am 15.05.2007 04:23:00:
I'm trying to do some integral calculation. I have searched the web, but
haven't found any useful information. Will somebody point me to the
right resources on the web for this job ?

Thanks a lot.

ps. Can numpy be used for this job?*
*
--
http://mail.python.org/mailman/listinfo/python-list
May 15 '07 #1
0 2750

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

Similar topics

0
by: Holger Joukl | last post by:
Hi, what version of python are you using? I got the same error when invoking a customized, 2-year-old version of distutils with python 2.3.3 (instead of 1.5.2, as before). Reason is code in...
0
by: Holger Joukl | last post by:
You could use the str() builtin, returning the string representation of the list object: >>> params = (1, 2, 3) >>> "select * from T where C1 not in %s" % str(params) 'select * from T where C1...
41
by: Saurabh Saxena | last post by:
can we calculate the 73! value in c or c++ without loss of significant digits.
96
by: david ullua | last post by:
I am reading "Joel on Software" these days, and am in stuck with the question of "how to calculate bitsize of a byte" which is listed as one of the basic interview questions in Joel's book. Anyone...
13
by: In a little while | last post by:
thanks
1
by: fdu.xiaojf | last post by:
I'm trying to do some integral calculation. I have searched the web, but haven't found any useful information. Will somebody point me to the right resources on the web for this job ? Thanks a...
2
by: arslanburney | last post by:
Hello. New to using Python. Python automatically round off watver i calculate using the floor function. How wud i make the exact value appear? Tried out fabs() in the math library but still...
0
by: Luke Kenneth Casson Leighton | last post by:
On Sep 3, 10:02 pm, bearophileH...@lycos.com wrote: 1200 lines of code for the compiler, and about... 800 for a basic suite of builtin types (Dict, List, set, string). ...
5
FishVal
by: FishVal | last post by:
IMHO, the following is not a how-to-do instruction to solve a particular problem but more a concept-proof stuff demonstrating possibilities of SQL. So, let us say the problem is to calculate...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.