This example solves the following integrands with function quadratureLobatto. The user can set the parameters, like "w" or "k", and can experiment with different integration intervals. The following integrals are computed:
function quadratureLobatto2 extends Modelica.Icons.Function; import Modelica.Utilities.Streams.print; input Real Tolerance = 1e-5 "Error tolerance of integral value" annotation( Dialog(group = "General")); input Real a1 = 0 "Lower limit" annotation( Dialog(group = "Sine")); input Real b1 = 1 "Upper limit" annotation( Dialog(group = "Sine")); input Real a2 = 0 "Lower limit" annotation( Dialog(group = "Sine w")); input Real b2 = 13 "Upper limit" annotation( Dialog(group = "Sine w")); input Real w = 5 "Angular velocity" annotation( Dialog(group = "Sine w")); input Real a3 = 0 "Lower limit" annotation( Dialog(group = "Elliptic integral")); input Real b3 = Modelica.Constants.pi/2 "Upper limit" annotation( Dialog(group = "Elliptic integral")); input Real k = 1/sqrt(2) "Modul" annotation( Dialog(group = "Elliptic integral")); end quadratureLobatto2;