isEnrgyBalanced
Logical flag for energy conservation
Description
returns logical flag
=isEnrgyBalanced(PlantInfoObj
)1
(true
) if the system conserves
energy. Otherwise, it returns logical 0
(false
).
Input Arguments
Output Arguments
Algorithms
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.
Condition | ||
---|---|---|
| or |
|
The equations use these variables.
EErr | Energy conservation error |
Etotal | Total energy modified by block |
EnrgyBalRelTol, EnrgyBalAbsTol | Energy balance relative and absolute tolerance, respectively |
Ptrans, Etrans | Transferred power and energy, respectively |
Pnottrans, Enottrans | Not transferred power and energy, respectively |
Pstore, Estore | Stored power and energy, respectively |
Pinput, Poutput | Input and output power logged by Power Accounting Bus Creator block |
Version History
Introduced in R2019a