mfile version of Simulink integrator

3 ビュー (過去 30 日間)
Scott Hansen
Scott Hansen 2013 年 7 月 16 日
I'm running a simulation model in Simulink and I want to transform it over to m-code. In my Simulink model I use an integrator and to be sure I was making my m-code correctly I took time-stepped data on both sides of the integral and compared to when I ran those points through my m-code. Sadly they did not match up.
The solver I am using in Simulink is ode3 ... does anyone know the formula for the integrator block in Simulink using an ode3 solver?
BTW, I do not have the toolboxes to do code generation from simulink.
  3 件のコメント
Scott Hansen
Scott Hansen 2013 年 7 月 17 日
Because I need to for what I'm working on ... why is that relevant to the question?
Jorge Gustavo Vazquez Duran
Jorge Gustavo Vazquez Duran 2016 年 11 月 23 日
hi man, i don´t have a solution but i have the same problem like you.
did you solve this or keeping it??
thanks.! regreat!!

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

回答 (1 件)

Guy Rouleau
Guy Rouleau 2013 年 7 月 16 日
This should get you started:
You might also be interested to look at the code for the ode3.m function in MATLAB.
  1 件のコメント
Scott Hansen
Scott Hansen 2013 年 7 月 17 日
編集済み: Scott Hansen 2013 年 7 月 17 日
I was looking at that exact page yesterday but had a hard time figuring out how to implement the equations. Please let me explain my confusion and hopefully you can point me in the right direction.
My format looks like this:
xdot -----> 1/s -----> x
xdot = input to integrator (acceleration in my system)
1/s = integrator
x = output of integrator (velocity in my system)
So I have time stamped data sets for xdot and x.
When it comes to the wiki page you recommended ... these equations are usually used to determine the next x value from previous values of x (at least that is how I understand it). When looking at the equations on the wiki page I'm not confident which variables are xdot, x and so forth. My understanding is below:
h_n = timestep from x_n to x_n+1
t_n = time at y_n
k1, k2, ... = calculated multipliers
y_n' = f(t_n, y_n) = xdot
y_n = x
If this is all correct then my next issue is that I don't have a function to evaluate these at (and neither does the integrator). It doesn't know what the next xdot value will be until it is applied as an input ... so how can I estimate the x value without an understanding of this?
I apologize for the length of this email but I'm really needing some assistance with this. Thanks in advance for your help.
S

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

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by