You are on page 1of 8

Contoh 1 :

(state variabel)

>> t=[0:3];

>> x=-12.8.*t.^2+76.8.*t+2;

>> plot(t,x,’*:’)

Costate variabel

>> figure

>> z=-4.*t+12;

>> plot(t,z,'*:')

Control variabel

>> figure

>> y=-3.2*t+9.6;

>> plot(t,y,'*:')

Jika diabungkan menjadi

>> t=[0:3];

>> x=-12.8.*t.^2+76.8.*t+2;

>> plot(t,x,'b*-')

>> hold on

>> z=-4.*t+12;
>> plot(t,z,'r*-')

>> hold on

>> y=-3.2*t+9.6;

>> plot(t,z,'k*-')

Contoh 2

>> t=[0:2];

>> x=-12.8.*t.^2+76.8.*t+2;

>> plot(t,x,'*-')
>> figure

>> z=-3*t+6;

>> plot(t,z,'*-')

>> figure

>> y=-6*t+12;

>> plot(t,y,'*-')

Jika digabung menjadi

>> t=[0:2];

>> x=-12.8.*t.^2+76.8.*t+2;

>> plot(t,x,'b*-')

>> hold on

>> z=-3*t+6;

>> plot(t,z,'r-')

>> hold on

>> y=-6*t+12;

>> plot(t,y,'k-')
Soal 1

>> t=[0:1];

>> x=-22.5.*t.^2+85.5.*t+7;

>> plot(t,x,'*-')

>> figure

>> plot(t,x,'*-')

>> figure

>> z=-5*t+9;

>> plot(t,z,'*-')
>> figure

>> y=7.5*t+14.25;

>> plot(t,y,'*-')

Jika digabungkan menjadi

>> t=[0:1];

>> x=-22.5.*t.^2+85.5.*t+7;

>> plot(t,x,'b*-')

>> hold on

>> z=-5*t+9;

>> plot(t,z,'r*-')

>> hold on
>> y=7.5*t+14.25;

>> plot(t,y,'k*-')

Soal 2

>> t=[0:2];

>> x=96.*t.^2+384.*t+24;

>> plot(t,x,'*-')
>> z=-6*t+12;

>> figure

>> plot(t,z,'*-')

>> figure

>> y=-12.*t+24;

>> plot(t,y,'*-')

Jika digabungkan menjadi

>> figure

>> t=[0:2];

>> x=96.*t.^2+384.*t+24;

>> plot(t,x,'b*-')

>> hold on

>> z=-6*t+12;

>> plot(t,z,'r*-')
>> hold on

>> y=-12.*t+24;

>> plot(t,y,'k*-')

You might also like