Skip to content

Commit

Permalink
Update generate_model_latex.py (#4857)
Browse files Browse the repository at this point in the history
  • Loading branch information
YohannParis authored Sep 19, 2024
1 parent 6125e5d commit 6d953ae
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions packages/mira/tasks/generate_model_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,22 @@ def main():

t = sympy.Symbol(time)

# Observables
if len(model.observables) != 0:
obs_eqs = [
f"{{{obs.name}}}(t) = " + sympy.latex(obs.expression.args[0])
for obs in model.observables.values()
]

# Construct Sympy equations
odesys = [
sympy.latex(sympy.Eq(sympy.diff(sympy.Function(var)(t), t), terms))
for var, terms in odeterms.items()
]

#add observables.
odesys += obs_eqs
# Observables
if len(model.observables) != 0:
obs_eqs = [
f"{{{obs.name}}}(t) = " + sympy.latex(obs.expression.args[0])
for obs in model.observables.values()
]

#add observables.
odesys += obs_eqs

#Reformat:
odesys = "\\begin{align} \n " + " \\\\ \n ".join([eq for eq in odesys]) + "\n\\end{align}"

Expand Down

0 comments on commit 6d953ae

Please sign in to comment.