Be the first to rate this file! 28 downloads (last 30 days) File Size: 8.42 KB File ID: #21885

DIFFERENTIAL EQ. SOLUTION THROUGH S-FUNCTION

by Qadeer Ahmed

 

25 Oct 2008

Code covered by BSD License  

Solution of differential equation through S-Function

Download Now | Watch this File

File Information
Description

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

*************************************************************************************

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Differential equation solution

Required Products Simulink
MATLAB release MATLAB 7.3 (R2006b)
Zip File Content  
Other Files example.m,
Readme.txt,
sim_example.mdl
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
differential equation Qadeer Ahmed 27 Oct 2008 09:27:52
sfunction Qadeer Ahmed 27 Oct 2008 09:27:52
mathematics Qadeer Ahmed 27 Oct 2008 09:27:52
differential equation solution Qadeer Ahmed 27 Oct 2008 09:27:52
mathematics Cristina McIntire 07 Nov 2008 12:59:29
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com