# \#ode

**URL:** https://discourse.mc-stan.org/tag/ode/59.md?page=1

[Latest](https://discourse.mc-stan.org/latest.md) · [Categories](https://discourse.mc-stan.org/categories.md) · [Tags](https://discourse.mc-stan.org/tags.md)

**Page:** 2

---

## [CoDatMo Liverpool & UNINOVE models (slow ODE implementation and Trapezoidal Solver)](https://discourse.mc-stan.org/t/codatmo-liverpool-uninove-models-slow-ode-implementation-and-trapezoidal-solver/22500)

<div class="topic-metadata">

**Author:** [@storopoli](https://discourse.mc-stan.org/u/storopoli)\
**Replies:** 94\
**Last updated:** [November 9, 2021, 9:10am UTC](https://discourse.mc-stan.org/t/codatmo-liverpool-uninove-models-slow-ode-implementation-and-trapezoidal-solver/22500 "2021-11-09T09:10:56Z")

</div>

Hey guys! I was discussing a possible trapezoidal ODE solver implementation in Stan with @wds15, @Bob\_Carpenter, @bbbales2 and @charlesm93 and the discussion took a detour to “what are you doing that you need a trapezoid…

---

## [Reaching max\_num\_steps in the ODE solver](https://discourse.mc-stan.org/t/reaching-max-num-steps-in-the-ode-solver/21448)

<div class="topic-metadata">

**Author:** [@wds15](https://discourse.mc-stan.org/u/wds15)\
**Replies:** 17\
**Last updated:** [September 11, 2021, 4:16pm UTC](https://discourse.mc-stan.org/t/reaching-max-num-steps-in-the-ode-solver/21448 "2021-09-11T16:16:15Z")

</div>

ADMIN EDIT: Created this as a new topic to discuss a subquestion that arised in Adjoint ODE Prototype - RFC - Please Test (@martinmodrak ) No. I would see it as a divergent transition thing. It should not happen, but w…

---

## [User-defined function calls in transformed data block (for SBC, with differential equations)](https://discourse.mc-stan.org/t/user-defined-function-calls-in-transformed-data-block-for-sbc-with-differential-equations/24187)

<div class="topic-metadata">

**Author:** [@Matthew\_Spencer1](https://discourse.mc-stan.org/u/Matthew_Spencer1)\
**Replies:** 3\
**Last updated:** [September 4, 2021, 4:10pm UTC](https://discourse.mc-stan.org/t/user-defined-function-calls-in-transformed-data-block-for-sbc-with-differential-equations/24187 "2021-09-04T16:10:38Z")

</div>

I have a working stan model (tested using cmdstan 2.25.0) that uses the ode\_rk45 differential equation solver to generate multinomial probabilities \\mathbf z\_t for observations at many different times t, in many differen…

---

## [Writing new Stan C++ code: share your tips!](https://discourse.mc-stan.org/t/writing-new-stan-c-code-share-your-tips/23705)

<div class="topic-metadata">

**Author:** [@Teddy\_Groves1](https://discourse.mc-stan.org/u/Teddy_Groves1)\
**Replies:** 5\
**Last updated:** [July 31, 2021, 7:41am UTC](https://discourse.mc-stan.org/t/writing-new-stan-c-code-share-your-tips/23705 "2021-07-31T07:41:21Z")

</div>

My colleagues and I are trying to add some C++ functionality to Stan (specifically we want to write some new functions for solving steady state problems). At first we will just use the new functions for our own problems …

---

## [Slow sampling in simple ode](https://discourse.mc-stan.org/t/slow-sampling-in-simple-ode/23397)

<div class="topic-metadata">

**Author:** [@Chechgm](https://discourse.mc-stan.org/u/Chechgm)\
**Replies:** 39\
**Last updated:** [July 16, 2021, 11:50am UTC](https://discourse.mc-stan.org/t/slow-sampling-in-simple-ode/23397 "2021-07-16T11:50:43Z")

</div>

Hi all! I am trying to fit what I believe is a simple ODE model: functions { vector diffeq(real t, vector y, row\_vector\[\] theta) { vector\[14\] dydt; for (i in 1:14) { dydt…

---

## [R CMD SHLIB error for ODE-model](https://discourse.mc-stan.org/t/r-cmd-shlib-error-for-ode-model/23428)

<div class="topic-metadata">

**Author:** [@pasjor](https://discourse.mc-stan.org/u/pasjor)\
**Replies:** 2\
**Last updated:** [July 14, 2021, 10:44am UTC](https://discourse.mc-stan.org/t/r-cmd-shlib-error-for-ode-model/23428 "2021-07-14T10:44:11Z")

</div>

Hello, I have written an IRT model which involves a user-defined probability function. To compute the latter, I need to integrate the exponential of a spline. I accomplished this via “integrate\_ode\_rk45” and it compiled…

---

## [Adjoint ode: different behaviour in cmdstan-ode-adjoint-v2 vs cmdstan-2.27.0](https://discourse.mc-stan.org/t/adjoint-ode-different-behaviour-in-cmdstan-ode-adjoint-v2-vs-cmdstan-2-27-0/23388)

<div class="topic-metadata">

**Author:** [@Teddy\_Groves1](https://discourse.mc-stan.org/u/Teddy_Groves1)\
**Replies:** 3\
**Last updated:** [July 13, 2021, 11:39am UTC](https://discourse.mc-stan.org/t/adjoint-ode-different-behaviour-in-cmdstan-ode-adjoint-v2-vs-cmdstan-2-27-0/23388 "2021-07-13T11:39:55Z")

</div>

My colleagues and I have been having some trouble with a model that uses the recently-released adjoint ode solver and would really appreciate some help. The background is that we are making an application for fitting Ba…

---

## [How to debug "Gradient evaluated at the initial value is not finite" error](https://discourse.mc-stan.org/t/how-to-debug-gradient-evaluated-at-the-initial-value-is-not-finite-error/22860)

<div class="topic-metadata">

**Author:** [@Robert\_Dodier](https://discourse.mc-stan.org/u/Robert_Dodier)\
**Replies:** 2\
**Last updated:** [June 5, 2021, 2:06am UTC](https://discourse.mc-stan.org/t/how-to-debug-gradient-evaluated-at-the-initial-value-is-not-finite-error/22860 "2021-06-05T02:06:49Z")

</div>

Hi, I’m working with an ODE model in RStan 2.26.1. The log\_prob function is calculated correctly from what I can tell – it matches what I calculate by hand from the mean-square error of the difference between the ODE sol…

---

## [Adjoint ODE Prototype - RFC - Please Test](https://discourse.mc-stan.org/t/adjoint-ode-prototype-rfc-please-test/21212)

<div class="topic-metadata">

**Author:** [@wds15](https://discourse.mc-stan.org/u/wds15)\
**Replies:** 39\
**Last updated:** [April 7, 2021, 3:34pm UTC](https://discourse.mc-stan.org/t/adjoint-ode-prototype-rfc-please-test/21212 "2021-04-07T15:34:14Z")

</div>

Hi all ODE Stan modelers! We are currently in the process to add a new adjoint ODE solver to Stan. The benefit of this approach is it’s much better scalability which makes it well suited for large ODE problems. In parti…

---

## [Using reduce\_sum for ODE parallelisation](https://discourse.mc-stan.org/t/using-reduce-sum-for-ode-parallelisation/21479)

<div class="topic-metadata">

**Author:** [@Philipp-Neubauer](https://discourse.mc-stan.org/u/Philipp-Neubauer)\
**Replies:** 24\
**Last updated:** [April 5, 2021, 12:35pm UTC](https://discourse.mc-stan.org/t/using-reduce-sum-for-ode-parallelisation/21479 "2021-04-05T12:35:09Z")

</div>

Hi wonderful Stan folks - I’m looking to parallelize an (otherwise slow) ODE model. To this end I installed rstan 2.26.1 dev (& StanHeaders) according to this post; verified that the original (non-parallel) model compi…

---

## [Fitting ODE models: best/efficient practices?](https://discourse.mc-stan.org/t/fitting-ode-models-best-efficient-practices/21018)

<div class="topic-metadata">

**Author:** [@Funko\_Unko](https://discourse.mc-stan.org/u/Funko_Unko)\
**Replies:** 85\
**Last updated:** [March 29, 2021, 4:53pm UTC](https://discourse.mc-stan.org/t/fitting-ode-models-best-efficient-practices/21018 "2021-03-29T16:53:11Z")

</div>

Inspired by @charlesm93 's recent talk on fitting ODE models in Stan (see e.g. https://mc-stan.org/users/documentation/case-studies/planetary\_motion/planetary\_motion.html), I was wondering whether there exists a collatio…

---

## [Help using new ode interface, getting incompatable types](https://discourse.mc-stan.org/t/help-using-new-ode-interface-getting-incompatable-types/21567)

<div class="topic-metadata">

**Author:** [@betascoo8](https://discourse.mc-stan.org/u/betascoo8)\
**Replies:** 3\
**Last updated:** [March 29, 2021, 4:25pm UTC](https://discourse.mc-stan.org/t/help-using-new-ode-interface-getting-incompatable-types/21567 "2021-03-29T16:25:48Z")

</div>

Hi, Hopefully this is obvous to someone more familiar with the new ode interface. I’ve worked through the examples provided by Upgrading to the new ODE interface but i’m still struggling to quite figure out what i’m do…

---

## [Different ODE solutions by integrate\_ode\_bdf and integrate\_ode\_rk45](https://discourse.mc-stan.org/t/different-ode-solutions-by-integrate-ode-bdf-and-integrate-ode-rk45/15751)

<div class="topic-metadata">

**Author:** [@Elizaveta\_Semenova](https://discourse.mc-stan.org/u/Elizaveta_Semenova)\
**Replies:** 4\
**Last updated:** [March 10, 2021, 8:48pm UTC](https://discourse.mc-stan.org/t/different-ode-solutions-by-integrate-ode-bdf-and-integrate-ode-rk45/15751 "2021-03-10T20:48:03Z")

</div>

I am working with an ODE system, where quantities live on the nanoscale. Rescaling of the states and parameter has helped to resolve the issue, but I would like to double-check my understanding: while working on the orig…

---

## [Case study: ODE-based models and multimodality](https://discourse.mc-stan.org/t/case-study-ode-based-models-and-multimodality/19604)

<div class="topic-metadata">

**Author:** [@charlesm93](https://discourse.mc-stan.org/u/charlesm93)\
**Replies:** 12\
**Last updated:** [February 25, 2021, 4:47pm UTC](https://discourse.mc-stan.org/t/case-study-ode-based-models-and-multimodality/19604 "2021-02-25T16:47:46Z")

</div>

@andrewgelman and I just uploaded a new case study: https://mc-stan.org/users/documentation/case-studies/planetary\_motion/planetary\_motion.html. Comments and questions are welcomed! Our initial intent was to construct …

---

## [What's the usage of ode\_adams?](https://discourse.mc-stan.org/t/whats-the-usage-of-ode-adams/20622)

<div class="topic-metadata">

**Author:** [@yizhang](https://discourse.mc-stan.org/u/yizhang)\
**Replies:** 4\
**Last updated:** [February 10, 2021, 7:53am UTC](https://discourse.mc-stan.org/t/whats-the-usage-of-ode-adams/20622 "2021-02-10T07:53:16Z")

</div>

@bbbales2 & @wds15 have lamented for quite a while the lack of application of ode\_adams in their modeling & development practice. This is partially my fault in being terse in documentation and later procrastination, and …

---

## [Estimating resources needed on a cluster](https://discourse.mc-stan.org/t/estimating-resources-needed-on-a-cluster/19833)

<div class="topic-metadata">

**Author:** [@zenkavi](https://discourse.mc-stan.org/u/zenkavi)\
**Replies:** 4\
**Last updated:** [December 17, 2020, 5:09pm UTC](https://discourse.mc-stan.org/t/estimating-resources-needed-on-a-cluster/19833 "2020-12-17T17:09:46Z")

</div>

I’m working on modeling large time series data using Stan models with ODE solvers. Not posting the specific model I have in mind here (I can in another thread under Modeling later) because I’m not sure it’s doing what I …

---

## [ODE control parameter documentation: questions and improvements](https://discourse.mc-stan.org/t/ode-control-parameter-documentation-questions-and-improvements/18999)

<div class="topic-metadata">

**Author:** [@jtimonen](https://discourse.mc-stan.org/u/jtimonen)\
**Replies:** 4\
**Last updated:** [December 14, 2020, 7:59pm UTC](https://discourse.mc-stan.org/t/ode-control-parameter-documentation-questions-and-improvements/18999 "2020-12-14T19:59:07Z")

</div>

Hello, I think the ODE docs (v2.25), particularly Section 13.6, has some parts that could be improved or clarified to give users better information on how to use the solvers. Tolerances Documentation says " relative\_to…

---

## [Error in integrate\_ode\_bdf, CVode error flag -1](https://discourse.mc-stan.org/t/error-in-integrate-ode-bdf-cvode-error-flag-1/19772)

<div class="topic-metadata">

**Author:** [@jehwald](https://discourse.mc-stan.org/u/jehwald)\
**Replies:** 5\
**Last updated:** [December 13, 2020, 10:35am UTC](https://discourse.mc-stan.org/t/error-in-integrate-ode-bdf-cvode-error-flag-1/19772 "2020-12-13T10:35:00Z")

</div>

Hi all, I am trying to debug my model which is supposed to model some epidemiological behavior. I use the function integrate\_ode\_bdf, however during warm-up i get the following error (for the line where the integrate\_od…

---

## [Binomial\_lpmf: Probability parameter\[1\] is 1, but must be in the interval \[0, 1\]](https://discourse.mc-stan.org/t/binomial-lpmf-probability-parameter-1-is-1-but-must-be-in-the-interval-0-1/19192)

<div class="topic-metadata">

**Author:** [@gmilne](https://discourse.mc-stan.org/u/gmilne)\
**Replies:** 36\
**Last updated:** [December 3, 2020, 11:39am UTC](https://discourse.mc-stan.org/t/binomial-lpmf-probability-parameter-1-is-1-but-must-be-in-the-interval-0-1/19192 "2020-12-03T11:39:12Z")

</div>

Hi Stan community. I’m new to the programme and I’m trying to fit a simple one parameter ODE model to some data. My likelihood function runs into a problem when the model is run in R, as follows: Chain 1: Rejecting init…

---

## [Data keyword for new ODE integrator interface](https://discourse.mc-stan.org/t/data-keyword-for-new-ode-integrator-interface/19316)

<div class="topic-metadata">

**Author:** [@chvandorp](https://discourse.mc-stan.org/u/chvandorp)\
**Replies:** 2\
**Last updated:** [November 19, 2020, 3:18pm UTC](https://discourse.mc-stan.org/t/data-keyword-for-new-ode-integrator-interface/19316 "2020-11-19T15:18:34Z")

</div>

Hi all, I really like the new interface for integrating ODEs in Stan version 2.4 and 2.5, because we no longer have to mess around with reconstructing parameter and data structures from 1d arrays. However, in the old i…

---

## [Fitting a SIR with beta as function of time. Chain got stuck](https://discourse.mc-stan.org/t/fitting-a-sir-with-beta-as-function-of-time-chain-got-stuck/16313)

<div class="topic-metadata">

**Author:** [@jandraor](https://discourse.mc-stan.org/u/jandraor)\
**Replies:** 12\
**Last updated:** [November 10, 2020, 3:35pm UTC](https://discourse.mc-stan.org/t/fitting-a-sir-with-beta-as-function-of-time-chain-got-stuck/16313 "2020-11-10T15:35:24Z")

</div>

Hi, I’m trying to fit incidence data to a SIR model. To verify if the process works, I generated synthetic data from the following model where y is the incidence. Here, I assume the incidence is C\_t - C\_{t-1} \\frac{dS…

---

## [Dealing with unknown data with rstan/ODE](https://discourse.mc-stan.org/t/dealing-with-unknown-data-with-rstan-ode/19179)

<div class="topic-metadata">

**Author:** [@Guanghui\_Zhu](https://discourse.mc-stan.org/u/Guanghui_Zhu)\
**Replies:** 2\
**Last updated:** [November 10, 2020, 3:34pm UTC](https://discourse.mc-stan.org/t/dealing-with-unknown-data-with-rstan-ode/19179 "2020-11-10T15:34:49Z")

</div>

I have a general question with regard to using stan to solve ODE problems. In the simple harmonic oscillator example, both y\[1\] and y\[2\] are supplied during the model fitting. In case of when only one variable can be obs…

---

## ["Variable does not exist" error for user-defined function in ode\_rk45](https://discourse.mc-stan.org/t/variable-does-not-exist-error-for-user-defined-function-in-ode-rk45/18960)

<div class="topic-metadata">

**Author:** [@zenkavi](https://discourse.mc-stan.org/u/zenkavi)\
**Replies:** 6\
**Last updated:** [October 29, 2020, 8:20pm UTC](https://discourse.mc-stan.org/t/variable-does-not-exist-error-for-user-defined-function-in-ode-rk45/18960 "2020-10-29T20:20:10Z")

</div>

Hi, I was trying to replicate the Lotka-Volterra case study as described here updating using the new ODE interface as described here. However at line vector\[2\] z\[N\] = ode\_rk45(dz\_dt, z\_init, 0, ts, alpha, beta, gamma, …

---

## [Simple harmonic oscillator ODE stan model from the Stan docs says function is not defined](https://discourse.mc-stan.org/t/simple-harmonic-oscillator-ode-stan-model-from-the-stan-docs-says-function-is-not-defined/18529)

<div class="topic-metadata">

**Author:** [@ctesta01](https://discourse.mc-stan.org/u/ctesta01)\
**Replies:** 2\
**Last updated:** [October 9, 2020, 3:15am UTC](https://discourse.mc-stan.org/t/simple-harmonic-oscillator-ode-stan-model-from-the-stan-docs-says-function-is-not-defined/18529 "2020-10-09T03:15:59Z")

</div>

Hi all, I’m trying to reproduce the Stan model from here: https://mc-stan.org/docs/2\_24/stan-users-guide/measurement-error-models.html I’ve saved the model as model.stan: functions { vector sho(real t, …

---

## [Troubleshooting ODE model](https://discourse.mc-stan.org/t/troubleshooting-ode-model/17186)

<div class="topic-metadata">

**Author:** [@eliaw](https://discourse.mc-stan.org/u/eliaw)\
**Replies:** 10\
**Last updated:** [August 21, 2020, 9:47pm UTC](https://discourse.mc-stan.org/t/troubleshooting-ode-model/17186 "2020-08-21T21:47:54Z")

</div>

I have an ODE model that runs without errors, recovers chosen parameters of synthetic data, and has a decent fit to real data. In this code, I solved and wrote out the solutions in closed form. But I now want to add mor…

---

## [External delay differential equation solver](https://discourse.mc-stan.org/t/external-delay-differential-equation-solver/17212)

<div class="topic-metadata">

**Author:** [@Ziaeemehr](https://discourse.mc-stan.org/u/Ziaeemehr)\
**Replies:** 1\
**Last updated:** [August 5, 2020, 10:56am UTC](https://discourse.mc-stan.org/t/external-delay-differential-equation-solver/17212 "2020-08-05T10:56:20Z")

</div>

Is it possible to use external DDE solver (user defined) function for fitting parameters to the model. As I know Stan doesn’t provide DDE solver. Do you have any idea?

---

## [Researcher Looking for an oportunity of secondment](https://discourse.mc-stan.org/t/researcher-looking-for-an-oportunity-of-secondment/16462)

<div class="topic-metadata">

**Author:** [@fvssilva](https://discourse.mc-stan.org/u/fvssilva)\
**Replies:** 0\
**Last updated:** [July 8, 2020, 6:57pm UTC](https://discourse.mc-stan.org/t/researcher-looking-for-an-oportunity-of-secondment/16462 "2020-07-08T18:57:01Z")

</div>

Hello everybody, I am new at Stan (and discourse for that matter) and I am at the moment preparing a grant proposal to create Stan models for biopharmaceutical production processes. I am a biochemical engineer and I don…

---

## [Forecast extension to Lotka Volterra Model](https://discourse.mc-stan.org/t/forecast-extension-to-lotka-volterra-model/15088)

<div class="topic-metadata">

**Author:** [@marcmenem](https://discourse.mc-stan.org/u/marcmenem)\
**Replies:** 7\
**Last updated:** [May 16, 2020, 10:05pm UTC](https://discourse.mc-stan.org/t/forecast-extension-to-lotka-volterra-model/15088 "2020-05-16T22:05:51Z")

</div>

I have spent some time looking at the Lotka-Volterra example, and I tried to build some of the Exercices and Extensions (btw it is a great example for beginners). It was straightforward to extend the predictions into th…

---

## [Installing Stiff ODE Solvers](https://discourse.mc-stan.org/t/installing-stiff-ode-solvers/15075)

<div class="topic-metadata">

**Author:** [@Maanit\_Mehra](https://discourse.mc-stan.org/u/Maanit_Mehra)\
**Replies:** 2\
**Last updated:** [May 13, 2020, 1:09pm UTC](https://discourse.mc-stan.org/t/installing-stiff-ode-solvers/15075 "2020-05-13T13:09:08Z")

</div>

Hi, I’m trying to install the Pystan versions supporting CVODES. I’m struggling with the same and would appreciate any help. git clone --recursive https://github.com/stan-dev/pystan cd pystan git checkout cvodes pip in…

---

## [Simultaneously estimating baseline and treatment parameters: hierarchical ODE modelling](https://discourse.mc-stan.org/t/simultaneously-estimating-baseline-and-treatment-parameters-hierarchical-ode-modelling/12118)

<div class="topic-metadata">

**Author:** [@philophthalmus](https://discourse.mc-stan.org/u/philophthalmus)\
**Replies:** 5\
**Last updated:** [April 15, 2020, 10:13am UTC](https://discourse.mc-stan.org/t/simultaneously-estimating-baseline-and-treatment-parameters-hierarchical-ode-modelling/12118 "2020-04-15T10:13:58Z")

</div>

I have a hierarchical modelling puzzle that I would like your collective wisdom on. For clarity, my model is an ODE model of PK/PD dynamics tracking the both the pathogen dynamics (both in the absence and presence of tr…

[Previous page](https://discourse.mc-stan.org/tag/ode/59.md?match_all_tags=true&tags%5B%5D=ode)

[Next page](https://discourse.mc-stan.org/tag/ode/59.md?match_all_tags=true&page=2&tags%5B%5D=ode)
