Skip to content

Conversation

@adrian-nilsson-fcc
Copy link

@adrian-nilsson-fcc adrian-nilsson-fcc commented Oct 14, 2024

Fixes two bugs in the HeatTransfer examples in ch. 3.

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 results 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))

The example gave a "Translation Error" since to the variable `i` is
never declared.
It seems like the first term was simply not vectorized when the example
was updated in a87d4af
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong units in Rod_ForLoop

1 participant