Changes between Initial Version and Version 1 of Ticket #5170, comment 17


Ignore:
Timestamp:
2019-07-12T15:13:23Z (5 years ago)
Author:
Lennart Ochel

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5170, comment 17

    initial v1  
    11After spending a lot of time on this issue, we came up with a minimal model showing the problem:
    22{{{
    3 function state1
    4  input Real u[2];
    5  input Real dummy;
    6  output Real s;
    7 algorithm
    8  s := u[1];
    9  annotation (derivative(noDerivative=u) = state1der1,
    10     InlineAfterIndexReduction=true);
    11 end state1;
     3model M
     4  function state1
     5    input Real u[2];
     6    input Real dummy;
     7    output Real s;
     8  algorithm
     9    s := u[1];
     10  annotation (derivative(noDerivative=u) = state1der1, InlineAfterIndexReduction=true);
     11  end state1;
    1212
    13 function state1der1
    14  input Real u[2];
    15  input Real dummy;
    16  input Real dummy_der;
    17  output Real sder1;
    18 algorithm
    19  sder1 := u[2];
    20  annotation (InlineAfterIndexReduction=true);
    21 end state1der1;
     13  function state1der1
     14    input Real u[2];
     15    input Real dummy;
     16    input Real dummy_der;
     17    output Real sder1;
     18  algorithm
     19    sder1 := u[2];
     20  annotation (InlineAfterIndexReduction=true);
     21  end state1der1;
    2222
    23 model M
    24  parameter Real C1 = 10;
    25  parameter Real C2 = 20;
    26  Real c1v, c1i, c2v, c2i, i;
     23  parameter Real C1 = 10;
     24  parameter Real C2 = 20;
     25  Real c1v, c1i, c2v, c2i, i;
    2726equation
    28  c2v = state1({c1v, der(c1v)},time);
    29  i = sin(time);
    30  i = c1i + c2i;
    31  der(c1v) = 1/C1 * c1i;
    32  der(c2v) = 1/C2 * c2i;
     27  c2v = state1({c1v, der(c1v)},time);
     28  i = sin(time);
     29  i = c1i + c2i;
     30  der(c1v) = 1/C1 * c1i;
     31  der(c2v) = 1/C2 * c2i;
    3332end M;
    3433}}}