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

Easy insertion of equations into the model at specific position #49

Closed
luyckxn opened this issue May 19, 2022 · 1 comment
Closed

Easy insertion of equations into the model at specific position #49

luyckxn opened this issue May 19, 2022 · 1 comment

Comments

@luyckxn
Copy link
Collaborator

luyckxn commented May 19, 2022

E.g. add equation CP=A_CENTRAL/VC into the ODE code record.

@luyckxn luyckxn closed this as completed May 23, 2022
@luyckxn luyckxn changed the title Add model statements into the given code record Easy insertion of equations into the model at specific position May 24, 2022
@luyckxn
Copy link
Collaborator Author

luyckxn commented May 24, 2022

From now on, position argument 'pos' available in method 'add' also allows code records elements.

For instance, to add an equation CP=A_CENTRAL/VC into the ODE code record, you can proceed as follows:

model <- model %>% add(Equation("CP", "A_CENTRAL/VC"), pos=Position(OdeRecord(), after=<logical>))

after=TRUE (default) -> equation is appended at the end of the ODE record.
after=FALSE -> equation is appended at the beginning of the ODE record.

Please note that Position() also accepts any model statement, as shown below.

model <- model %>% add(Equation("CP", "A_CENTRAL/VC"), pos=Position(Ode("A_OUTPUT"), after=<logical>))

In this case, the equation is added before or after the ODE 'OUTPUT' depending on 'after'.

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

No branches or pull requests

1 participant