Code For Lab 03
Code For Lab 03
[t,x]=ode45(('mass_damper_spring'),[0 400],[0;0;0;0]);
subplot(2,1,1)
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');
title('Displacement at node A for Case 1');
subplot(2,1,2)
plot(t,x(:,2));grid;
xlabel('time');ylabel('Velocity');
title('Vellocity at node A for Case 1');
figure
subplot(2,1,1)
plot(t,x(:,3));grid;
xlabel('time');ylabel('displacement');
title('Displacement at node B for Case 1');
subplot(2,1,2)
plot(t,x(:,4));grid;
xlabel('time');ylabel('Velocity');
title('Vellocity at node B for Case 1');
[t,x]=ode45(('electrical_system'),[0 500],[0;0;0]);
subplot(3,1,1)
plot(t,x(:,1));grid;
xlabel('time');ylabel('current');
title('Current of L1');
subplot(3,1,2)
plot(t,x(:,2));grid;
xlabel('time');ylabel('curent');
title('Current of L2');
subplot(3,1,3)
plot(t,x(:,3));grid;
xlabel('time');ylabel('velocity');
title('Voltage of C');