Elliptic integral

Peter.Cusack at csiro.au Peter.Cusack at csiro.au
Tue Aug 31 01:44:21 CEST 2010


Hi all.

I'm writing some code to simulate a magnetic field. It uses elliptic integrals of the first and second kind. The elliptic integral of the second kind is not part of the Scilab function list, so I created one as shown below.

-->deff('y=f(t,k)','y=sqrt((1-(k*t)^2)/(1-t^2))') //Core definition for integral
-->deff('[ec]=elliptic_ec(k)','ec=intg(0,1,list(f,k))') //Second kind, not built into SciLab

When this runs, I get the following error message:

!--error 98 
Variable returned by scilab argument function is incorrect.

at line       2 of function elliptic_ec called by :  
at line       2 of function Bx called by :  
at line       2 of function Bxt called by :  
Bcentre=Bxt(0,0) //*Field at centre of winding*/

I'm looking for help to get past this. If the variable is incorrect, what should it be and how can I correct it?

If, as I suspect, the error is what's left after a failed computation, can someone point me to a more reliable method to calculate the elliptic integral?

Cheers;

Peter.

Peter Cusack, BE, MSc
Control Engineer
CSIRO Materials Science and Engineering
CSIRO

Phone: +61 2 9413 7123 | Fax: +61 2 9413 7200
peter.cusack at csiro.au | www.csiro.au | www.csiro.au/cmse
Address: PO Box 218, Lindfield, NSW 2070, Australia

PLEASE NOTE
The information contained in this email may be confidential or privileged. Any unauthorised use or disclosure is prohibited. If you have received this email in error, please delete it immediately and notify the sender by return email. Thank you. To the extent permitted by law, CSIRO does not represent, warrant and/or guarantee that the integrity of this communication has been maintained or that the communication is free of errors, virus, interception or interference.

Please consider the environment before printing this email.




More information about the users mailing list