Solving a non linear coupled system of ODE

i have that system and i made my code
clear all
close all
clc
ti = [0 0.0799 0.0809 0.0819 0.0829 0.0839 0.0849 0.0859 0.0869 0.0879 0.0889 0.0899 ]';
uu = [0 29.541444 150.99871 279.94913 416.61618 561.22227 713.98823 875.13276 1044.8719 1223.4184 1410.981 ]';
spl = pchip(ti,uu);
T=1;
[t,x]= ode45(@batch,[0 T],[0 0 ppval(spl,0)]);
figure(1)
plot(t,x(:,1),t,x(:,2))
figure(2)
plot(t,x(:,3))
the function batch is the following :
function dx=batch(t,x)
Mp=0.4;
Ap=0.00628;
Patm=101325;
Kp=242640;
Xpo=1.5928*10^(-3);
rou=880;
Cd=0.7;
Aorifice=2.0442*(10^(-5));
Vo=7.8*(10^(-5));
Beta=1625*(10^5);
Dp=135.4;
ti = [0 0.0799 0.0809 0.0819 0.0829 0.0839 0.0849 0.0859 0.0869 0.0879 0.0889 0.0899 ]';
uu = [0 29.541444 150.99871 279.94913 416.61618 561.22227 713.98823 875.13276 1044.8719 1223.4184 1410.981 1]';
spl = pchip(ti,uu);
dx=zeros(3,1);
dx(1)=x(2);
dx(2)=(1/Mp)*(Ap*(x(3)-Patm)-Kp*(x(1)+Xpo)-(Dp*x(2)));
dx(3)=(Beta/(Vo+(Ap*x(1))))*(Cd*Aorifice*sqrt(2*((ppval(spl,t)-x(3)))/rou)-(Ap*x(2)));
end
but i found oscillation in the beginnig (unexpected) , ken someone find why ?

Respuestas (0)

Preguntada:

el 16 de Jun. de 2020

Editada:

el 19 de Jun. de 2020

Community Treasure Hunt

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

Start Hunting!