How to use run-time tunable parameter for Constant Volume Chamber (G)

When you use e.g. a DoubleActing Actuator (IL) in Simulink/SimScape, you can select that the initial position displacement parameter should be run-time tunable from a dropdown menu, instead of compile-time tunable.
How can you make a parameter for the initial pressure of the gas to be run-time tunable for a "Constant Volume Chamber (G)"?
Here the there is no option to change from compile-time to run-time.
Exported c++ code has this value hardcoded according to the current value of the parameter in the Workspace.

1 Comment

I think it's do-able. Try this first: make this InitialPressure a Simulink Parameter in the Model Workspace, instead of MATLAB base workspace variable. Will you see it available in the generated code, instead of hard-coded?

Sign in to comment.

Products

Release

R2021a

Asked:

on 8 May 2023

Answered:

on 7 Sep 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!