Question: How to make a random function?

Perhaps the question is trivial, but I could not find the solution.

I am solving numerically an ODE (e.g., a simple harmonic oscillator) with the righthand side that contains a random part. For example it is

eq:=diff(a(t),t,t) + a(t) = (1+0.01*R(t))*cos(5*t);

where R(t) is a random function of t. How can I make such a function?

The naive attempt: 

eq:=diff(a(t),t,t) + a(t) = 3.*(1+0.1*rand()/1000000000000.)*cos(5.*t);


gave me a fixed (while random) value, e.g.

...

But, I need this coefficeint to be random each time step.

Any suggestions are very welcome!

 

 

 

Please Wait...