MATLAB: Systems of Differential Equations

differential equationssimulink

I have solved a system of differential equations in Matlab using the ODE45 solver. I would now like to put this system of differential equations into Simulink. Does anyone have any advice on how to do a block diagram for a system of differential equations? Here is my .m file for the system.
% System of Differential Equations
function dxdt = stika_electro(t,x)
global L R k_t k_b J_m B V_i F_f r_1
%Electromechanical Equations
dxdt(1)= x(2);
dxdt(2)= ((k_t)*x(3))/J_m -(F_f*r_1)/(J_m)-(B*x(2))/J_m;
dxdt(3)= ((-k_b)*x(2))/L-(R*x(3))/L+V_i/L;
dxdt=dxdt';
It is based off a system of equations for modeling DC Servomotors w/ a load.
Thanks!

Best Answer