.Modelica.Math.Nonlinear.Examples.solveNonlinearEquations2

Information

This example solves the following nonlinear equations with function solveOneNonlinearEquation. The user can set the parameters, like "w" or "m", and can experiment with different start intervals. The following nonlinear equations are solved:

Interface

function solveNonlinearEquations2
  extends Modelica.Icons.Function;
  import Modelica.Utilities.Streams.print;
  input Real tolerance = 100*Modelica.Constants.eps "Relative tolerance of solution u" annotation(
    Dialog(group = "General"));
  input Real u_min1 = -0.5 "Lower limit" annotation(
    Dialog(group = "u^2-1"));
  input Real u_max1 = 10 "Upper limit" annotation(
    Dialog(group = "u^2-1"));
  input Real u_min2 = 0 "Lower limit" annotation(
    Dialog(group = "3*u - sin(w*u) - 1"));
  input Real u_max2 = 5 "Upper limit" annotation(
    Dialog(group = "3*u - sin(w*u) - 1"));
  input Real w = 3 "Angular velocity" annotation(
    Dialog(group = "3*u - sin(w*u) - 1"));
  input Real u_min3 = 1 "Lower limit" annotation(
    Dialog(group = "p[1] + log(p[2]*u) - m*u"));
  input Real u_max3 = 8 "Upper limit" annotation(
    Dialog(group = "p[1] + log(p[2]*u) - m*u"));
  input Real p[2] = {5, 1} "Parameter vector" annotation(
    Dialog(group = "p[1] + log(p[2]*u) - m*u"));
  input Real m = 1 "Parameter" annotation(
    Dialog(group = "p[1] + log(p[2]*u) - m*u"));
end solveNonlinearEquations2;

Generated at 2024-11-21T19:25:40Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos