The problem is of the following form: d r d t = f ( r...

Jaydan Aguirre

Jaydan Aguirre

Answered

2022-07-04

The problem is of the following form: d r d t = f ( r ), so 1 f ( r ) d r = d t. My goal is to get some r(t) from this differential equation by numerically integrating this, that is, a value for r at every t. The conditions are r ( 0 ) = r 0 and r ( ) = . The problem I run into is that I am not quite sure what the limits would be to get such values for r(t). Any suggestions on where to go from this would be greatly appreciated, thanks.

Answer & Explanation

Sariah Glover

Sariah Glover

Expert

2022-07-05Added 16 answers

First of all, this is a first order problem, you do not get to fix two conditions, only one. Once you choose r ( 0 ) = r 0 , the solution is determined for all t and it may or may not satisfy r ( ) = . The simplest method you can use is Euler's method: you choose equally spaced points t 0 , t 1 = t 0 + h , t 2 = t 0 + 2 h , and build the sequence
{ R 0 = r ( t 0 ) = r 0 R n + 1 = R n + h f ( R n )
Naturally, R i will be the approximate value of r ( t i ). You may have to use very small h for precise results but it has the advantage of being very easy to implement. If you want more accurate methods, you may want to lookup Runge-Kutta methods.
In terms of the integral form of the equation this corresponds to say that
r ( t + h ) = r ( t ) + t t + h f ( r ( s ) ) d s r ( t ) + h f ( r ( t ) ) .

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get your answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?