Passing information between level-2 matlab s-functions
古いコメントを表示
I am trying to model a two step chemical process using simulink and s function for each step. 5 outputs from step 1 are connected to the 5 inputs of step 2. I initialize the outputs of step 1 in its s function using read in parameters. When I initialize the state variables of step 2, which uses outputs from step 1, the values of the output the output variables of step 1 inside step 2 initialization are zero. What can I do to fix this?
Thanks. Girish
採用された回答
その他の回答 (1 件)
Girish
2011 年 4 月 12 日
0 投票
4 件のコメント
Jarrod Rivituso
2011 年 4 月 12 日
Make sure you have defined continuous states if you want Simulink to numerically integrate them. The model "msfcndemo_limintm" has an example.
Some highlights from that are:
- Be sure to set the number of continuous states: block.NumContStates = 1;
- Be sure to register the derivatives block method: block.RegBlockMethod('Derivatives', @Derivative);
- Be sure to set the initial condition of the state in the InitConditions function: block.ContStates.Data = 1.5;
Girish
2011 年 4 月 13 日
Jarrod Rivituso
2011 年 4 月 13 日
Generally, continuous state blocks will have the following kind of flow during the simulation loop:
Outputs – creates the block output using the current value of the continuous state
Derivatives – creates the derivative of the block using the current value of the input signal, and possibly other factors as well
Girish
2011 年 4 月 14 日
カテゴリ
ヘルプ センター および File Exchange で Simulink についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!