Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Incredible slow Plot
Replies: 8   Last Post: Jul 13, 2011 2:27 AM

 Messages: [ Previous | Next ]
 DrMajorBob Posts: 1,448 Registered: 11/3/08
Re: Incredible slow Plot
Posted: Jul 12, 2011 6:30 AM

> and that was it. However I don't understand this. Was the problem the
> "size" and "amount" of interpolated functions?

I don't understand it either. The two methods seem equivalent, but this
code

> sol=NDSolve[{eqns, cond},f,{t,0,1200}][[1]];
> a=sol[[1, Something, 2]]
> b=sol[[1, Something+1, 2]]

suggests that you're solving for one function f in the first line, and
YET, you're extracting two solutions a and b in the next two lines. That's
not possible, so you're not showing us the code you actually used. (We
know that anyway, since "eqns", "cond", and "Something" are undefined.)

I suspect in the real code, the two methods that seem equivalent are NOT
equivalent at all.

Bobby

On Mon, 11 Jul 2011 05:58:03 -0500, Iván Lazaro <gaminster@gmail.com>
wrote:

> Hi!
>
> Yes, I tried
>
> sol=NDSolve[{eqns, cond},f,{t,0,1200}][[1]];
> Plot[Evaluate[f[t]/.sol],{t,0,1200}],
>
> but that was a pain. Thanks to Bobby I managed to solve my speed problem:
>
>
> sol=NDSolve[{eqns, cond},f,{t,0,1200}][[1]];
> Plot[Evaluate[f[t]/.sol],{t,0,1200}],
>
> I selected the specific solutions I needed, and Set them to a variable
> that then I plot:
>
>
>
> sol=NDSolve[{eqns, cond},f,{t,0,1200}][[1]];
> a=sol[[1, Something, 2]]
> b=sol[[1, Something+1, 2]]
>
> Plot[{a[t],b[t]}],{t,0,1200}],
>
> and that was it. However I don't understand this. Was the problem the
> "size" and "amount" of interpolated functions?
>

--
DrMajorBob@yahoo.com

Date Subject Author
7/9/11 Iván Lazaro
7/10/11 Peter Pein
7/11/11 Iván Lazaro
7/12/11 David Bailey
7/12/11 Iván Lazaro
7/12/11 DrMajorBob
7/12/11 DrMajorBob
7/13/11 Iván Lazaro