Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all;
- k4=5;
- k3=2;
- k2=9;
- k1=4;
- u0=k4;
- b = 2;
- t0=0;
- du=0;
- x0=0;
- x10=0;
- xw=2.5;
- t=[0:0.1:15];
- xs1=0;
- xs2=(-63/4)*exp(-(4/9)*t);
- xs3=(-2.5)*exp(-(4/9)*t);
- xs4=(8.5)*exp(-(4/9)*t);
- y1=0*t+xw;
- y2=(-63/4)*exp(-(4/9)*t)+xw;
- y3=(-2.5)*exp(-(4/9)*t)+xw;
- y4=(8.5)*exp(-(4/9)*t)+xw;
- t=[0:0.1:15];
- figure(2);
- subplot(4,2,1);
- plot(t,y1,'*',t,xs1,'g',t,0*t+2.5,'r');
- title('Analitycznie x"(0) = 0 ');
- axis([0 15 -4 4])
- xlabel('t');
- ylabel('x(t)');
- grid on;
- legend('Wykres','Składowa swobodna','Rozwiązanie wymuszone');
- x0 = xw;
- sim('symulacja.slx');
- subplot(4,2,2);
- plot(t,Sim_x1);
- title('Symulacyjnie x"(0) = 0 ');
- axis([0 15 -4 4])
- xlabel('t');
- ylabel('x(t)');
- grid on;
- t=[0:0.1:15];
- figure(2);
- subplot(4,2,3);
- plot(t,y2,t,xs2,'g',t,0*t+2.5,'r')
- title('Analitycznie x"(0) = 7 ');
- axis([0 15 -4 4])
- xlabel('t');
- ylabel('x(t)');
- legend('Wykres','Składowa swobodna','Rozwiązanie wymuszone');
- grid on;
- x0 = -(53/4);
- sim('symulacja.slx');
- subplot(4,2,4);
- plot(t,Sim_x1);
- title('Symulacyjnie x"(0) = 7 ');
- axis([0 15 -4 4])
- xlabel('t');
- ylabel('x(t)');
- grid on;
- t=[0:0.1:15];
- figure(2);
- subplot(4,2,5);
- plot(t,y3,t,xs3,'g',t,0*t+2.5,'r',t,4);
- title('Analitycznie x(0) = 0 ');
- axis([0 15 -4 4])
- grid on;
- xlabel('t');
- ylabel('x(t)');
- legend('Wykres','Składowa swobodna','Rozwiązanie wymuszone');
- x0 = 0;
- sim('symulacja.slx');
- subplot(4,2,6);
- plot(t,Sim_x1);
- title('Symulacyjnie x(0) = 0 ');
- axis([0 15 -4 4])
- xlabel('t');
- ylabel('x(t)');
- grid on;
- t=[0:0.1:15];
- figure(2);
- subplot(4,2,7);
- plot(t,y4,t,xs4,'g',t,0*t+2.5,'r')
- title('Analitycznie x(0) = 11 ');
- axis([0 15 -4 4])
- grid on;
- xlabel('t');
- ylabel('x(t)');
- legend('Wykres','Składowa swobodna','Rozwiązanie wymuszone');
- x0 = 11;
- sim('symulacja.slx');
- subplot(4,2,8);
- plot(t,Sim_x1);
- title('Symulacyjnie x(0) = 11 ');
- axis([0 15 -4 4])
- xlabel('t');
- ylabel('x(t)');
- grid on;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement