Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Commit

Permalink
Remove assert causing syntax error. (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktbolt committed Oct 3, 2023
1 parent 9a2d117 commit ecac577
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions svzerodsolver/use_steady_bcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,13 @@ def restore_internal_variables_for_capacitance_based_bcs(y_f, ydot_f, var_name_l
# compute value of internal variable
Pd = Pin - Qin * (Ra1 + Ra2)
volume_internal = Cc * (Pd - Pim)
assert volume_internal.size == 2, "Pim should be size 2."
assert volume_internal[0] == volume_internal[1], f"Entries of Pim are not equal."

if volume_internal.size != 2:
raise Exception("The input Pim data should be size of size 2.")

if volume_internal[0] != volume_internal[1]:
raise Exception("The input Pim data entries are not equal.")

var_name_list.append("var_0_" + block.block_name)
y0 = np.append(y0, np.array(volume_internal[0]))
ydot0 = np.append(ydot0, np.zeros(1)) # the time derivative of the soltn is zero b/c at steady-state
Expand Down

0 comments on commit ecac577

Please sign in to comment.