Guy and Seth on Simulink

Results for: Numerics

Simulink Debugger: Monitoring Variable Step Solver Performance 2

Posted by Guy Rouleau,

Simulink Debugger: Monitoring Variable Step Solver Performance A few months ago I introduced my favorite command to analyze the performance of a variable-step solver. This week, I will introduce how the Simulink Debugger can be used for a deeper analysis of variable-step solvers performance. For this, we will use the debugger command-line interface. Launching the debugger For this example, let's... read more >>

Why do we need Stiff ODE Solvers? 1

Posted by Guy Rouleau,

Why do we need Stiff ODE Solvers? I hope you have noticed the new MATLAB Central blog: Cleve's Corner. Cleve once said "stiffness is an efficiency issue." Let's explore this from a Simulink point of view by revisiting an article by Cleve in MATLAB News and Notes, May 2003: Stiff Differential Equations. Example Problem If you search... read more >>

THE Most Useful Command for Debugging Variable Step Solver Performance 2

Posted by Guy Rouleau,

THE Most Useful Command for Debugging Variable Step Solver Performance Today I want to share a trick I often use to determine if a variable step simulation runs as fast as it should. Visualizing the steps taken by a model To begin, save the simulation time data. This can be done from the Data Import/Outport pane of the model configuration. Once the simulation... read more >>

Different Results in Accelerated Mode Versus Normal Mode 8

Posted by Guy Rouleau,

Different Results in Accelerated Mode Versus Normal Mode By Guy Rouleau This week I received a large model giving different results when used as a referenced model in Accelerated mode, compared to the Normal Mode. To give you an idea, the top model in this application looked like this: After a quick inspection of the model, I found nothing obvious.... read more >>

Wrong Answers and Gimbal Lock 6

Posted by Guy Rouleau,

Wrong Answers and Gimbal Lock By Guy Rouleau I received a request last week where the code generated using Real-time Workshop was giving different answers from the original simulation. This type of requests is the one that scares me the most, because the goal of Real-Time Workshop is to generate a code equivalent to a Simulink... read more >>

Did I just get a different answer? 3

Posted by Seth Popinchalk,

Did I just get a different answer?  As part of any well designed Model Based Design work-flow, you need to ensure that you get the expected results from your simulation. You might want to evaluate the effect of... read more >>

Round-off Error

Posted by Seth Popinchalk,

Round-off Error Loren recently posted a simple example of how single-threaded computations might produce different results from multi-threaded computations.  The cause is floating-point round off, and most people are surprised to learn that the "different" results actually agree!  In this post, I want to explore this same example in Simulink. Order of Operations is Important Loren’s example shows that... read more >>

Floating-Point Numbers 6

Posted by Seth Popinchalk,

Floating-Point Numbers  Numeric simulation is all about the numbers.  In a previous post, I talked about integer and fixed-point number representations.  These numbers are especially useful for discrete simulation and embedded systems.  For continuous dynamic systems, the values do not represent discrete values but continuously changing functions in time.  For this, floating-point numbers provide the flexibility and range... read more >>

How do I test for NaN in Simulink R2009b? (NEW!) 2

Posted by Seth Popinchalk,

How do I test for NaN in Simulink R2009b? (NEW!)  Back in February 2009 I posted about how to test for NaN in Simulink.  The approach I talked about was more of a logical experiment based on the special properties of NaN than an ideal software solution.  In Simulink R2009b the Relational Operator block got an upgrade to include isNaN.  Let’s see how it... read more >>

Refining the Output of a Simulation 5

Posted by Seth Popinchalk,

Refining the Output of a Simulation Today I am pleased to share a post from regular guest blogger, Guy Rouleau.  Enjoy! I often use Simulink to model the dynamics of simple systems. In most cases, the Simulink default settings provide a good tradeoff between accuracy and simulation speed. These settings usually allow me to observe the signals I am interested in. I recently... read more >>

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