Integral of some ModelingToolkitQuantity

I’m interested in computing the definite integral of some variable X, defined in ModelingToolkit. For sake of example, consider something like:

X ~ Y * Z
D(Y) ~ Y * 2
D(Z) ~ Z / t

(in particular, X is an “observed” in my case, AFAICT)

In the SciML world, these are the options?

  • I can introduce D(integral_of_X) ~ X and let MTK deal with it.
  • I can use Integral(x in DomainSets.ClosedInterval(...))
  • Integrals.jl

I’m guessing that since it’s an observed, the fastest / most accurate is to set up an IntegralProblem?

You can use

" * I can introduce D(integral_of_X) ~ X and let MTK deal with it.", that will work, but it will lost a bit of performance.

1 Like