simulink模块中如何设置一个时变的参数变量 。

118 次查看(过去 30 天)
deponox
deponox 2022-11-27
回答: dejom 2022-11-27
本人在做电机的参数辨识,使用simulink搭建了电机模型,可是里面有个参数(转子电阻)我要让他是时变的,我想通过m函数对模型的参数进行统一赋值,大家有什么好的方法?

采纳的回答

dejom
dejom 2022-11-27
我尝试给你做了一个能满足需求的小例子,你看下是不是你想要的。模型如Fig 1所示:其中:
增益模块中的参数为需要动态调节的函数。
自定义Matlab函数模块中的函数定义为为:
function y = userfun(t)
set_param('testing11/Gain','Gain',num2str(t));
y = t;
另外:需要在 菜单栏 File->Model Parameters->Model Parameters->Callbacks->InitFcn中设定初始的模块参数:
set_param('testing11/Gain','Gain','0'),我设定的初始参数为0。
运行结果如Fig 2所示:
注意:Constant模块中的 Sample time 不能是 inf
  1 个评论
jia liu
jia liu 2023-5-8
这个能应用电机上吗,突增转子电阻

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Electromechanical 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!