Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  Solving of linear system of equations generates incorrect results.
- the problem was the fact that continuous equations were classified
  as discrete and ended up in functionDAE_output2 which is never called
  during the continuous integration but only at events.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@3601 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed May 25, 2008
1 parent ea63061 commit 2fa0ca4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Compiler/DAELow.mo
Expand Up @@ -1397,9 +1397,10 @@ algorithm
case (Exp.CREF(componentRef = cr),vars,knvars)
equation
failure((_,_) = getVar(cr, vars));
(_,_) = getVar(cr,knvars);
((VAR(cr,kind,dir,vartype,bind,value,dims,ind,orig,clname,attr,comment,flow_) :: _),_) = getVar(cr, knvars);
res = isKindDiscrete(kind);
then
true;
res;
case (Exp.BINARY(exp1 = e1,operator = op,exp2 = e2),vars,knvars)
equation
b1 = isDiscreteExp(e1, vars,knvars);
Expand Down
8 changes: 4 additions & 4 deletions Compiler/SimCodegen.mo
Expand Up @@ -7371,12 +7371,12 @@ and after a discrete event."
algorithm
(contBlocks,discBlocks) := matchcontinue(dlow,ass1,ass2,m,mT,blocks)
local DAELow.Variables vars,vars2,knvars;
list<DAELow.Var> varLst;
list<DAELow.Var> varLst, varLstDiscrete;
DAELow.EquationArray eqns;
case (dlow as DAELow.DAELOW(orderedVars=vars,knownVars = knvars,orderedEqs=eqns),ass1,ass2,m,mT,blocks) equation
varLst = DAELow.varList(vars);
varLst = Util.listSelect(varLst,DAELow.isVarDiscrete);
vars2 = DAELow.listVar(varLst);
varLstDiscrete = Util.listSelect(varLst,DAELow.isVarDiscrete);
vars2 = DAELow.listVar(varLstDiscrete);
(contBlocks,discBlocks,_) = splitOutputBlocks2(vars2,vars,knvars,eqns,ass1,ass2,m,mT,blocks);
then (contBlocks,discBlocks);
end matchcontinue;
Expand Down Expand Up @@ -7436,7 +7436,7 @@ algorithm

/* Equation has variablity discrete time */
case(discVars,vars,knvars,eqns,blck,ass2,mT) equation
(eqn_lst,var_lst) = Util.listMap32(blck, getEquationAndSolvedVar, eqns, vars, ass2);
(eqn_lst,var_lst) = Util.listMap32(blck, getEquationAndSolvedVar, eqns, discVars, ass2);
var_lst = Util.listMap1(var_lst,DAELow.setVarKind,DAELow.DISCRETE());
discVars = DAELow.addVars(var_lst,discVars);
_::_ = Util.listSelect2(eqn_lst,discVars,knvars,DAELow.isDiscreteEquation);
Expand Down

0 comments on commit 2fa0ca4

Please sign in to comment.