sighhhh
function dx=filename(t, x)
global a b c

%matrix fraction
XT1=x(1);
XT2=x(2);
XT3=x(3);

dXT1dt=(5*t)-1+a+b;
dXT2dt=(6*t)-1+a+c;
dXT3dt=(10*t)-3+a+b+c;

dx=[dXT1dt; dXT2dt; dXT3dt];


clear all
clc
close all
global a b c

a=2;
b=3;
c=4;

xa(1,1)=300;
xa(1,2)=320;
xa(1,3)=330;


XT1(1)=xa(1,1);
XT2(1)=xa(1,2);
XT3(1)=xa(1,3);

tspan=[0 10];


x0=[xa(1,1); xa(1,2); xa(1,3)];
options = odeset('RelTol',1e-3,'AbsTol',1e-4);
[t,x]=ode23s('ASM3',tspan,x0,options);
xa=x;
XT1=xa(:,1);
XT2=xa(:,2);
XT3=xa(:,3);

figure(1)
subplot(3,1,1)
plot(t,XT1,'-')
Xlabel('time,h')
Ylabel('T(K)')
subplot(3,1,2)
plot(t,XT2,'-')
Xlabel('time,h')
Ylabel('T(K)')
subplot(3,1,3)
plot(t,XT3,'-')
Xlabel('time,h')
Ylabel('T (K)')

figure (2)
plot(t, XT1,'-',t, XT2,'-',t, XT3,'-')
Xlabel('time,h')
Ylabel('T (K)')
0 Responses