[SciPy-User] Help - scipy.integrate

Jorge E. ´Sanchez Sanchez hnry2k at hotmail.com
Thu Nov 11 13:11:27 EST 2010


Hi Waleria,

I don't see the definition of e in your code, I have tested if python recognizes in python shell, and get:

      
>>> f = pow(e, -0.5)

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    f = pow(e, -0.5)
NameError: name 'e' is not defined

so you have to define it somehow:

>>> from math import e
>>> f = pow(e, -0.5)
>>> f
0.60653065971263342
>>> 

Hope this answer your question,
Best regards,
Jorge
Date: Thu, 11 Nov 2010 13:31:35 -0200
From: waleriantunes at gmail.com
To: warren.weckesser at enthought.com
CC: scipy-user at scipy.org
Subject: Re: [SciPy-User] Help - scipy.integrate

See my code as is now: http://pastebin.com/GFrrsEkb

But it still does not display the graphic as is this: http://img14.imageshack.us/i/exampled.jpg/


In terminal - show me this error in: http://pastebin.com/N4vu30SK  - line 7,8 error 500

What can be?

Thanks,

On Wed, Nov 10, 2010 at 2:13 PM, Warren Weckesser <warren.weckesser at enthought.com> wrote:



On Wed, Nov 10, 2010 at 9:24 AM, Waléria Antunes David <waleriantunes at gmail.com> wrote:



I changed the line 45 but what i do with the line 47: http://pastebin.com/9UcFuVf6
And i don't understand where i'm going to do this loop ...my last code was this: http://pastebin.com/2DYMvkJe ..but doesn't used the function integrate





Can you help with this loop?



You still need to define the function 'func' to compute the integrand for a given value of z (like you had before, but with the change that I suggested).  Then, in your loop, you still need to call romberg to compute the integral of that integrand to compute Dl for each value of z.  Once you have Dl, you can compute mu.




In October (http://mail.scipy.org/pipermail/scipy-user/2010-October/027039.html), David Warde-Farley suggested that you develop and test your code locally, before trying to embed it in a web application.  You really should do this.  Get your computation and plot working on your machine (with no web stuff involved), and only when it is working as expected should you embed the code in your web app.  That will make it much easier for you (and for anyone who tries to help you) to debug the computation. 




Warren





_______________________________________________
SciPy-User mailing list
SciPy-User at scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20101111/0c419bf6/attachment.html>


More information about the SciPy-User mailing list