MATLAB Answers

How can I get the mathematical equation of the system constructed by simulink models automatically?

93 views (last 30 days)
Hanyang Dai
Hanyang Dai on 25 May 2019
Commented: Hanyang Dai on 29 Jul 2020
The simulink models in a dynamic system are simulated in the way of solving the differential or algebraic equations. Is there any commands that can generate the mathematical equations of the dynamic system? For example, when the wind generation system is simulated in simulink, can I get the mathematical eqtuations of the transimission line, induction generator and the AC system?
Hoping to have your reply,
Best regards.


Sign in to comment.

Accepted Answer

Tony Lennon
Tony Lennon on 29 May 2019
Sorry, but Simulink does not work that way. In some cases, you can look within a block to see equations, mainly with the Simscape blocks.


Show 1 older comment
Talia Sari
Talia Sari on 27 Jul 2020
Hello, I am new to Simulink. Could you please tell me how does it work? I already put solver configuration and powergui block, but the state space values are still empty.
Hanyang Dai
Hanyang Dai on 29 Jul 2020
You are almost succee. The desired mathematical equations of the Simulink system can be derived in different ways:
(1) use commands “power_analyze” or “power_statespace” to generate eqs, you can find demos and introductions in the help doc of MATLAB.
(2) use power_gui module to generate eqs, 1) open the “configuration parameters” of power_gui module, 2) set the solver of simulation type as “continuous ”, 3) enable use of ideal switching devices, 4) display circuit differential equations, and finally run the simulation and you will find the eqs in the MATLAB workspace waiting for you.
Tips 1: my current MATLAB version is 2012a, your case may be a little different but worth a shot.
Tips 2: Limitations: The derived eqs are accurate when the dynamic system constructed with SimPowerSystems module is LTI system, otherwise, the result may not be reliable.d, but there are some tips you should procede

Sign in to comment.

More Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!