Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: problems with DSolve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99417] Re: problems with DSolve
  • From: sean_incali at yahoo.com
  • Date: Tue, 5 May 2009 05:42:44 -0400 (EDT)
  • References: <gtnk4s$3md$1@smc.vnet.net>

Manipulate[
 sol = DSolve[{x'[t] == a y[t], y'[t] == - b x[t], x[0] == 1,
    y[0] == 2}, {x, y}, t];
 Plot[{x[t], y[t]} /. sol, {t, 0, 5}], {a, 1, 10}, {b, 1, 10}]

would do it. I've added a and b to make it interesting



On May 4, 1: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.



  • Prev by Date: Re: problems with DSolve
  • Next by Date: Re: INCLUDE A LEGEND IN A GRAPHIC
  • Previous by thread: Re: problems with DSolve
  • Next by thread: Re: problems with DSolve