Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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