Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: More problem with DSolve applied to System of ODE

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28158] Re: [mg28139] More problem with DSolve applied to System of ODE
  • From: BobHanlon at aol.com
  • Date: Mon, 2 Apr 2001 02:18:28 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

$Version

"4.1 for Power Macintosh (November 2, 2000)"

Clear[a1, b1, a, q1, q2, q3, t];

a12 = 0.8316;  a23 = 0.0086625;  a31 = 0.0462; 
a10 = 1.9404;  a30 = 0.001155;

Make substitutions as early in the process as is practicable.

eq = {Derivative[1][q1][t] == a1*E^(- b1*t) - (a12 + a10)*q1[t] + 
            a31*q3[t], 
        Derivative[1][q2][t] == a12*q1[t] - a23*q2[t],  
        Derivative[1][q3][t] == a23*q2[t] - (a31 + a30)*q3[t], 
        q1[0] ==  a, q2[0] == 0, q3[0] == 0} /. 
      {a -> 0, a1 -> 1, b1 -> 1};

{q1[t_], q2[t_], q3[t_]} = 
    Simplify[{q1[t], q2[t], q3[t]} /. 
        DSolve[eq, {q1[t], q2[t], q3[t]}, t][[1]] ];

{q1[0], q2[0], q3[0]}

{-3.1268390654481987*^-16, -1.734723475976807*^-17, 
  -6.938893903907228*^-18}

funcs = Flatten[{
        {q1[t], q2[t], q3[t]}, 
        Chop[{q1[t], q2[t], q3[t]}]}];

Plot[Evaluate[funcs], {t, 0, 20}, 
    Frame -> True, Axes -> False, 
    PlotStyle -> {
        {AbsoluteDashing[{5, 5}], RGBColor[1, 0, 0]}, 
        {AbsoluteDashing[{5, 5}], RGBColor[0, .75, 0]}, 
        {AbsoluteDashing[{5, 5}], RGBColor[0, 0, 1]}, 
        {RGBColor[1, 0, 0]}, {RGBColor[0, .75, 0]}, 
        {RGBColor[0, 0, 1]}}, 
    ImageSize -> {335, 200}, PlotRange -> {-0.01, 0.31}];

Chop is required if evaluating above t = 13


Bob Hanlon

In a message dated 2001/4/1 1:18:27 AM, guillerm at gugu.usal.es writes:

>Dear friends. I have some problems with DSolve (It is not the firt time)
>
>in Math 4.1 for Windows. The problem is the follow:
>
>a12 = 0.8316; a23 = 0.0086625; a31 = 0.0462; a10 = 1.9404; a30 
>= 0.001155;
>
>eq = {Derivative[1][q1][t] == a1 E^(- b1*t) - (a12 + a10)*q1[t] + 
>a31*q3[t], Derivative[1][q2][t] == a12*q1[t] - a23*q2[t],  
>Derivative[1][q3][t] == a23*q2[t] - (a31 + a30)*q3[t]};
>
>{q1[t_], q2[t_], q3[t_]} = FullSimplify[{q1[t], q2[t], q3[t]} /. 
>DSolve[Join[eq, {q1[0] == a, q2[0] == 0, q3[0] == 0}], 
>{q1[t], q2[t], q3[t]}, t][[1]] /. a -> 0];
>
>But the solution is wrong because it doesn`t`with the initial condition.
>
>i.e: for  a1 -> 1, b1 -> 1
>
>{q1[0], q2[0], q3[0]} /. {a1 -> 1, b1 -> 1}
>
>out: {-0.18026427146397125, 1.327120201951776*^-16, 
>4.406453795543006*^-18}
>
>that is wront It should be q1[0] = 0, and not {-0.18..}. I have test 
>to rationalize and increase the precition.
>


  • Prev by Date: Re: How do I add rows to a text table?
  • Next by Date: PSE with Mathematica
  • Previous by thread: Re: How do I add rows to a text table?
  • Next by thread: PSE with Mathematica