simulink

How to make a Simulink model constant?

坚强是说给别人听的谎言 提交于 2021-01-29 18:37:00
问题 I have a model in Simulink (2018a) which has more models inside. So I have: parent.slx --> child.slx I want child.slx to execute only once in the whole simulation, so basically its output will be constant at all times. 回答1: You should be using the Model Block to call the child model. Put this block into an Enabled Subsystem Block in the parent model and create the enable signal in the following way: You also need to make sure that the outport blocks within the subsystem are set to hold their

Calling python functions from MATLAB workers

与世无争的帅哥 提交于 2021-01-28 04:52:49
问题 I'm trying to run a MATLAB script using parfor which runs a simulink model in parallel by sim function, and this simulink model contains a MATLAB Function Block. The function defined in this block calls a python function using "py." mechanism. Unfortunately, the run sometimes seems stuck in the middle, when I fed a large number of simulations. The debugging output stops to show up. I suspect a deadlock somewhere. So, my questions are Can we run a simulink model which contains python functions

How to fix missing simulink simulation artificats issue when running test in parallel mode?

谁都会走 提交于 2020-12-13 03:10:11
问题 I have 29 Simulink/Matlab Test. It has a lot of different reference models. Before running a 20 second simulation , it has to load all reference models and create a lot of simulation artifacts in a work folder. A lot of reference model are shared in-between test. When running one test at a time, I have no issue, all simulation artifact are created and used to run the various simulation. Everything Passes. When running it all via parallel processing. I have a issue.Some simulation artifact are

How to fix missing simulink simulation artificats issue when running test in parallel mode?

谁说我不能喝 提交于 2020-12-13 03:09:13
问题 I have 29 Simulink/Matlab Test. It has a lot of different reference models. Before running a 20 second simulation , it has to load all reference models and create a lot of simulation artifacts in a work folder. A lot of reference model are shared in-between test. When running one test at a time, I have no issue, all simulation artifact are created and used to run the various simulation. Everything Passes. When running it all via parallel processing. I have a issue.Some simulation artifact are

What is the best way to build a model of automated system with neural network in Simulink (Matlab)?

倾然丶 夕夏残阳落幕 提交于 2020-12-12 12:18:10
问题 I'm tring to build a model contating neural network in Simulink. My idea is to compose a model which includes a controlled object (electrical drive), PID controller and NN block for fine-tuning of the PID controller. NN training is provided for to be the reinforcement learning. NN calculates the koefficients of the PID controller, then it receives the feedback from the output of the object and calcucales the koefficients for the next cycle to minimize the static error. I've build the model

Solving ODEs inside a Subsystem in Simulink

梦想与她 提交于 2020-12-10 07:20:18
问题 I'm trying to figure out how to solve a system of ODEs inside a subsystem in a Simulink model. Basically, each call to this subsystem, which happens at each tick of the simulation clock (fixed-step), entails solving the ODEs. So there's like a different "clock" for the subsystem. I have an M-file that implements the function for the system of ODEs. Currently, I have a MATLAB Function block for that. It needs a lot of parameters that I can get from the base workspace (via evalin and using

Non-constant Torque issue in FOC algorithm (Simulink)

瘦欲@ 提交于 2020-04-17 19:11:49
问题 I am trying to develop an FOC algorithm in Simulink (see image attached) but I am having extrange results in my simulation. My torque is not constant, when it should, but varying periodically (see image attached), when it should be constant at 2 Nm. Also the scope for my q-axis current my probe is giving me a strange graph (see image attached) I can't even make sense of. Please if anyone could help me I would really appreciate it since I have no clue what is going on. I don't know if it could

嵌入式系统实时仿真解决方案

耗尽温柔 提交于 2020-03-17 11:09:15
ETest_RT是一款完全自主知识产权的半实物仿真测试平台(HIL)集成开发环境。该开发环境采用标准化的硬件模块和分层结构化的软件平台,实现了半实物仿真测试与验证环境搭建的功能,主要应用于装备嵌入式软件半实物仿真测试平台的快速开发与实施。 ETest_RT深度集成Simulink,提供Simulink模型的运行及验证环境。利用各种总线接口同外围其他设备连接搭建起半实物仿真环境,运行仿真模型验证功能,通过调参功能,能够自动提取模型内部的增益参数,在运行时调整参数值,可实时查看在不同参数条件下模型的运行情况。 下面就来看看ETest_RT是如何实现Simulink模型的设置和运行。 使用ETest_RT进行仿真,模型是运行在一台工控机上的。工控机预装了实时操作系统,并且能够接受运行在另一台主机上的“仿真执行器”下发的指令。这台工控机预装了一系列控制卡,可以支持各种通信接口。在半实物仿真环境中,这些通信接口都可以用来同系统的其他部件(或实物)进行连接。 执行环境准备好后,我们还需要使用ETest_RT进行模型的准备和设置。 打开ETest_RT,首先新建一个测试项目,后面的所有操作都将在这个项目中完成设置。 1 配置物理接口 从“仿真”工具栏中选择“外围系统”,“通道”添加在“外围系统”上。在“通道”上添加“协议”。协议具有数据描述功能,并且可以在运行时自动解包、打包。 图 1交联关系图