How Can I Solve a Unique First-Order ODE Numerically?

In summary, the conversation discusses a problem of solving a first order ODE with a squared term and known functions of the unknown function. The individual proposes using numerical integration by setting da/dt = y and solving for y using the quadratic formula. They suggest using a small dt and iterating the process to find a solution. They also mention that da/dt is positive and a(t) is an increasing function of t. They ask for an opinion on their approach and for any hints on how to solve the problem.
  • #1
makris
11
0
I would like to solve a problem of the type

(da/dt)^2 + f(a)* (da/dt) = g(a) (1)

a=a(t) unknown function
f(a), g(a) = known functions of a.

This differential equation is a first order ODE but (da/dt)^2 makes it different compared to a typical first order ODEs (at least to my knowledge)

I would like to find a(t) satisfying (1) subject to certain initial conditions (say a(0.1)=2).

I feel that no appropriate analytical solution exists for this type of problem, so I am looking for a numerical method to integrate it.

I am thinking of setting da/dt=y thus having
---------------------------
y^2 + f(a)* y = g(a)
da/dt=y
----------------------------

and then writing da/dt = ( a(i+1) - a(i) ) /dt

so the problem becomes
---------------------------
y^2 + f(a(i))* y = g(a(i)) (2)
a(i+1) = dt*y + a(i) (3)
----------------------------

Now I am thinking of solving (2) for the value of y which corresponds at i=0 and then keep one the two solutions (which one to keep is not very clear ….(or if they are both imaginaray?)) Then with a selected small dt (say dt=0.001) find a(i+1). Then continue the iteration scheme this way.

I know a priori that da/dt is positive and thus a(t) is an increasing function of t.

I would like to have opinion from you whether the previous reasoning is TOTALLY WRONG or not. If it wrong I would appreciate if you just give a hint of how to attack the problem

Thanks
 
Physics news on Phys.org
  • #2
HINT: Use the quadratic formula. :)
 
  • #3


Your reasoning is not totally wrong, but there are a few things to consider in solving this type of problem. First, the equation (1) is a second order ODE, not a first order ODE. This is because it contains the second derivative of a.

To solve this problem numerically, you can use a method called the fourth-order Runge-Kutta method. This method is commonly used for solving second order ODEs and can also be used for higher order equations.

To use this method, you will need to rewrite (1) as a system of two first order equations. This can be done by setting y = da/dt, as you have already done. Then, you can rewrite (1) as:

dy/dt = -f(a)*y + g(a)
da/dt = y

Now, you can use the fourth-order Runge-Kutta method to solve this system of equations. This method involves calculating four intermediate values of y and a at each step, using the previous values to calculate the next values. The steps for this method are as follows:

1. Start with initial values for y and a, given by the initial conditions (a(0.1) = 2 in this case).
2. Calculate the intermediate values of y and a at time t = 0.1 using the above equations.
3. Use these intermediate values to calculate the next values of y and a at time t = 0.2.
4. Repeat this process until you reach the desired time.
5. Plot the values of a and y as a function of time to see the solution.

It is important to note that for this method to work, the functions f(a) and g(a) must be continuous and smooth. Also, the step size dt you choose will affect the accuracy of the solution. You may need to adjust the step size to get a more accurate solution.

In summary, your reasoning is on the right track, but you will need to use a different method to solve this problem. The fourth-order Runge-Kutta method is a good choice for solving second order ODEs numerically. I hope this helps!
 

FAQ: How Can I Solve a Unique First-Order ODE Numerically?

What is a first order ode?

A first order ode, or ordinary differential equation, is a mathematical equation that describes the relationship between a function and its derivatives. It involves only one independent variable and one or more derivatives of the dependent variable.

What is the difference between a first order ode and a second order ode?

A first order ode involves only the first derivative of the dependent variable, while a second order ode involves the second derivative. In other words, a second order ode is a differential equation with a term for acceleration, while a first order ode is a differential equation with only a term for velocity.

How do you solve a first order ode?

There are several methods for solving first order odes, including separation of variables, variation of parameters, and integrating factors. The specific method used will depend on the form of the ode and any initial conditions given.

What are the applications of first order odes in science?

First order odes have a wide range of applications in science, including in physics, chemistry, biology, and engineering. They can be used to model and analyze population growth, chemical reactions, electrical circuits, and many other phenomena.

Can first order odes be solved analytically?

In some cases, first order odes can be solved analytically, meaning a closed-form solution can be found. However, in many cases, numerical methods must be used to approximate a solution. This is especially true for more complex odes or those with nonlinear terms.

Similar threads

Back
Top