家伙在simu金宝applink上

金宝app基于模型的设计

What’s New in Simulink R2022a!

MATLAB最新版本R2022A刚刚发布!在这里,我将与您分享我最喜欢的MATLAB R2022A中的新Simulink功能。金宝app

型号参考本地求解器

只要Simulink has existed, it has always been a fact that there could be only one single continuous rate in a simulation. Well... not anymore!
Let's take an example where you have a simulation including the fast dynamic of an electrical circuit and a mechanical system with a significantly slower dynamic. If the system was solved using a continuous solver, it had to be solved using the same time steps. As you can imagine, this is not optimal in terms of performance since a lot more steps are taken to solve the slow mechanical system that could have theoretically been needed.
让我们看看我们如何使用 模型引用 解决这个问题。
在里面 模型引用 模型配置的部分,您将看到一个新的选项,以指定在引用模型时选择的求解器,与顶部模型的求解器相反,将其引用为先前版本中的求解器。回想一下,在先前的版本中,层次结构中的最高模型确定了哪个求解器将用于在参考模型中集成连续状态。
引用模型时,在对话框中 Model block , you will see a new "Solver" tab reporting which solver is being used:
To illustrate that, I put together a simple model referencing two other models, one simulating a stiff system solved with steps of 0.01 second using the ode1be solver, and the other a less stiff system solved using steps of 0.1 second using the ode1 solver. If I enable the logging of states in the top model and display the results in the 模拟Data Inspector 有了标记,我可以看到它们已经使用不同的步骤解决了:
Check out the 本地求解器基础 文档以开始此功能。

固定步骤求解器的零交叉检测

Simulink求解器的另一个主要补充是可以检测使用金宝app固定步骤求解器的零交叉事件。
在里面Solver section of the model configuration, you will see this new option:
This setting can significantly improve the accuracy of models with fast switching dynamics that need to be solved using a fixed-step solver to enable deployment to hardware. The settings for maximum number of bracketing iterations and maximum number of zero-crossing per step can help ensuring that the generated code can respect real-time constraints.
Here is a simple model illustrating the impact of enabling fixed-step zero-crossing, notice how it improves the results compared to the variable-step reference:
If I run the model and compare the output of the Integrator block, we can clearly see the impact of fixed-step zero-crossing
mdl ='testZC';
在(1:3)= si金宝appmulink.simulationInput(MDL);
在(1)= in(1).setModelParameter(“ solverType”,'Variable-step');
在(2)= in(2).setModelParameter(“ solverType”,'Fixed-Step',。。。
'启用固定的旋转式折叠式'','离开');
在(3)= in(3).setModelParameter(“ solverType”,'Fixed-Step',。。。
'启用固定的旋转式折叠式'','on');
out = sim(in,'ShowProgress','离开');
figure(1);clf
子图(2,1,1)
绘图(out(1).logsout.get("pulse").Values)
轴([0 10 -1.2 1.2])
子图(2,1,2)
绘图(out(1).logsout.get(“集成商”)。值);抓住;
绘图(out(2).logsout.get(“集成商”).Values)
绘图(out(3).logsout.get(“集成商”).Values,'-o')
传奇({'Variable-Step',“固定步骤否ZC”,'Fixed-Step ZC'},,'地点','northwest')

Many Redesigned Apps

我想指出的关于MATLAB R2022A的最后一件事是,重新设计了多个工具和应用程序,以实现更现代的外观和提高可用性。
这里有一些例子:

现在轮到你了

看一下 R2022A发行说明 在下面的评论中,让我们知道您最喜欢的功能是什么。
如果您特别想在此博客中看到更多的详细信息涵盖一项功能,请在评论中告诉我们。
|
  • print
  • send email

评论

To leave a comment, please click这里to sign in to your MathWorks Account or create a new one.