S-Function Builder Simple Integrator Implementation
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I'm pretty new in the Matlab S-Function world and I'm struggling with implementing a simple integrator S-Function using the S-Function Builder Block in Simulink.
I'm using the S-Function builder block as it easily allows me to control my input and output port dimension size under the Port Parameter Properties.
The single continuous time integrator I'm trying to model is the following:
xdot = u
y = x
Unfortunately the term I'm writing inside the "Continuous Derivative" tab doesn't represent the derivative state and the final compiled S-Function doesn't act as an integrator. The term I'm writing in the Output and Continuous Derivative Tabs are the following:
y0[0] = u0[0]; (u0 is the port 1 input state and y0 is the output port variable)
dx[0] = u0[0]; (Derivative Tab code)
I'd appreciate it if you could let me know what I'm doing wrong that this S-Function only acts as a direct feedthrough.
Thanks in advance. Nima
0 Kommentare
Akzeptierte Antwort
Kaustubha Govind
am 11 Jul. 2012
Your Derivatives tab looks right, but I think you need this in your Outputs tab:
y0[0] = xC[0];
Note that this is what "y=x" corresponds to.
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!