Skip to content

Commit

Permalink
- moved calculation of jacobian matrix for non-linear strong components
Browse files Browse the repository at this point in the history
   from SimCodeUtil to module in BackendDAEOptimize.
 - moved functions (replaceDerOpInEquationList, replaceDerOpInExp, transformXToXd) 
   from SimCodeUtil  to BackendEquation, Expression, BackendVariable.
 - fixed bug with calculation of analytic jacobians in non-linear solver.
 - module is still deactived, since it needs more fixes to pass whole testsuite, 
   further it conflict still with removeUnsedFunctions.



git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19398 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Willi Braun committed Mar 3, 2014
1 parent 263c98e commit a3e30c7
Show file tree
Hide file tree
Showing 21 changed files with 670 additions and 444 deletions.
26 changes: 23 additions & 3 deletions Compiler/BackEnd/BackendDAE.mo
Expand Up @@ -345,7 +345,7 @@ uniontype StrongComponent
record EQUATIONSYSTEM
list<Integer> eqns;
list<Integer> vars "be carefule with states, this are solved for der(x)";
Option<list<tuple<Integer, Integer, Equation>>> jac;
Jacobian jac;
JacobianType jacType;
end EQUATIONSYSTEM;

Expand Down Expand Up @@ -385,6 +385,7 @@ uniontype StrongComponent
list<Integer> residualequations;
list<tuple<Integer,list<Integer>>> otherEqnVarTpl "list of tuples of indexes for Equation and Variable solved in the equation, in the order they have to be solved";
Boolean linear;
Jacobian jac;
end TORNSYSTEM;
end StrongComponent;

Expand Down Expand Up @@ -561,6 +562,7 @@ uniontype JacobianType
record JAC_NONLINEAR "If jacobian contains variables that are solved for,
means that a nonlinear system of equations needs to be
solved" end JAC_NONLINEAR;
record JAC_GENERIC "GENERIC_JACOBIAN jacobian available" end JAC_GENERIC;

record JAC_NO_ANALYTIC "No analytic jacobian available" end JAC_NO_ANALYTIC;
end JacobianType;
Expand All @@ -574,6 +576,24 @@ public constant Integer SymbolicJacobianGIndex = 5;
public constant String partialDerivativeNamePrefix = "$pDER";
public constant String functionDerivativeNamePrefix = "$funDER";


type FullJacobian = Option<list<tuple<Integer, Integer, Equation>>>;

public
uniontype Jacobian
record FULL_JACOBIAN
FullJacobian jacobian;
end FULL_JACOBIAN;

record GENERIC_JACOBIAN
SymbolicJacobian jacobian;
SparsePattern sparsePattern;
SparseColoring coloring;
end GENERIC_JACOBIAN;

record EMPTY_JACOBIAN end EMPTY_JACOBIAN;
end Jacobian;

public
type SymbolicJacobians = list<tuple<Option<SymbolicJacobian>, SparsePattern, SparseColoring>>;

Expand Down Expand Up @@ -624,8 +644,8 @@ uniontype DiffentiationType "Define the behavoir of differentation method for (e
by differentiate arguments."
end DIFFERENTAION_FUNCTION;

record FULL_JACOBIAN "Used to generate a full jacobian matrix"
end FULL_JACOBIAN;
record DIFF_FULL_JACOBIAN "Used to generate a full jacobian matrix"
end DIFF_FULL_JACOBIAN;

record GENERIC_GRADIENT "Used to generate a generic gradient for generation the jacobian matrix while the runtime."
end GENERIC_GRADIENT;
Expand Down

0 comments on commit a3e30c7

Please sign in to comment.