Help Using Simulink tp draw ODE
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I was wondering if someone could help me create a basic differential equation in Simulink. I'm trying to create the following equations
![](https://www.mathworks.com/matlabcentral/images/broken_image.png)
I tried using this as an example ODE to help me solve this problem but it doesn't seem to help. The link above has a very similar ODE. When I create two of what is done in the example and try and connect it to a XY Graph I don't get anything so I'm doing something wrong but am not sure what. Thanks for any help.
1 件のコメント
回答 (2 件)
Mischa Kim
2014 年 2 月 3 日
Dylan, the basic structure looks like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174315/image.png)
Try using an embedded MATLAB function to compute the state derivative
function Xdot = fcn(X, u)
Xdot = [0; 0];
x = X(1);
y = X(2);
Xdot = [y*u; -x*u];
end
As a final note, make sure to adjust the limits in the XY Graph according to the signal outputs.
1 件のコメント
Mischa Kim
2014 年 2 月 3 日
Double-click the integrator block and add the intial conditions, e.g., [1; 1] ;
Dylan
2014 年 2 月 3 日
1 件のコメント
Mischa Kim
2014 年 2 月 4 日
Dylan, could you please post follow-up questions as comments? Did you get it to work with setting the initial conditions? See comment on top.
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!