DIFFERENTIAL EQ. SOLUTION THROUGH S-FUNCTION
Basic example for beginners, that shows how to solve the differential equation through S-Function
****************DIFFERENTIAL EQ. SOLUTION THROUGH S-FUNCTION******************
***************"Instructions for Simulink"*************************
1.Goto simulink library browser and expand "Simulink"
2.Goto "user defined function" and expand it
3.Drag "S-Function" in the simulink enviorment
4.Double click and name the "S-Function name" as your save S-Function file, like "example" in this case
(**Make sure your both files are saved in same directory and their name dont overlap with any other file name)
*************Instruction for Matlab*******************
1.Type "open sfunctmpl" in command to open new S-Function
2.Save it as your own file,like "example" in this case;
3.Change the function name as your file name
4.In "function sys=mdlDerivatives(t,x,u)" you will define the differential eq
5.In "function [sys,x0,str,ts]=mdlInitializeSizes" you will define the continous states, inputs from simulink block and output.
6.In "function [sys,x0,str,ts]=mdlInitializeSizes" you will define Initial conditions of differential eq
7.In "function sys=mdlOutputs(t,x,u)", you will declare the outputs
*************************************************************************************
Citar como
Qadeer Ahmed (2024). DIFFERENTIAL EQ. SOLUTION THROUGH S-FUNCTION (https://www.mathworks.com/matlabcentral/fileexchange/21885-differential-eq-solution-through-s-function), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
Etiquetas
Agradecimientos
Inspirado por: Differential equation solution, Real time update of simulink variables in GUI, ActiveX control example in GUI, Homomorphic filtering
Inspiración para: Real time update of simulink variables in GUI, ActiveX control example in GUI, Differential equation solution, Homomorphic filtering
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
Versión | Publicado | Notas de la versión | |
---|---|---|---|
1.0.0.0 |