The most recent model of MATLAB, R2022a, has simply been launched! Right here I’ll share with you my favourite new Simulink options in MATLAB R2022a.
Mannequin Reference Native Solver
For so long as Simulink has existed, it has at all times been a undeniable fact that there might be just one single steady charge in a simulation. Effectively… not anymore!
Let’s take an instance the place you might have a simulation together with the quick dynamic of {an electrical} circuit and a mechanical system with a considerably slower dynamic. If the system was solved utilizing a steady solver, it needed to be solved utilizing the identical time steps. As you may think about, this isn’t optimum when it comes to efficiency since much more steps are taken to unravel the gradual mechanical system that might have theoretically been wanted.
Zero-Crossing Detection for Mounted-Step Solver
One other main addition to Simulink solvers is the likelihood to detect zero-crossing occasions with fixed-step solvers.
Within the Solver part of the mannequin configuration, you will notice this new possibility:
This setting can considerably enhance the accuracy of fashions with quick switching dynamics that should be solved utilizing a fixed-step solver to allow deployment to {hardware}. The settings for optimum variety of bracketing iterations and most variety of zero-crossing per step may help making certain that the generated code can respect real-time constraints.
Right here is an easy mannequin illustrating the affect of enabling fixed-step zero-crossing, discover the way it improves the outcomes in comparison with the variable-step reference:
If I run the mannequin and examine the output of the Integrator block, we are able to clearly see the affect of fixed-step zero-crossing
in(1:3) = Simulink.SimulationInput(mdl);
in(1) = in(1).setModelParameter(‘SolverType’,‘Variable-step’);
in(2) = in(2).setModelParameter(‘SolverType’,‘Mounted-Step’,…
‘EnableFixedStepZeroCrossing’,‘off’);
in(3) = in(3).setModelParameter(‘SolverType’,‘Mounted-Step’,…
‘EnableFixedStepZeroCrossing’,‘on’);
out = sim(in,‘ShowProgress’,‘off’);
plot(out(1).logsout.get(“pulse”).Values)
plot(out(1).logsout.get(“integrator”).Values); maintain on;
plot(out(2).logsout.get(“integrator”).Values)
plot(out(3).logsout.get(“integrator”).Values,‘-o’)
legend({‘Variable-Step’,‘Mounted-Step No ZC’,‘Mounted-Step ZC’},‘Location’,‘northwest’)
Many Redesigned Apps
One final thing I wish to level out about MATLAB R2022a is that a number of instruments and apps have been redesigned for a extra fashionable look and improved usability.
Listed here are just a few examples:
Now it is your flip
If there may be one characteristic specifically that you just want to see being coated in additional particulars on this weblog, additionally tell us within the feedback.