Question: random value at each time step

Hello,

I am trying to make c (0.001<=c<=0.02) a random value at each time step.But with my code c is choosing randomly from the interval then solveing the equation for fixed c at each time step.

How can I mack c a diffrent random value at each time step?

This is my code:

> with(DEtools); with(plots);
>
> Ra := RandomTools:-Generate(distribution(Uniform(0.001, 0.02))); c := Ra;
> f := .1;
>
> eq := diff(X(t), t) = 1-f-c*X(t);
>
> init := X(0) = 100;
>
> sol := dsolve({eq, init}, {X(t)}, range = 0 .. 100, numeric);
>
> odeplot(sol, [[t, X(t)]], t = 0 .. 100);

 

Thank you

Please Wait...