ukhsa-collaboration / pygom

ODE modelling in Python
GNU General Public License v2.0
27 stars 20 forks source link

Switching to state*parameter when defined in transistion object as parameter*state #59

Open m-d-grunnill opened 2 years ago

m-d-grunnill commented 2 years ago

If when constructing a model with transitions the standard parameterstate is used in the equation argument that defines a transition, when using the methods on the model class model.get_ode_eqn(), model.print_ode() or model.print_ode(latex_output=True) the format is changed to stateparameter.

For instance say for a simple SIR model the imunity transition is defined as:

Transition(origin='I',  destination='R', equation='gamma*I', transition_type=TransitionType.T)

When using model.print_ode(latex_output=True) the immunity term in the output becomes I\gamma.

Not sure if this is an issue with Sympy in the background. I think something similar happened when I was using sympy for stable point analyses.

m-d-grunnill commented 2 years ago

As stated above I beleive this is an issue with sympy. As such I have reaised a qustion on stack overflow that will hopefully lead to a solution: https://stackoverflow.com/questions/70156863/sympy-control-display-order-of-coefficients-in-multiplication