# source:trunk/Compiler/ModelicaMiddleEnd/test/modelica/EquationSolvingTests.mo@13720

Last change on this file since 13720 was 13720, checked in by Jonathan Kämpe, 2 months ago

#5844 Merging refactoring to trunk

File size: 1.6 KB
Line
1/*
2    Copyright (C) 2019 Modelon AB
3
4    This program is free software: you can redistribute it and/or modify
6    the Free Software Foundation, version 3 of the License.
7
8    This program is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11    GNU General Public License for more details.
12
13    You should have received a copy of the GNU General Public License
14    along with this program.  If not, see <http://www.gnu.org/licenses/>.
15*/
16
17within ;
18package EquationSolvingTests
19
20model ParametricNominal1
21        function f
22            output Real y = 1;
23        algorithm
24            assert(false, "");
25        end f;
26
27        parameter Real p = f();
28        Real x;
29        Real y(nominal=p);
30    equation
31        x*y=1;
32        x*2 + y*3 = 0;
33    annotation(__JModelica(UnitTesting(tests={
34        FClassMethodTestCase(
35            name="ParametricNominal1",
36            description="Test that parametric nominal that cannot be evaluated does not lead to exception during equation solving. Instead we handle it as if there was no nominal set.",
37            methodName="printDAEBLT",
38            methodResult="
39--- Torn system (Block 1) of 1 iteration variables and 1 solved variables ---
40Torn variables:
41  y
42
43Iteration variables:
44  x ()
45
46Torn equations:
47  y := (- x * 2) / 3
48
49Residual equations:
50  x * y = 1
51    Iteration variables: x
52-------------------------------
53")})));
54end ParametricNominal1;
55
56end EquationSolvingTests;
Note: See TracBrowser for help on using the repository browser.