How to use figure out steady state during ODE

4 visualizaciones (últimos 30 días)
Heejun Lee
Heejun Lee el 1 de Ag. de 2021
Respondida: Alan Stevens el 1 de Ag. de 2021
This is the code I am using
//
opts = odeset('MaxStep', 1);
[T,Y] = ode45(@hw0,[0 100],[0.01 10], opts);
plot(T,Y)
//
And hw0 is the funcion following below
//
function dy = hw0(t,y)
D=0.02;
um=0.2;
Ks=0.05;
X0=0.01;
S0=0.1;
Sf=10;
dy = zeros(2,1);
dy(1) = -D*y(1) + (um*y(1)*y(2))./(Ks+y(2));
dy(2) = Sf * D - D*y(2) - (um*y(1)*y(2))./(0.4*(Ks+y(2)));
//
What I want to do is find point t
when Y(i,1)-Y(i+1,1)<0.0001
% when numerical difference between one step is smaller than 0.0001
How can I find the point t?

Respuesta aceptada

Alan Stevens
Alan Stevens el 1 de Ag. de 2021
Try
ix = find(Y(:,1)==max(Y(:,1)),1)
disp(T(ix))
after your plot command.

Más respuestas (0)

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by