Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'plotting several interpolating functions' topicStudent Support Forum > General > "plotting several interpolating functions"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
03/11/13 2:30pm

In Response To 'Re: plotting several interpolating functions'
---------
Since what you really want is the gradient, try the following and see what happens.

No decimal points, so Mathematica assumes all integers and rationals are infinitely precise.

Assign values to all your variables except V and x.

Use DSolve instead of NDSolve so you get back an equation instead of just a cloud of points.

Use Simplify on that result because it will probably be huge and often Simplify can make that dramatically smaller.

Now, wrapped in a little of the -> notation returned from DSolve, hopefully you will have a single function of x and V. It may be complicated, but if you can get it then you just have that function.

If you have a function of x and V then can you think how you would compute the gradient that you want? And if so can you translate that into a Mathematica expression that will take your large result from DSolve and perhaps get what you need?

Now, little side notes on your last post.

It is difficult to tell with a differential equation whether changing a sign will make a huge difference or not. All I can say is try it and see.

If I get numbers that are far from what I expect then that is a flag waving at me that I have made at least three errors that I have to hunt down and fix.

As for my error and warning messages, I have all the warnings I can get turned on. And I probably have a different version. Those make it difficult to directly translate between what you see and what I see.

As for ListPlot vs Plot, Plot will try to be "adaptive" and adjust where and how many points it evaluates. Your ListPlot[Table[]] will usually tend to just find a fixed set of points. Sometimes a ListPlot is enough. If I have a really difficult problem, where Plot might sample lots of points and take huge amounts of time I will sometimes just do a modest sized ListPlot[Table[]] and hope I'm not missing something critical.

If you are getting V instead of x as a label on the axis then you may be showing something very different. But if I am guessing correctly, since you want the gradient, you may be thinking of something like a 3D plot and looking for some vector in x-V space, and thus both x and V are plot variables, but I can't be sure.

I hope some of this has helped you.

URL: ,

Subject (listing for 'plotting several interpolating functions')
Author Date Posted
plotting several interpolating functions Luka 03/08/13 4:16pm
Re: plotting several interpolating functions Bill Simpson 03/08/13 9:13pm
Re: plotting several interpolating functions Bill Simpson 03/08/13 9:55pm
Re: plotting several interpolating functions Luka 03/09/13 11:58am
Re: plotting several interpolating functions Luka 03/10/13 03:13am
Re: Re: plotting several interpolating functions Bill Simpson 03/11/13 2:30pm
< Previous CommentHelp | Reply To Comment | Reply To Topic