MathGroup Archive 2006

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

Search the Archive

question ,,thankx!!!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70681] question ,,thankx!!!
  • From: "walkon" <fsun81 at mail.ru>
  • Date: Mon, 23 Oct 2006 02:49:59 -0400 (EDT)

hello to everyone!
here question is:
input:
r[t_] := 0 /; (t > 0) && (t < 100)
r[t_] := 10 /; (t > 100) && (t < 110)
r[t_] := 2.5 /; (t > 110) && (t < 200)
r[t_] := 0 /; (t > 200) && (t < 400)

sol = NDSolve[{b'[t] == 30a'[t],
         c'[t] == 10a[t](100 - c[t]) -0.3c[t],
         d'[t] ==400a[t],
         a'[t] + b'[t] + c'[t] + d'[t] == r[t],
         a[0] == 0, b[0] == 0, c[0] == 0, d[0] == 0}, {a[t], b[t],
c[t], d[t]}, {t, 0, 400}]

Plot[({a[t], b[t], c[t], d[t]} /. sol[[1]] // Evaluate), {t, 0,400},
PlotRange -> All, Frame -> True]

who can tell me what 's wrong with the programming?
and if I input a certain r[t] value like:
input:
sol = NDSolve[{b'[t] == 30a'[t], c'[t] == 10a[t](100 - c[t]) -0.3c[t],
d'[t] ==400a[t], a'[t] + b'[t] + c'[t] + d'[t] == 0, a[0] == 10, b[0]
== 0, c[0] == 0, d[0] == 0}, {a[t], b[t], c[t], d[t]}, {t, 0, 100}]
Plot[({a[t], b[t], c[t], d[t]} /. sol[[1]] // Evaluate), {t, 0,100},
PlotRange -> All, Frame -> True]
output:
[Graphic]
It works well!
so,,whether the programming can only be seperately resolved or not?

the most important is that I need to get the numerical value of
a[t],b[t],c[t],d[t]
at each time point(0-400),but how to list them from the result of
NDSolve??even I can show the picture.

thank you very much!!!


  • Prev by Date: Re: Using "=" vs ":="
  • Next by Date: Re: Problem in loading packages in Mathematica
  • Previous by thread: Re: Inserting hyperlinks which carry over to PDF?
  • Next by thread: Re: question ,,thankx!!!