Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

11/14/13 9:55 PM

MATLAB Command Window

>>
t=0;
tf=0;
tfinal=0.5;
tc=0.125;
tstep=0.05;
m=2.52/(180*50);
i=2;
delta=21.64*pi/180;
ddelta=0;
time(1)=0;
ang(1)=21.64;
pm=0.9;
pmaxbf=2.44;
pmaxdf=0.88;
pmaxaf=2.00;
while t<tfinal;
if(t==tf)
paminus=0.9-pmaxbf*sin(delta);
paplus=0.9-pmaxdf*sin(delta);
paav=(paminus+paplus)/2;
pa=paav;
end
if(t==tc)
paminus=0.9-pmaxbf*sin(delta);
paplus=0.9-pmaxdf*sin(delta);
paav=(paminus+paplus)/2;
pa=paav;
end
if(t>tf && t<tc)
pa=pm-pmaxaf*sin(delta);
end
if(t>tc)
pa=pm-pmaxaf*sin(delta);
end
t,pa
ddelta=ddelta+(tstep*tstep*pa/m);
delta=(delta*180/pi+ddelta)*pi/180;
deltadeg=delta*180/pi;
t=t+tstep;
pause
time(i)=t
ang(i)=deltadeg
i=i+1;
end
axis([0 0.6 0 160 ])
plot(time,ang, 'ko-')

t =
0

pa =

1 of 6

11/14/13 9:55 PM

MATLAB Command Window

2 of 6

0.2878

time =
0

0.0500

0.1000

0.1500

0.2000

0.2500

21.6400

24.2100

27.4928

30.5678

32.5971

33.0420

0.0500

0.1000

0.1500

0.2000

0.2500

21.6400

24.2100

27.4928

30.5678

32.5971

33.0420

0.0500

0.1000

0.1500

0.2000

0.2500

21.6400

24.2100

27.4928

30.5678

32.5971

33.0420

ang =

t =
0.0500

pa =
0.0798

time =

ang =

t =
0.1000

pa =
-0.0233

time =

ang =

t =

11/14/13 9:55 PM

MATLAB Command Window

3 of 6

0.1500

pa =
-0.1171

time =
0

0.0500

0.1000

0.1500

0.2000

0.2500

21.6400

24.2100

27.4928

30.5678

32.5971

33.0420

0.0500

0.1000

0.1500

0.2000

0.2500

21.6400

24.2100

27.4928

30.5678

32.5971

33.0420

0.0500

0.1000

0.1500

0.2000

0.2500

ang =

t =
0.2000

pa =
-0.1775

time =

ang =

t =
0.2500

pa =
-0.1905

time =
0

ang =

0.3000

11/14/13 9:55 PM

21.6400

MATLAB Command Window

4 of 6

24.2100

27.4928

30.5678

32.5971

33.0420

31.7860

0.0500

0.1000

0.1500

0.2000

0.2500

0.3000

0.3500

21.6400

24.2100

27.4928

30.5678

32.5971

33.0420

31.7860

29.1594

0.0500

0.1000

0.1500

0.2000

0.2500

0.3000

0.3500

21.6400
25.8679

24.2100

27.4928

30.5678

32.5971

33.0420

31.7860

29.1594

t =
0.3000

pa =
-0.1535

time =

ang =

t =
0.3500

pa =
-0.0745

time =

0.4000

ang =

t =
0.4000

pa =
0.0274

11/14/13 9:55 PM

MATLAB Command Window

5 of 6

time =
Columns 1 through 9
0

0.0500

0.1000

0.1500

0.2000

0.2500

0.3000

0.3500

27.4928

30.5678

32.5971

33.0420

31.7860

29.1594

0.1000

0.1500

0.2000

0.2500

0.3000

0.3500

27.4928

30.5678

32.5971

33.0420

31.7860

29.1594

0.4000
Column 10
0.4500

ang =
Columns 1 through 9
21.6400
25.8679

24.2100

Column 10
22.8210

t =
0.4500

pa =
0.1243

time =
Columns 1 through 9
0

0.0500

0.4000
Columns 10 through 11
0.4500

0.5000

ang =
Columns 1 through 9
21.6400
25.8679

24.2100

Columns 10 through 11

11/14/13 9:55 PM

22.8210

MATLAB Command Window

6 of 6

20.8839

t =
0.5000

pa =
0.1870

time =
Columns 1 through 9
0

0.0500

0.1000

0.1500

0.2000

0.2500

0.3000

0.3500

30.5678

32.5971

33.0420

31.7860

29.1594

0.4000
Columns 10 through 12
0.4500

0.5000

0.5500

ang =
Columns 1 through 9
21.6400
25.8679

24.2100

27.4928

Columns 10 through 12
22.8210
>>

20.8839

20.6169

You might also like