One ode, two differential equations

I have 2 differential equation that i want to solve in the same ode. I only have the initial value of the first equation and the answer of it will be the initial value of the second differential equation.
Is it possible and how ?

6 Comments

With only the information you have provided thus far, it is not possible to provide any Answer.
Does the solution of the first differential equation at every time value always provide a value that the second differential equation requires?
Okay I will give you more information about the system.
Suppose I have a differential equation that take an initial value and give you the result of dydt.
I need to divide this equation for two parts such that the initial value of the second part is the answer of the first part.
function dydt1 = f(t1, y1)
R = (A*y1+B*(y1)^2+C*(y1)^3);
dydt1 = I/(Elec_Charge*L*Width*Depth) - R;
end
[t1,y1] = ode15s(@f,t,y0);
In the above case I am not facing any issues for only one differential equation.
But if I need to split the equation into two such that the answer of dydt1 will be the initial value for dydt2.
The value of dydt will be the initial value of y2
dydt2 = I/(Elec_Charge*L*Width*Depth) - (A*y2+B*(y2)^2+C*(y2)^3);
Please note that I am obliged to do them in the same ode
I don't quite understand.
You have the differential equations
The solution for y1(t) (given any initial value) aswell as dy1/dt are functions of t. They cannot be initial values.
Yes, if they are continuous after each other. After calculating the value of y1 (Getting the answer of dy1dt), it will be the initial value of dy2dt.
Is there a way to do it in the same ode (using one ode) ?
This is an image about the system that I am tring to make
In addition I need to take the last value of y1 and not all the array as initial value.

Sign in to comment.

Answers (1)

As far as I can tell from your code, the righthanded side of your differential equations is the same. Meaning you have the system
. Thus you can simply only solve y1, the solution of y2 is then y2(t) = y1(t-t1).

1 Comment

In the system i'm working on, I entered a Gaussian pulse to a medium that amplifies it from the other side. In this process there will be factors that I should calculate like scattering ...
In order to do that I need to solve the above two equations that you have mantioned in one ode.
Is that possible and how ?!
Thank you in advance for your help :)

Sign in to comment.

Asked:

on 31 Jan 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!