Defining initial condition for a group of Simscape components

I am trying to set a single overarching initial condition for a group of Simscape electrical components that lie within a larger Simscape model. For example, in the following image, how do I set the initial voltage of the Voltage Sensor block 'VSensor' to a particular value?

 Accepted Answer

Currently, Simscape does not support directly setting the initial targets for voltage and current sensor blocks.
As a workaround, you can add a 'resistor' block, with a very high resistance in parallel to the voltage sensor block. Let us call this new resistor the 'shunt resistor'. The following figure shows the placement of the shunt resistor 'R_Shunt' for the example problem.
Due to a very high resistance, the shunt resistor will almost behave like an open circuit. You can then set the initial voltage of this shunt resistor and that setting would reflect as the initial voltage for the voltage sensor block. To set the initial voltage for the shunt resistor and configure the model to utilize this initial voltage, please perform the following steps:
  1. Double-click on the shunt resistor's block. In the 'Initial Targets' section, enable the 'Voltage' option. Set the initial voltage to the desired value and set it’s priority to 'High'.
  2. Remove initial voltage targets from all other electrical blocks. They might interfere with the initial settings of the shunt resistor block.
  3. For the ‘Solver’ block, uncheck the ‘Start simulation from steady state’ option. This is not required and will interfere with the initial value settings.
Please also note that the resistance of the shunt resistor should be very high but will still be finite. As a result, the simulation results may be affected, specifically for highly sensitive systems.

More Answers (0)

Categories

Find more on Simscape Electrical in Help Center and File Exchange

Products

Release

R2022a

Community Treasure Hunt

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

Start Hunting!