Example Usage of DE Blocks
Example usage of DE blocks. Bessel functions (J0,
J1, Y1), spherical harmonics
(Y1,1), and Hermite functions appear here. In all these
examples, time is used essentially as a parametrization: the ramp
sources run from time=0 to 1, and it is their outputs (*.y) that
are used as the independent variable (x) for the DEs. Alteration of
the times and limits of these ramp sources will also require
adjustment of the 'dtdx' parameters of the DE blocks (Delta t /
Delta x).
For the Bessel functions, examples of generating solely the
functions J0(x) and J1(x) are shown. This is
achieved by choosing the order in the DE blocks and the appropriate
boundary conditions near the origin. The third Bessel example
generates a combination of J1(x) and Y1(x)
functions since the zeroed starting point of the integration is
away from the origin (x=1). Integrating this example back toward
the origin (next example to the right) reveals the divergence of
the Y1(x) function.
The lower-left example is for the first non-polynomial
spherical harmonic, Y1,1(x). Again, note the appropriate
boundary conditions at x~-1 to achieve this.
The last two examples involve the lowest solutions to the DE
for the quantum harmonic oscillator: psi0,1(x).
In all such examples, the resulting normalization will be
different from that provided by the corresponding GSL functions.
The overall normalizations here are controlled via initial values
for the functions and their derivatives. Care must also be taken
that enough steps are chosen to avoid discretization errors [e.g.,
slight deviations from expected behavior can be seen near the
boundaries for Y1,1(x) and psi0(x)].
Generated at 2026-04-14T18:18:34Z by OpenModelicaOpenModelica 1.26.3 using
GenerateDoc.mos