Professional Documents
Culture Documents
Francesco Casella
(francesco.casella@polimi.it)
Politecnico di Milano
Introduction
Initialization is critical for models with dynamics
solution of ODE/D E depends on initial conditions if consistent initial conditions cannot !e found" the model is useless
#hermofluid models often stron$ly nonlinear %teady&state initialization in'ol'es sol'in$ lar$e" stron$ly nonlinear systems of e(uations
sensiti'ity to initial $uess 'alues sensiti'ity to selection of iteration 'aria!les tracin$ root of pro!lem difficult
$uess 'alues) errors in the model *e+$+ wron$ parameters,)
0y default" Modelica tools use start 'alues to assi$n initial 'alues to state 'aria!les It is possi!le to lo$ these additional initial e(uations *%imulation 1 %etup 1 #ranslation 1 2o$ selected default initial conditions,
model SimpleSystem2 parameter Time tau; parameter Real x_start = 2; Real x(start = x_start fixe! = true); Real y; Real u; equation u = if time < 1 then 1 else 2; tau * der(x) = - x^2 + u; y = "*x^2; end SimpleSystem2
model SimpleSystem parameter Time tau; parameter Real x_start = 2; Real x(start = x_start); Real y; Real u; equation u = if time < 1 then 1 else 2; tau * der(x) = - x^2 + u; y = "*x^2; initial equation x = x_start; end SimpleSystem
Initial e(uations are com!ined with dynamic e(uations 9onlinear sol'ers use start attri!ute for $uess 'alues
5
Fi3ed attri!utes can !e chan$ed at instantiation *%how Component feature in the Dymola ./I,
System S(u_start(start = 2 fixe! = false) y(start = " fixe! = true));
6
In other conte3ts" startin$ from an ;off&state< is pro!lematic/not re(uired E3ample7 power plant model for load chan$e or primary fre(uency studies
ran$e of 'alidity =6&466> pipin$ and instrumentation for startup not included in the model *tur!ine !ypass systems" steam 'ents" etc+,
In these cases" the typical transient is the response to a distur!ance startin$ from an e(uili!rium state *steady&state, Fi3in$ appro3imated initial states can lead to unphysical transients
out&of&ran$e mass ? heat flow 'alues flow re'ersal trip conditions +++
!uick re"iew of
#earin$ applied to implicit systems of e(uations to reduce the num!er of iteration 'aria!les
E(uations sol'ed as e3plicit assi$nments @ no pro!lem Implicit linear e(uations @ sol'ed without pro!lem if non&sin$ular Implicit nonlinear e(uations @ iterati'e methods @ reasona!le $uesses re(uired for the iteration 'aria!les .uess 'alues pro'ided in Modelica !y start attri!utes
defined !y types defined !y modifiers in li!rary models" possi!ly throu$h parameters defined !y direct modifiers on the simulation model
8
!uick re"iew of
11
ChecD dsmodel+mof/dslo$+t3t and impro'e start 'alues Fi3 initial states" run transient until e(uili!rium
re(uires asymptotically sta!le e(uili!rium *if not" use simple feed!acD controllers to sta!ilize, transient mi$ht $o wron$ !ecause of a!normal mass and ener$y flows due to unphisical 'alues of initial states e3ample7 e'aporator with hi$h heat transfer coefficient
small error in delta&# fluid&wall @ lar$e error in heat flow @ condensation/e'aporation @ !ad flow rates *possi!ly flow re'ersal,
Important remarD7 if the parametrization of the model is incorrect" a steady&state solution mi$ht not e3ist12
%team flow rate rou$hly proportional to steam 'al'e C' and drum pressure ssume now C' is :ust 46> smaller than the correct 'alue
in order to e'acuate H6 D$/s drum pressure should !e 4I6 !ar feedwater cannot flow from source at lower pressure-
13
Troubleshooting
%et initial 'alues of pressures and enthalpies close enou$h to nominal operatin$ point #he system has an asymptotically sta!le e(uili!rium thanDs to le'el controller %tart the simulation Drum pressure increases steadily %team flow JJ feedwater flow #oo small steam 'al'e Increase steam 'al'e C' #o find the correct C'7
set C'*fi3ed 8 false, set steamKflow*start 8 H6" fi3ed 8 true,
14
)omotopy-based initialization*
%ettin$ start 'alues
oti"ations
tedious selection of iteration 'aria!les can chan$e how to determine $ood enou$h 'alues) not o!:ect oriented not ro!ust re(uires hi$h&end sDills to trou!leshoot models
Lomotopy&!ased initialization
15
%ol'e con'e3 com!ination of simplified and actual pro!lem Ca'eat7 the pro!lem chan$es continuously" the solution mi$ht not
turnin$ points *can !e handled !y specialized sol'ers, asymptotes *failure, !ifurcations *re(uires interaction with e3pert user,
11 (ressure l/ss 0/mp/nent pin - p/ut = homotopy(sm//th(1 %f*s2uareRe3(4 4n/m*4nf))1rh/ !pn/m14n/m*4) 56l/4 0hara0teristi0s5; 11 7al8e f/r in0/mpressi+le flui! 4 = homotopy(6l/49har(theta)**8*s2rt(rh/)*s2rtR(!p) theta1thetan/m*4n/m1!pn/m*!p); 11 (ump function !f_!2 = der(fl/49hara0teristi0 2_fl/4); hea! = homotopy( (n1n#)^2*fl/49har(2*n#1(n+n_eps)) !f_!2(2#)*(2-2#) + (21n#*fl/49har(2#) - 2#1n#*!f_!2(2#))*(n-n#) + hea!#); 11 Tur+ine 4 = homotopy(%t*partial*r0*s2rt(p_in*rh/_in))*s2rtRe3(1-(11(R)^2) 4n/m1pn/m*p_in);
17
Control 'al'es
ssume flow is nominal flow M openin$ *re$ardless of density and pressure drop,
19
Ideally
no turnin$ points no other sin$ularities
20
Preliminary implementation in Dymola E+F *not $ood enou$h yet, Lopefully a'aila!le soon as standard feature in all Modelica tools
21
DI%C/%%IO9
22
,eferences
M+ %ielemann" F+ Casella" M+ Otter" C+ Clauss" Q+ E!orn" %+E+ Mattsson" L+ Olsson7 Ro!ust Initialization of Differential& l$e!raic E(uations /sin$ Lomotopy+ Proceedin$s of Hth International Modelica Conference" Dresden" .ermany" 56&55 March 5644+ F+ Casella" M+ %ielemann" 2+ %a'oldelli7 %teady&state Initialization of O!:ect&Oriented #hermo&Fluid Models !y Lomotopy Methods" Proceedin$s of Hth International Modelica Conference" Dresden" .ermany" 56&55 March 5644+
23