Вы находитесь на странице: 1из 1

% quasistatic solution of a slope

function thermalstorageN()
clc
global c1 c2 c3 Tfi N;
warning off
Tfi=100;
c1=1;
c2=2;
c3=3;
N=3;
tspan=0:0.001:0.01;
x0=[repmat(0.01,1,2*N+2)];
[t,x] = ode45(@abc,tspan,x0)
%T=Vstar*t/h or t=T*h/Vstar
%stress is constant and but x(:,1),x(:,2),x(:,3) are the velocities
%plot(t,x(:,1),'b');
hold on
plot(t,x(:,1));
hold on
end
%end
function xdot = abc(t,x)
global c1 c2 c3 Tfi N
dx=0.001;
xdot(1)= c1*(x(1)-Tfi)/dx+c2*(x(2)-x(1));
xdot(2)=c3*(x(1)-x(2));
for i=1:1:N
xdot(2*N+1)= c1*(x(2*N+1)-x(2*N-1))/dx+c2*(x(2*N+2)-x(2*N+1));
xdot(2*N+2)=c3*(x(2*N+1)-x(2*N+2));
end
xdot=xdot(:);
end

Вам также может понравиться