dark1203 发表于 2009-5-27 21:01

关于Simulink中S函数仿真的问题

一个Simulink里面有多个S函数,它们的互为输入输出,同时运行,是否需要设置一些使之同步的东西呢?
我的总是运行不出来,不知道是哪里的问题

还是说一个Simulink里面只能有一个S函数?

[ 本帖最后由 dark1203 于 2009-5-27 21:12 编辑 ]

yufeng 发表于 2009-5-27 21:43

可以有多个 但是据你所说应该会形成环路 需要用memory等来解决

dark1203 发表于 2009-5-28 14:18

回复 沙发 yufeng 的帖子

我搜索了一下,是代数环么?但是仿真故障里面没有显示我是代数环的问题 反而说我一个GAIN模块有问题

yufeng 发表于 2009-5-28 22:01

那你把错误贴出来

dark1203 发表于 2009-5-28 23:01

回复 地板 yufeng 的帖子

警告提示是代数环(algebraic loop(s)).的问题了,现在仿真能运行了,,但是一运行就卡了,每次都得强行关掉,是模型太大了吧。。

Warning: Block diagram 'controller_all' contains 1 algebraic loop(s). To see more
details about the loops use the command line Simulink debugger by typing "sldebug
controller_all" in the MATLAB command window. To eliminate this message, set the
Algebraic loop option in the Diagnostics page of the Simulation Parameters Dialog
to "None".
Found algebraic loop containing:
'controller_all/jtyd_santongdao/santongdao/fuyangtongdao/fuyang/fuyang'
'controller_all/jtyd_santongdao/tanxing1/tanxing1'
'controller_all/jtyd_santongdao/santongdao/fuyangtongdao/huangdong1_f/huangdong1_f'
'controller_all/jtyd_santongdao/santongdao/fuyangtongdao/huangdong1_f/huangdong1_f'
'controller_all/jtyd_santongdao/santongdao/fuyangtongdao/fuyang/yp1_pp' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/pianhangtongdao/huangdong1_p/huangdong1_f'
'controller_all/jtyd_santongdao/tanxing1/zp1_pp' (algebraic variable)
'controller_all/jtyd_santongdao/tanxing1/yp1_pp' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/pianhangtongdao/pianhang/zp1_pp' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/pianhangtongdao/huangdong1_p/q1_pp' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/gundongtongdao/zp1_pp' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/fuyangtongdao/huangdong1_f/q1_pp' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/gundongtongdao/gundong'
'controller_all/jtyd_santongdao/santongdao/fuyangtongdao/huangdong1_f/gamma_pp' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/fuyangtongdao/huangdong1_f/phi_pp' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/fuyangtongdao/huangdong1_f/theta_p' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/gundongtongdao/yp1_pp' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/gundongtongdao/gundong' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/pianhangtongdao/huangdong1_p/gamma_pp'
'controller_all/jtyd_santongdao/santongdao/pianhangtongdao/pianhang/S-Function'
'controller_all/jtyd_santongdao/santongdao/pianhangtongdao/huangdong1_p/psi_pp' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/pianhangtongdao/huangdong1_p/sigma_p' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/pianhangtongdao/huangdong1_p/huangdong1_f' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/pianhangtongdao/pianhang/S-Function' (algebraic variable)
'controller_all/jtyd_santongdao/tanxing1/tanxing1' (algebraic variable)
'controller_all/jtyd_santongdao/santongdao/fuyangtongdao/fuyang/fuyang' (algebraic variable)
Warning: Using a default value of 0.1 for maximum step size.The simulation
step size will be equal to or less than this value.You can disable this
diagnostic by setting 'Automatic solver parameter selection' diagnostic to
'none' in the Diagnostics page of the configuration parameters dialog.

dark1203 发表于 2009-5-28 23:36

回复 地板 yufeng 的帖子

在每一个反馈前都加了memory以后,再运行,代数环的警告没有了,现在变成

Warning: Using a default value of 0.1 for maximum step size.The simulation
step size will be equal to or less than this value.You can disable this
diagnostic by setting 'Automatic solver parameter selection' diagnostic to
'none' in the Diagnostics page of the configuration parameters dialog.

仍然会卡死

yufeng 发表于 2009-5-30 14:06

这是参数问题 把参数调整一下

dark1203 发表于 2009-6-1 15:08

回复 7楼 yufeng 的帖子

嗯。是参数初值的问题, 能运行了,虽然还是很慢,呵呵,模型太大了
页: [1]
查看完整版本: 关于Simulink中S函数仿真的问题