[Matplotlib-users] ellipk From: Pau - 2010-10-08 11:06 ```Hi, I am trying to calculate a function with a complete elliptic integral of the 1st kind I have defined Phase = 4.*sqrt(p/(p -6. - 2.*e)) * ellipk(-4.*e/(p - 6. -2.*e)) where a_mpc = 4.0 p = a_mpc * (1 - e**2.) and I have of course done this #!/usr/bin/env python from pylab import * But when calling the script, I get: NameError: name 'ellipk' is not defined What am I doing wrong? Any help will be very much appreciated. Thanks a lot, Pau ```
 Re: [Matplotlib-users] ellipk From: Sebastian Busch - 2010-10-08 11:40 Attachments: signature.asc ```hey pau, ellipk is in scipy.special: #!/usr/bin/env python from pylab import * from scipy.special import ellipk e=1. a_mpc = 4.0 p = a_mpc * (1 - e**2.) Phase = 4.*sqrt(p/(p -6. - 2.*e)) * ellipk(-4.*e/(p - 6. -2.*e)) greetings, sebastian. ```
 Re: [Matplotlib-users] ellipk From: Pau - 2010-10-09 06:05 ```Hi, didn't work... ImportError: No module named scipy.special this is fedora13... thanks! Pau 2010/10/8, Sebastian Busch : > hey pau, > > ellipk is in scipy.special: > > #!/usr/bin/env python > from pylab import * > from scipy.special import ellipk > > e=1. > a_mpc = 4.0 > p = a_mpc * (1 - e**2.) > Phase = 4.*sqrt(p/(p -6. - 2.*e)) * ellipk(-4.*e/(p - 6. -2.*e)) > > > greetings, > sebastian. > > 2010/10/8, Sebastian Busch : > hey pau, > > ellipk is in scipy.special: > > #!/usr/bin/env python > from pylab import * > from scipy.special import ellipk > > e=1. > a_mpc = 4.0 > p = a_mpc * (1 - e**2.) > Phase = 4.*sqrt(p/(p -6. - 2.*e)) * ellipk(-4.*e/(p - 6. -2.*e)) > > > greetings, > sebastian. > > ```
 Re: [Matplotlib-users] ellipk From: Sebastian Busch - 2010-10-09 10:53 Attachments: signature.asc ```hey pau! On 10/09/2010 08:04 AM, Pau wrote: > ... > ImportError: No module named scipy.special > ... do you have scipy installed? i.e. does import scipy work? if so, what is scipy.__version__ ? here, it's 0.7.0... if scipy is not installed, i think you need to install it in order to access ellipk. good luck :) sebastian. ```