-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
E.g. before fitting you'll want to change statements like
g_Kr = piecewise(cell.type == 0, 1, cell.type == 1, 1.2, cell.type == 2, 1.43) * g_Kr_base
g_Kr_base = 0.123
to
g_Kr = 0.123
by doing e.g.
# Set the cell type you want
switch = m.get('cell.mode')
switch.set_rhs(1)
# Freeze all the (constant) variables to this mode
for var in switch.refs_by():
if var.is_constant():
# Evaluate the variable's RHS, and set its new RHS to the result
var.set_rhs(var.eval()) # Remove the switch, if unused
# Remove unused child variables, if any
what's the best way to do this, if they depend on each other?
if not switch.refs_by():
switch.parent().remove_variable(switch)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation