Solve ODE problem
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi everybody,
I am new to Matlab and would request some help with numerically solving an ODE. The equations themselves are very simple as given below:
2y''' + yy''=0
--------------------------------------
%My fuction
function dy = rigid(t,y)
dy = zeros(3,1);
dy(1) = y(2);
dy(2) = y(3);
dy(3) = (y(2) * y(3))/2;
end
--------------------------------------
Now i use ode45:
[T,Y] = ode45(@rigid,[0 3],[0 0 1])
But the problem is because my initial conditions are:
y1(0)=0
y2(0)=0
y2(inf)=1
The vector about initial conditions at edo45 are [ 0 0 1 ] thats means: y1(0)=0, y2(0)=0, y3(0)=0.
So, how i write y2(inf)=1??
Any help will be appreciated!
Thank you.
0 commentaires
Réponses (2)
Aidin
le 4 Mai 2012
Hi,
You need to decide a step length in time and space (dt and dx etc) and then define the size of y1, y2 and y3 similar as how you do with dy with zeros depending on the step length. When this is done you can set y2(end)=1 which will set the last element in y2 equal to one.
good luck
0 commentaires
Jan
le 4 Mai 2012
A solver for an ODE accepts the initial conditions. When you define the time in backward direction, this means that in the time interval [a, b] a is greater than b, you can define the final conditions also. But you cannot define both.
Anyhow, the final time Inf will be hard to express, because you need an infinite number of steps. A mathematical transformation is most likely helpful to remove the infinity.
0 commentaires
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!