$(instance)DerivativeIntegratorTerminatorTest Icon

DerivativeIntegratorTerminatorTest

Usage

DerivativeIntegratorTerminatorTest()

Behavior

\[ \begin{align} \mathtt{source.y}\left( t \right) &= \mathtt{derivative.u}\left( t \right) \\ \mathtt{derivative.y}\left( t \right) &= \mathtt{integrator.u}\left( t \right) \\ \mathtt{integrator.y}\left( t \right) &= \mathtt{terminator.u}\left( t \right) \\ \frac{\mathrm{d} \mathtt{derivative.x}\left( t \right)}{\mathrm{d}t} &= \frac{\mathtt{derivative.u}\left( t \right) - \mathtt{derivative.x}\left( t \right)}{\mathtt{derivative.T}} \\ \mathtt{derivative.y}\left( t \right) &= \frac{\mathtt{derivative.k} \left( \mathtt{derivative.u}\left( t \right) - \mathtt{derivative.x}\left( t \right) \right)}{\mathtt{derivative.T}} \\ \frac{\mathrm{d} \mathtt{integrator.x}\left( t \right)}{\mathrm{d}t} &= \mathtt{integrator.k} \mathtt{integrator.u}\left( t \right) \\ \mathtt{integrator.y}\left( t \right) &= \mathtt{integrator.x}\left( t \right) \\ \mathtt{source.y}\left( t \right) &= ifelse\left( \mathtt{source.start\_time} < t, \mathtt{source.offset} + \mathtt{source.amplitude} \sin\left( \mathtt{source.phase} + 6.2832 \mathtt{source.frequency} \left( - \mathtt{source.start\_time} + t \right) \right), \mathtt{source.offset} \right) \end{align} \]

Source

component DerivativeIntegratorTerminatorTest
  derivative = Derivative(k=1, T=0.001)
  integrator = Integrator(k=1)
  terminator = Terminator()
  source = Sine(amplitude=1, frequency=1)
relations
  connect(source.y, derivative.u)
  connect(derivative.y, integrator.u)
  connect(integrator.y, terminator.u)
metadata {
  "JuliaSim": {
    "experiments": {},
    "tests": {
      "case1": {
        "stop": 10,
        "atol": {"integrator.y": 0.01, "terminator.u": 0.01},
        "expect": {
          "final": {"integrator.y": 0, "terminator.u": 0},
          "signals": ["integrator.y", "terminator.u"]
        }
      }
    }
  }
}
end
Flattened Source
component DerivativeIntegratorTerminatorTest
  derivative = Derivative(k=1, T=0.001)
  integrator = Integrator(k=1)
  terminator = Terminator()
  source = Sine(amplitude=1, frequency=1)
relations
  connect(source.y, derivative.u)
  connect(derivative.y, integrator.u)
  connect(integrator.y, terminator.u)
metadata {
  "JuliaSim": {
    "experiments": {},
    "tests": {
      "case1": {
        "stop": 10,
        "atol": {"integrator.y": 0.01, "terminator.u": 0.01},
        "expect": {
          "final": {"integrator.y": 0, "terminator.u": 0},
          "signals": ["integrator.y", "terminator.u"]
        }
      }
    }
  }
}
end

Test Cases

Test Case case1

Signal `integrator.y` for test `case1` of `DerivativeIntegratorTerminatorTest`

Signal `terminator.u` for test `case1` of `DerivativeIntegratorTerminatorTest`

  • Examples
  • Experiments
  • Analyses