different jsurface-results between MuPAD- and Octave-Evaluation :(

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

different jsurface-results between MuPAD- and Octave-Evaluation :(

Leo Baumann
Hello,

with MuPAD Computer Aided Mathematic I have correct evaluated this
(watch the figure):

www.leobaumann.de/newsgroups/horDipol.pdf

I am learning Octave since Sunday and tried to adapt that problem to
Octave. The results are different, the Octave-result is wrong :(

www.leobaumann.de/newsgroups/Dipol.png

I used this Octave-script:

www.leobaumann.de/newsgroups/horDipol_Test.pdf

I have absolute no explanation for the different results. Did I make a
fatal mistake? -

Does anyone have a hint?

thanks - regards - Leo


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: different jsurface-results between MuPAD- and Octave-Evaluation :(

Colin Macdonald-2
On 2017-11-10 05:39 PM, Leo Baumann wrote:
> I am learning Octave since Sunday and tried to adapt that problem to
> Octave. The results are different, the Octave-result is wrong :(

I think you need vectorized operations in your "c" function like ".*"
and "./" and ".^" in a few places.

Something like this:

c=@(the,phi1) abs((cos(pi*h/l*cos(the).*sin(phi1))-cos(pi*h/l))./ ...
    (sqrt(1-cos(the).^2.*sin(phi1).^2)));

BTW: next time just paste the code rather than sending a link to a pdf
file (the link for the figures is fine).

best,
Colin

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave