SysPhS 1.2 RTF Avatar
  1. OMG Issue

SYSPHS12 — Modelica: Suggest need option to NOT always set a 'start' value also as 'fixed'

  • Key: SYSPHS12-29
  • Status: open  
  • Source: Webel IT Australia ( Dr. Darren Kelly)
  • Summary:

    See for example the Modelica University example:

    model QuiescentModelUsingStart "Find steady state solutions to LotkaVolterra equations"
      parameter Real alpha=0.1 "Reproduction rate of prey";
      parameter Real beta=0.02 "Mortality rate of predator per prey";
      parameter Real gamma=0.4 "Mortality rate of predator";
      parameter Real delta=0.02 "Reproduction rate of predator per prey";
      Real x(start=10) "Prey population";
      Real y(start=10) "Predator population";
    initial equation
      der(x) = 0;
      der(y) = 0;
    equation
      der(x) = x*(alpha-beta*y);
      der(y) = y*(delta*x-gamma);
    end QuiescentModelUsingStart;
    

    Even without explicit support for 'initial equation' this can be reformulated for SysPhS with additional variables and equations. Export from MagicDraw gives:

    model QuiescentModelUsingStart
      parameter Real alpha(start=0.1,fixed=true);
      parameter Real beta(start=0.02,fixed=true);
      parameter Real gamma(start=0.4,fixed=true);
      parameter Real delta(start=0.02,fixed=true);
      Real x(start=10.0,fixed=true);
      Real y(start=10.0,fixed=true);
      Real dx(start=0.0,fixed=true);
      Real dy(start=0.0,fixed=true);
    equation
      der(x)=x*(alpha-beta*y);
      der(y)=y*(delta*x-gamma);
      dx=der(x);
      dy=der(y);
    end QuiescentModelUsingStart;
    

    The Wolfram SystemModeler tool declares that invalid because of these (which contradict the other initial conditions):

      Real x(start=10.0,fixed=true);
      Real y(start=10.0,fixed=true);
    

    If you change the code (by hand) to the following it runs:

      Real x(start=10.0);
      Real y(start=10.0);
    

    But SysPhS-1.1 seems to assume these should always be generated with fixed=true. The only way to get the example to work from SysPhS is to hack the start values (know the steady state value solutions in advance) thus:

      Real x(start=20.0,fixed=true);
      Real y(start=5.0,fixed=true);
    

    Then it validates and runs.

  • Reported: SysPhS 1.1 — Wed, 17 Mar 2021 03:23 GMT
  • Updated: Wed, 17 Mar 2021 13:48 GMT