- If "height" can be fed in using a Simulink Constant block that is connected to a motion-actuated Joint block in SimMechanics, then this approach would work.
- If "height" is a parameter in a Solid or Rigid Transform block, then you will not be able to change these values mid-simulation.
How can I set a block parameter dynamically during simulation? (e.g. with workspace variable)
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hansm
am 23 Mai 2015
Kommentiert: tq yu
am 15 Mai 2019
Hi there! I have encountered a problem while using Simmechanics: I have a masked block with a single parameter "height". I want this parameter to be changed dynamically during simulation. This means, instead of writing a value in the parameters field, I want to use a workspace variable. I have tried using a workspace variable, but the block reads the variable only on simulation start and then never again. How can I solve this? Thank you very much, Hans
0 Kommentare
Akzeptierte Antwort
Sebastian Castro
am 25 Mai 2015
What does that "height" variable reference? If it's inside SimMechanics blocks, then that value cannot be changed mid-simulation. It's only if your variable is on a Simulink block (Constant, Gain, etc.) that this will work.
For example,
Also, if your model has the possibility for a tunable "height" variable, you still need to pause the simulation, update the diagram, and then resume the simulation for the changes to take effect.
- Sebastian
8 Kommentare
Sebastian Castro
am 17 Jun. 2015
I wouldn't recommend it. If you use a mass on the Simscape side, it will only affect that joint -- however, all the masses/inertias for all dimensions on the SimMechanics side will not consider this mass, thereby leading to potential inconsistencies.
tq yu
am 15 Mai 2019
could you please give me some advice on hou to update the datas from workspace to simulink ,while the the simulation in on ? i have datas from sensors varing with time ,now i want to send them to simulink model to get a 'real-time' simulation .
Many thanks from china
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multibody Dynamics finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!