Implementing dxdt in simulink
2 次查看(过去 30 天)
显示 更早的评论
I am currently moving my system of 10 ODE's from a matlab script into a simulink setup.
From the matlab script I have a function which creates dxdt from my state variables. This can then be solved using the ODE15s in my case.
%%ODE function
dxdt = kinetics(t,x)
%code describing my system (ODE's) using x(1),x(2),x(3)... as state variables
then my function is given inital values and solved:
[t,y]= ode15s(@kinetics, t, init, options);
Then it is possible for me to plot the output y(t)
How do i transfer my ode function into simulink so it does the same thing?
Right now when i try, it says that it is missing information on the x vector (as it is not defined but solved using the ODE15s).
I have given an input (step) to produce som time steps (is this right?)
I am kind of new to simulink, so please let me know something is unclear :)
You can see a picture below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/281439/image.png)
Thanks in advance
回答(0 个)
另请参阅
类别
在 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!