Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Evaluation of variables in StreamPlot and Plot3...' topicStudent Support Forum > General > "Evaluation of variables in StreamPlot and Plot3..."

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
jf
11/24/12 1:11pm

I'm a little surprised Plot3D didn't give the same complaints.

NIntegrate pre-evaluates its first argument without numbers, looking for ways to speed it up.
If the arguments it sees are undefined variables, it complains.

The usual workaround is to move the first argument outside in its own function and make that function work only when called with numbers. See the attached notebook.

Example:
spfunc[x_?NumericQ, y_?NumericQ] := NIntegrate[{f[x, y, t], 1}, {t, 0, 10} ]

StreamPlot[spfunc[x, y] , {x, -1, 1}, {y, -1, 1}]

See http://support.wolfram.com/kb/3820



Attachment: NInt142305.nb, URL: ,

Subject (listing for 'Evaluation of variables in StreamPlot and Plot3...')
Author Date Posted
Evaluation of variables in StreamPlot and Plot3... James 11/23/12 5:32pm
Re: Evaluation of variables in StreamPlot and P... jf 11/24/12 1:11pm
Re: Re: Evaluation of variables in StreamPlot a... james 11/26/12 5:20pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic