运行环境
win10系统
安装有jmodelica matlab的simulink
步骤1:模型程序编写
建立文档:SecondOrderSystemInitParams.mo
记录文档所在路径:“C:\Users\U2016\Desktop\cps”
内代码为:
model SecondOrderSystemInitParams
"A second order rotational system with initialization parameters"
type Angle=Real(unit="rad");
type AngularVelocity=Real(unit="rad/s");
type Inertia=Real(unit="kg.m2");
type Stiffness=Real(unit="N.m/rad");
type Damping=Real(unit="N.m.s/rad");
parameter Angle phi1_init = 0;
parameter Angle phi2_init = 1;
parameter AngularVelocity omega1_init = 0;
parameter AngularVelocity omega2_init = 0;
parameter Inertia J1=0.4 "Moment of inertia for inertia 1";
parameter Inertia J2=1.0 "Moment of inertia for inertia 2";
parameter Stiffness k1=11 "Spring co