06.08.2013 Views

内容简介作者简介 - 科学与工程计算系

内容简介作者简介 - 科学与工程计算系

内容简介作者简介 - 科学与工程计算系

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

disp([T1,T2,T3])<br />

plot(t1,y1,'g','LineWidth',6),hold on<br />

plot(t2,y2,'r','LineWidth',2)<br />

plot(t3,y3,'b'),hold off<br />

legend('with loop','without loop','memory',4)<br />

Warning: Block diagram 'exm080731_1' contains 1 algebraic loop(s).<br />

Found algebraic loop containing block(s):<br />

'exm080731_1/k3'<br />

'exm080731_1/Sum'<br />

'exm080731_1/k2'<br />

'exm080731_1/Sum1' (algebraic variable)<br />

有代数环 无代数环 带记忆块<br />

0.2800 0.2200 0.1100<br />

1.8<br />

1.6<br />

1.4<br />

1.2<br />

1<br />

0.8<br />

0.6<br />

0.4<br />

8.8 S 函数模块<br />

8.8.1 概述<br />

8.8.2 SIMULINK 的运行机理<br />

8.8.3 用 M 文件表述的 S 函数<br />

8.8.3.1 S 函数的模板程序<br />

2<br />

0.2<br />

with loop<br />

without loop<br />

memory<br />

0<br />

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5<br />

8.8.3.2 S 函数模块的创建和使用<br />

图 8.7.3.2-2-2<br />

【例 8.8.3.2-1】本例演示:(1)用 S 函数模块为图 8.8.3.2-1 所示单摆构造系统动力学模型;<br />

(2)利用 SIMULINK 研究该单摆摆角θ 的运动曲线;(3)用 S 函数动画模块表现单摆的<br />

运动。<br />

(1)<br />

(2)<br />

(3)<br />

[simpendzzy.m]<br />

function [sys,x0,str,ts] = simpendzzy(t,x,u,flag,dampzzy,gravzzy,angzzy)<br />

%<br />

%<br />

33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!