Logical flag for energy conservation
PlantInfoObj — Instance of
autoblks.pwr.PlantInfo object for the system that you want to
flag — Indicator of energy conservation
Indicator of energy conservation, returned as a logical
To determine if the system conserves energy, the
isEnrgyBalanced method checks the energy conservation at each time step.
Blocks change the input energy plus released stored energy to output energy plus stored energy. For example, a mapped engine block uses fuel (not transferred energy) to produce torque (transferred energy) and heat loss (not transferred energy). The total modified energy represents the average between the input fuel energy and the energy exiting the system (torque and heat loss). To calculate the total energy modified by the block, the method uses the integral of the average transferred, not transferred, and stored power.
If the energy conservation error is within an error tolerance, the method returns true. Specifically, if either condition is met, the method returns true.
The equations use these variables.
Energy conservation error
Total energy modified by block
Energy balance relative and absolute tolerance, respectively
Transferred power and energy, respectively
Not transferred power and energy, respectively
Stored power and energy, respectively
Input and output power logged by Power Accounting Bus Creator block
Introduced in R2019a