Trim with Generated Simulink Code
7 ビュー (過去 30 日間)
古いコメントを表示
I've used Simulink Coder to generate the C code for the grt target. The idea is to generate an executable such that MATLAB and Simulink are not needed to run the model. I've managed to create a wrapper C application to work with the generated code. But I'm having trouble performing the trimming operation. In order for the model to be useful, trimmed conditions would need to be found prior to simulation (in many cases, finding the trimmed conditions is more important than simulation).
Under MATLAB, I was able to create a Newton-Raphson trimming routine. The jacobian is obtained by running the model command to get the outputs/derivatives at t=0. The problem is that, with the generated code, I only have three exposed extern functions available to me: model_initialize, model_step, and model_terminate. model_step updates the derivatives/outputs, but it only provides the results at the end of the first time step, not at t=0.
Any suggestion as to I should tackle this?
2 件のコメント
採用された回答
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!