From: Jaakko R <jaa...@we...> - 2003-01-14 22:16:00
|
Hi, Many years ago, after calculating the magnetic field produced by a circular loop, I was wondering why Matlab doesn't support complete elliptic integrals with negative arguments. I would suggest to improve octave-forge's version. Could someone step in and drop a patch for a vectorized version, or should I give it a try? It should be something like this for a scalar version if m<0, [k, e] = ellipke(-m./(1-m)) k = 1/sqrt(1-m)*k; e = sqrt(1-m)*e; end The following equations can be seen to be correct by the substitution theta=pi/2-theta'. Comments? Cheerio, -Jaakko Complete elliptic integral of first kind \begin{equation} \label{eq:ellkint} K(m) = \int_0^{\pi/2} [1-m\sin^2(\theta)]^{-1/2}\,d\theta. \end{equation} \begin{equation} \label{eq:ellk} K(-m) = \frac{1}{\sqrt{1+m}}\,K\left(\frac{m}{1+m}\right) \end{equation} Complete elliptic integral of second kind \begin{equation} \label{eq:elleint} E(m) = \int_0^{\pi/2} [1-m\sin^2(\theta)]^{1/2}\,d\theta. \end{equation} \begin{equation} \label{eq:elle} E(-m) = \sqrt{1+m}\,E\left(\frac{m}{1+m}\right) \end{equation} |