ModelicaBook
ModelicaBook copied to clipboard
Fix a unit and update a term to be vectorized in ArrayEquations.HeatTransfer
Fixes two bugs in the HeatTransfer
examples.
Wrong unit for ConvectionCoefficient
Fixes #454
Missing vectorization
The first term of the derivative that uses vector notation has two problems:
- it refers to the variable
i
, which is never declared in this example - it is written to result in a scalar rather than a vector
The solution presented in this PR is straightforward: Replace
-h*A_s*(T[i]-Tamb)
with
-h*A_s*(T[2:n-1]-fill(Tamb, n-2))