ModelicaBook icon indicating copy to clipboard operation
ModelicaBook copied to clipboard

Fix a unit and update a term to be vectorized in ArrayEquations.HeatTransfer

Open adrian-nilsson-fcc opened this issue 4 months ago • 0 comments

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:

  1. it refers to the variable i, which is never declared in this example
  2. 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))

adrian-nilsson-fcc avatar Oct 14 '24 16:10 adrian-nilsson-fcc