Computer Science, asked by nikhilagajula2000, 10 months ago

MATLAB program(clear the errors)
function xdot = heater(t,x,flag,delFj);
F = 1;
Fjs = 1.5;
Ti = 50;
Tji = 200;
V = 10;
Vj = 2.5;
rhocp = 61.3;
rhocpj= 61.3;
UA = 183.9;
delFj=1;
Fj = Fjs + delFj;
T = 125;
Tj= 150;
dTdt = (F/V)*(Ti - T) + UA*(Tj - T)/(V*rhocp);
dTjdt = (Fj/Vj)*(Tji - Tj) - UA*(Tj - T)/(Vj*rhocpj);
xdot = [dTdt; dTjdt];


options = odeset('RelTol',1e-6,'AbsTol',[1e-6 1e-6]);
%
[t,x] = ode45('heater',tspan,ti,options,delFj);
%
figure(1)
subplot(2,1,1),plot(t,x(:,1))
title('nonlinear, using ode45')
xlabel('time, min')
ylabel('temp, deg F')
subplot(2,1,2),plot(t,x(:,2))
xlabel('time, min')
ylabel('jacket temp, deg F')
%
% state space model with unit step change
a = [-0.4 0.3;1.2 -1.8];
b = [0;20];
c = [1 0;0 1];
d = 0;
sys = ss(a,b,c,d);
[ylin,tlin] = step(sys);
%
figure(2)
subplot(2,1,1),plot(tlin,ylin(:,1))
title('linear state space, unit step, deviation')
xlabel('time, min')
subplot(2,1,2),plot(tlin,ylin(:,2))
xlabel('time, min')
%
% scale deviation by delFj
ylinscale = ylin*delFj;
% plot in physical variable form
figure(3)
subplot(2,1,1),plot(tlin,125+ylinscale(:,1))
title('linear state space, physical magnitude')
xlabel('time, min')
subplot(2,1,2),plot(tlin,150+ylinscale(:,2))
xlabel('time, min')
% compare linear and nonlinear on same plot
figure(4)
subplot(2,1,1),plot(t,x(:,1),tlin,125+ylinscale(:,1),'--')
title('nonlinear vs. linear')
xlabel('time, min')
ylabel('temp, deg F')
legend('nonlinear','linear')
subplot(2,1,2),plot(t,x(:,2),tlin,150+ylinscale(:,2),'--')
xlabel('time, min')
ylabel('jacket temp, deg F')
legend('nonlinear','linear')

Answers

Answered by dasarianuradha16
0

Answer:

dont send that big question! and i am sorry if its wrong

Answered by shazia38
0

Answer:

Is this a question ??????????

Similar questions