File Exchange Pick of the Week

Explore Your Physical Modeling Data

Posted by Will Campbell,

Will's pick this week is the Simscape Simulation Results Explorer by Atul Suri.

What's this, a new blogger? As Jiro and Brett continue their quest for the missing third amigo, they have graced me with the opportunity to select a few exchange contributions for this much-coveted award. I'm an aerospace engineer who has used MATLAB for over a decade. Since joining MathWorks, I have focused on Simulink, hence you will see favoritism towards Simulink contributions in my selections. Word to the wise, I am notorious as a perfectionist around the office. So get your submissions squeaky clean if you want to win the prize.

This week, I have selected a utility for our Physical Modeling tools. Simscape facilitates simulation of electrical, mechanical, hydraulic, magnetic, pneumatic, and thermal systems within Simulink. Rather than having to derive a system of equations and then implement those equations with basic Simulink blocks, I can instead schematically draft a physical network diagram. In the example below, I have created a simple Graetz bridge rectifier electrical circuit.

rectifier model

Ok, great. But how do I analyze the results of my simulation? Well, we could rely on Simulink Scope blocks to acquire time traces of data. Simscape Probes is a former Pick of the Week winner that streamlines this process. However, if you go down this path, you can't escape the limitation that you will have to attach one Scope to every parameter you're interested in. If you want the voltage and current pertaining to every element of your diagram, that's going to require a lot of extra work.

Fortunately, it is possible to log all data in a Simscape diagram in one fell swoop. Within the Configuration Parameter Simscape tab, enable Data Logging.

Rectifier Configuration Parameters

Upon running your simulation, you will get a Simscape data logging variable. The structure of this variable can be explored manually, and you can leverage all  your traditional MATLAB analysis and visualization tools.

Atul's submission is a utility that makes examination of Simscape data even easier. Simply type ssc_explore(simlog) and a new window will open. It provides a data tree to explore the different elements of your physical network. We can open different elements and view plots of our data.

Simscape Simulation Results Explorer

This is one of my most-used File Exchange contributions. And for that, it is my inaugural Pick of the Week.

Comments
Let us know what you think here or leave a comment for Atul.

Comments are closed.

These postings are the author's and don't necessarily represent the opinions of MathWorks.