You are not logged in.
I need help to Plot this function:
W = 4/3*(N*E*math.sqrt(R)*integrate(math.pow(z-d,3/2)*phi,(z,d,oo)))
with
phi=(1/(Sq*math.sqrt(2*math.pi))*exp(-((z-Sa)**2)/(2*(Sq**2))))
Sa=0.34
Sq=0.45
N = 11746.875
E = 0.04945
R = 4.4194
I need 'd' between [0 , 0.1 , 0.2 , ...... , 3.0]
I believe my problem is with the integration. I don't know how to integrate that part of W.
Thanks.
Offline
Hi Paolamazzu;
Is this what you want for phi?
Is this the integral you are having problems with?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Yes. That's exactly the integral I'm having problems with!!
I will appreciate any help you can give me!
Offline
That integral looks very much like a hybridized Normal Distribution.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
And how do I solve that in Python? I can not use integrate, right? I have to use another code, is that right?
Offline
For a test please do this in python.
Tell me what you get?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
The only thing I got is this:
2
⌠
⎮ 1
⎮ ─────────── dx
⎮ 2
⎮ cos(x) + x
⌡
1
It does not solve for me.
Last edited by Paolamazzu (2011-07-21 09:23:18)
Offline
Okay that is what you should be getting for you integral too.
Please bear with me, ask him for this:
and this:
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
That's exactly what happens with mine.
The first you asked, I got the right answer.
The second as well.
No problem at all.
Offline
Hi;
What did you get, may I see?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
The first one:
3
x
──
3
The second one:
3 3
a b
- ── + ──
3 3
Offline
Very good that means the integrate command in python is doing a symbolic integration. A question, do you have a numerical integration command in python?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Not that I'm aware of.
I'm a begginer at Python.
Last edited by Paolamazzu (2011-07-21 09:46:42)
Offline
Okay, hold please while I do some checking.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Ok, thank you a lot.
Offline
Here is what we have so far:
This is the problem,
That integral can not be done mathematically in closed form. In simple terms we can not get rid of the integral sign.
I asked you whether you were working with a standard normal curve.
If so then there may be ways around this problem. You must numerically evaluate this integral.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
And those can not be done by this method??
Offline
Hi;
Not by the methods that your integrate command has.
You must numerically evaluate this integral. For that you need a command that will do that in your language. Or I can do the whole plot for you because I have the tools. If you only need this done once then that is the best solution.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
I do need to plot, but the problem is that I need also the program to get there, so I can do other similar plots.
Offline
Now, if that curve was related to the standard normal curve then there are tables for that integral and polynomial approximations. First I would like to know something about it so I can cut away the fat.
Also start to search your help, python must support a numeric integrate command. It has to be there, that would also solve the problem.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
It is related to the standard normal curve..I think I found something while searching..it's called scipy...I'm gonna try it here..if I get nothing, I will return again...But thanks a lot for your help!
Offline
That should do it! Scipy has numeric routines, let me know how you end up!
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Hey bobbym!
I think I really do have problems with Python. I found that Scipy command but something is not right. I think I don´t no how to use the command. Can you please help me???
Offline
Hi Paolamazzu;
What is the command?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Hey bobbym,
the code is scipy.integrate.quad
Last edited by Paolamazzu (2011-07-22 12:58:11)
Offline