How to dynamically change a block parameter value during simulation run-time?
21 views (last 30 days)
Show older comments
I have been trying to find an easy way of doing this, but have failed till now. The problem is like this: I want to implement a diode using an exponential approximation model (Shockley model). In the exponential model, I have the option of modifying the Saturation Current value only at the beginning of simulation, as it is not a tunable parameter. Is there any way by which I can allow the simulation to itself calculate the value of I_S at every fixed number of steps and update the Diode parameter periodically?
I have attached the model which I am working on. My objective is to reproduce a diode thermal behavior by constantly changing the I_S value of a thermally-invariable diode model in Simulink. In this example, I have used a thermally-ACTIVE diode to behave as a real diode, approximated its I_S based on real-time i-v values. Now, I want periodically update the I_S value of the second diode (thermally-INACTIVE) so that it emulates the real diode. I want to see the effects of transmission delay/jitter on the accuracy of reproduction.
This is an introductory step into doing a similar exercise for a full-fledged automotive converter/inverter for remote simulation.
0 Comments
Answers (1)
Chinmayi Lanka
on 11 Apr 2017
Edited: Chinmayi Lanka
on 11 Apr 2017
Simulink provides an API that allows programmatic access to block data. You could use this API to achieve what you want to do. You can refer to the following documentation on 'Access Block Data During Simulation': https://uk.mathworks.com/help/releases/R2017a/simulink/ug/accessing-block-data-during-simulation.html
Here is a tutorial on how to tune and experiment with Block Parameter Values: https://uk.mathworks.com/help/releases/R2017a/simulink/ug/using-tunable-parameters.html
You could also use a GUI to easily tune parameters, as explained in the following example: https://uk.mathworks.com/help/simulink/ug/tune-and-visualize-your-model-with-dashboard-blocks.html
2 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!