Making the "lyap" function work in Simulink and RTW

Hi all,
I have a Simulink model that uses Matlab's "lyap" function within a Level-2 M-file S-function. Unfortunately, this type of S-function is not compatible with Real-Time Workshop without the help of a TLC file. The "lyap" function doesn't work inside an embedded Matlab function either. I tried that before employing the current S-function.
Writing a TLC file from scratch is beyond my abilities at the moment, and I'm unsure whether this method would work. Suggestions, anyone? Thanks.
Cheers Joe

回答 (1 件)

Kaustubha Govind
Kaustubha Govind 2011 年 10 月 19 日

0 投票

Unfortunately, there is no way to generate code from the lyap function currently. However, the typical approach in embedded systems for mathematical functions is to create a lookup-table if you know the full range of your input data. I don't know if interpolating the results of the LYAP function makes sense, but if it does, you could try implementing it as an n-D Lookup Table where the Y-data is the output of the LYAP function - Simulink Coder will compute the values for the given X-data and inline the outputs into the generated code.

2 件のコメント

Joe
Joe 2011 年 10 月 20 日
Thanks for your reply, Kaustubha. The solution to Lyapunov equations involve a complicated series of matrix operations, so I rather doubt that the interpolation approach can be used. Unfortunately for me, Matlab's "lyap" function contains calls to a couple of executable functions whose algorithms are obscured. So, it looks like I'll have to conduct an in-depth review of the underlying principles and write the entire code from ground up. Scores of academic papers have been published over the years in regards to various solution methods. Hopefully, they won't be too abstruse for my comprehension.
Kaustubha Govind
Kaustubha Govind 2011 年 10 月 20 日
Joe: Sorry for not being able to be of more help. Good luck!

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMatrix Computations についてさらに検索

質問済み:

Joe
2011 年 10 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by