Opened 9 years ago
Last modified 9 years ago
#3511 assigned defect
BackendDAEUtil.tryToSolveOrDerive don't use functionTree
Reported by: | Vitalij Ruge | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | Backend | Version: | |
Keywords: | Cc: | Willi Braun, Patrick Täuber |
Description (last modified by )
Differentiate.differentiateExpSolve,ExpressionSolve.solve2
in tryToSolveOrDerive need for correct handling of functions the functionTree.
Example:
model testTearing function f input Real t; output Real y; algorithm y := 2 * t; end f; Real a annotation(tearingSelect = always); Real b; Real _a annotation(tearingSelect = always); Real _b; equation a = b + f(b); b = sin(a) + 3 * f(b); _a = _b + 2 * _b; _b = sin(_a) + 3 * 2 * _b; end testTearing;
It should be possible to find same tearing for a,b
loke for _a,_b
Change History (14)
comment:1 by , 9 years ago
Cc: | added |
---|
comment:2 by , 9 years ago
Cc: | added |
---|
comment:3 by , 9 years ago
Component: | Unknown → Backend |
---|
comment:4 by , 9 years ago
Description: | modified (diff) |
---|
comment:5 by , 9 years ago
Description: | modified (diff) |
---|
comment:7 by , 9 years ago
Status: | new → accepted |
---|
comment:8 by , 9 years ago
You are right, once the functionTree is passed through the call hierarchy, the example from the description works as expected. This are my changes: ec9085. Should I push the commit, or would you like to fix it differently?
comment:9 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | accepted → assigned |
comment:10 by , 9 years ago
Good!
The Output value for the functionTree is missing.
OM should remember function derivatives in functionTree.
comment:11 by , 9 years ago
proposal:
If possible extends you changes for output functionTree.
In the next step we should extend the outputs from Differentiate.differentiateExpSolve
and ExpressionSolve.solve2.
comment:12 by , 9 years ago
comment:13 by , 9 years ago
yes :).
It would nice to have getAdjacencyMatrixEnhancedScalar update shared with functionTree and return new shared e.g. for selectStatesWork1 and then selectStatesWork or for tearingSystemWork ....
Otherwise we losing the information in the functionTree?? (I don't know)
comment:14 by , 9 years ago
The changes causes problems for some models:
./simulation/libraries/3rdParty/ThermoPower/Bug2537.mos ./simulation/libraries/3rdParty/ThermoPower/ThermoPower.Examples.CISE.CISESim2States120501.mos ./simulation/modelica/initialization/OverdeterminedInitialization.Fluid.DynamicPipesSeriesLargeNSteadyStateInitial.mos
Can you provide a (small) test case?