Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

So, after browsing through older posts to see if anybody else could have had the same problem, I have come to the conclusion that I am stuck. That bothers me, especially because it should be straight forward.

I am trying to solve a Differential Equation. The equation is: Image of the Differential Equation to be solved, including the time domain

I would like to find X(t), and hence plot X as a function of time. It is known that X = 0 when t = 0.

I write this the following way:

solOpg13a1 = 
   DSolve[{D[X[t], t] == (k*(1 - X[t])*(t*Fa - X[t]*nB0))/(V0 + t*v0), X[0] == 0}, X[t], t];

Next, I prepare it for plotting by the following:

eqOpg13a1 = X[t] /. solOpg13a1 //. {k -> 5.1 , V0 -> 1500 , nB0 -> 1125 , Fa -> 6.0, v0 -> 4} // First;

Please note that V0 and v0 are not the same.

X(t) works OK for values above 150 (more or less). For values of t less than around 150, I get a series of Power::infy and Infinity::indet errors.

Screendumpt of errors and plot

It should be straight forward, and so I am sorry to call for help, but I just can't put a finger on where I go wrong.

The time to t_full is approximately 250 Hours (which is the unit of t). I am using Mathematica 9.

share|improve this question
    
I think it's just an issue of balancing big numbers. This will work : aux[t_] = FullSimplify[ X[t] /. First@ DSolve[{D[X[t], t] == (k*(1 - X[t])*(t*Fa - X[t]*nB0))/(V0 + t*v0), X[0] == x0}, X[t], t]], sol[t_] = FullSimplify[ aux[t] /. {x0 -> 0., k -> 5.1/100, V0 -> 1500, nB0 -> 1125, Fa -> 6, v0 -> 4}] and then plot/use sol[t]. –  b.gatessucks Nov 3 '13 at 18:53
    
I also found out the problem can be solved by usingNDSolve instead, for the range {t,0,250}. This gave the plot that I was expecting. –  Simon P Nov 3 '13 at 18:54
    
The laziest of all approaches :D Plot[X[t] /. FullSimplify@sol /. {x0 -> 0., k -> 5.1/100, V0 -> 1500, nB0 -> 1125, Fa -> 6, v0 -> 4}, {t, 0, 300}] produces this plot of the solution. –  Sektor Nov 3 '13 at 19:07

1 Answer 1

up vote 2 down vote accepted

The solution is fairly straight forward:

Plot[X[t] /. FullSimplify@sol /. 
    {x0 -> 0., k -> 5.1/100, V0 -> 1500, nB0 -> 1125, Fa -> 6, v0 -> 4}, {t, 0, 300}]

Producing

Plot

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.