Re: problems with DSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg99436] Re: problems with DSolve
- From: schochet123 <schochet123 at gmail.com>
- Date: Tue, 5 May 2009 06:03:19 -0400 (EDT)
- References: <gtnk4s$3md$1@smc.vnet.net>
The problem is not with DSolve but with Plot, which evaluates its first argument in non-standard fashion. The remedy is to enclose that argument inside the command Evaluate. For example, Manipulate[Plot[Evaluate[(x[t] /. DSolve[{x'[t] == y[t], y'[t] == -= x [t], x[0] == a, y[0] == 2}, {x, y}, t])], {t, 0, 5}],{a,1,2}] Steve On May 4, 11:45 pm, szymon.st... at gmail.com wrote: > hello, > > i am new to mathematica, therefore sorry if my question is trivial. I > would like to understand why the following line does not work: > > Plot[(x[t] /. DSolve[{x'[t] == y[t], y'[t] == -x[t], x[0] == = 1, y[0] > == 2}, {x, y}, t]), {t, 0, 5}] > > whereas after splitting into two lines it works: > sol = DSolve[{x'[t] == y[t], y'[t] == -x[t], x[0] == 1, y[0= ] == 2}, > {x, y}, t] > Plot[(x[t] /. sol), {t, 0, 5}] > > i would like to use Manipulate to play with boundary conditions, so > the first notation would be highly useful. > > thanks a lot for any feedback.