| 1 | package TestJacobian
|
|---|
| 2 | model Test1
|
|---|
| 3 | Real x1,x2;
|
|---|
| 4 | Real y1,y2;
|
|---|
| 5 | equation
|
|---|
| 6 | x1 + sin(x1) + x2 + sin(x2) = 1;
|
|---|
| 7 | x1 + sin(x1) - x2 + sin(x2) = 0;
|
|---|
| 8 | y1 + homotopy(sin(y1),y1) + y2 + homotopy(sin(y2),y2) = 1;
|
|---|
| 9 | y1 + homotopy(sin(y1),y1) - y2 + homotopy(sin(y2),y2) = 0;
|
|---|
| 10 | annotation(__OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 11 | experiment(StopTime = 15, Tolerance = 1e-4));
|
|---|
| 12 | end Test1;
|
|---|
| 13 |
|
|---|
| 14 | model Test2
|
|---|
| 15 | extends Test1;
|
|---|
| 16 | annotation(__OpenModelica_commandLineOptions = "--replaceHomotopy=actual --tearingMethod=minimalTearing",
|
|---|
| 17 | experiment(StopTime = 15, Tolerance = 1e-4));
|
|---|
| 18 | end Test2;
|
|---|
| 19 |
|
|---|
| 20 | model Test3
|
|---|
| 21 | extends Test1;
|
|---|
| 22 | annotation(__OpenModelica_commandLineOptions = "-d=forceNLSanalyticJacobian --tearingMethod=minimalTearing",
|
|---|
| 23 | experiment(StopTime = 15, Tolerance = 1e-4));
|
|---|
| 24 | end Test3;
|
|---|
| 25 |
|
|---|
| 26 | model Test4
|
|---|
| 27 | Real x1,x2;
|
|---|
| 28 | Real y1,y2;
|
|---|
| 29 | equation
|
|---|
| 30 | x1 + sin(x1) + x2 + sin(x2) = 1;
|
|---|
| 31 | x1 + sin(x1) - x2 + sin(x2) = 0;
|
|---|
| 32 | y1 + smooth(2,if y1 > 0 then sin(y1) else -sin(-y1)) + y2 + sin(y2) = 1;
|
|---|
| 33 | y1 + sin(y1) - y2 + sin(y2) = 0;
|
|---|
| 34 | annotation(__OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 35 | experiment(StopTime = 15, Tolerance = 1e-4));
|
|---|
| 36 | end Test4;
|
|---|
| 37 |
|
|---|
| 38 | model Test5
|
|---|
| 39 | extends Test1;
|
|---|
| 40 | annotation(__OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 41 | __OpenModelica_simulationFlags(nlssMinSize = "1", nlssMaxDensity = "1.1", lv = "LOG_NLS_V"),
|
|---|
| 42 | experiment(StopTime = 15, Tolerance = 1e-4));
|
|---|
| 43 |
|
|---|
| 44 | end Test5;
|
|---|
| 45 |
|
|---|
| 46 | model Test6
|
|---|
| 47 | extends Test1;
|
|---|
| 48 | annotation(__OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 49 | __OpenModelica_simulationFlags(nls="kinsol", nlsLS="klu", lv = "LOG_NLS_V"),
|
|---|
| 50 | experiment(StopTime = 15, Tolerance = 1e-4));
|
|---|
| 51 | end Test6;
|
|---|
| 52 | end TestJacobian;
|
|---|