AMICI-dev / AMICI

Advanced Multilanguage Interface to CVODES and IDAS
https://amici.readthedocs.io/
Other
107 stars 30 forks source link

Piecewise function #2454

Closed aidinbii closed 3 days ago

aidinbii commented 1 month ago

Hello, I want to ask whether the piecewise function is working correctly Because in my simulations it's behaving not as I'm expecting

Example of, how I'm using it:

functions:
    - functionId: antigen
      arguments: x
      formula: piecewise(0.02 * x, (x >= 100) && (x <= 150), 1, x > 150, 0)

odes:
    - stateId: mu_4
      rightHandSide: 1*(k_pDC_Antigen_f * mu_1 *antigen(t)) - 1*(k_pDC_d * mu_4)
      initialValue: 10

    - stateId: antigen_state
      rightHandSide: antigen(t) 
      initialValue: 0
    ...
    ...

M82_simulation_states_inner_MODE_AntigenState

Thanks

FFroehlich commented 1 month ago

Could you clarify why the effects that you observe are unexpected?