OpenModelica: “Warning: maximal number of iteration reached but no root found” with conditional equation

前端 未结 2 1081
鱼传尺愫
鱼传尺愫 2021-01-25 19:53

I am an OpenModelica beginner trying to model a DC/DC converter with constant voltage and current limiting. Basically the output is supposed to give a constant voltage until the

2条回答
  •  梦毁少年i
    2021-01-25 20:38

    Unfortunately you have to learn about s-parametrization to solve this, as is found in e.g. Modelica.Electrical.Analog.Ideal.IdealDiode.

    Except for unit-checking you should do something like:

     Real s;
    equation 
    
      v = p.v - n.v;
    
      if s<0 then
        s=v-Vnom;
        n.i=Imax;
      else
        Vnom = v;
        s=Imax-n.i;
      end if;
      0 = p.i + n.i;
    

    I believe the original reference for this is https://ieeexplore.ieee.org/document/808640

    This model can also be rewritten sin this style by adding a new variable and rewriting the if-equations

      Boolean saturatedCurrent=s<0;
    equation
      v-vNom=if saturatedCurrent then s else 0;
      Imax-n.i=if saturatedCurrent then 0 else s; 
    

提交回复
热议问题