ebook img

Derivative-free Parameter Optimization of Functional Mock-up Units Andersson, Christian PDF

12 Pages·2017·2.23 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Derivative-free Parameter Optimization of Functional Mock-up Units Andersson, Christian

Derivative-free Parameter Optimization of Functional Mock-up Units Andersson, Christian; Gedda, Sofia; Åkesson, Johan; Diehl, Stefan Published in: [Host publication title missing] 2012 Link to publication Citation for published version (APA): Andersson, C., Gedda, S., Åkesson, J., & Diehl, S. (2012). Derivative-free Parameter Optimization of Functional Mock-up Units. In [Host publication title missing] Modelica Association. Total number of authors: 4 General rights Unless other specific re-use rights are stated the following general rights apply: Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain • You may freely distribute the URL identifying the publication in the public portal Read more about Creative commons licenses: https://creativecommons.org/licenses/ Take down policy If you believe that this document breaches copyright please contact us providing details, and we will remove access to the work immediately and investigate your claim. LUND UNIVERSITY PO Box 117 221 00 Lund +46 46-222 00 00 Derivative-free Parameter Optimization of Functional Mock-up Units SofiaGeddaa,c ChristianAnderssona,c JohanÅkessonb,c StefanDiehla aCentreforMathematicalSciences,LundUniversity,Sweden bDepartmentofAutomaticControl,LundUniversity,Sweden cModelonAB,Sweden Abstract needforestimatingparameterswhichareunknownor uncertain is put into focus. Estimating unknown pa- Representing a physical system with a mathematical rameters in the mathematical model using optimiza- modelrequiresknowledgenotonlyaboutthephysical tion algorithms is a commonly used approach to in- lawsgoverningthedynamicsbutalsoabouttheparam- creasetheaccuracyofmodels. Inthispaper,wefocus eter values of the system. The parameters can some- onparameterestimationproblemswheretheobjective timesbemeasuredorcalculated,butsomeofthemare istominimizetheerrorbetweenthesimulatedprofiles often difficult or impossible to obtain directly. Never ofthemathematicalmodelandmeasurementsfromthe the less, finding accurate parameter values is crucial corresponding physical system. The objective func- fortheaccuracyofthemathematicalmodel. tionconsidered Estimating the parameters using optimization algo- M rithms which attempt to minimize the error between f(x)= ∑(ysim(t,x)−ymeas(t))2 (1) i i theresponsefromthemathematicalmodelandthereal i=0 physical system is a common approach for improving theaccuracyofthemodel. whereysim isthemodeloutputtrajectoryandymeas are Optimization algorithms usually require informa- themeasurements. Theparameterstobeestimatedare tion about the derivatives which may not always be x ∈ Rn, where n is the number of parameters. M is easily available or which may be difficult to com- thenumberofmeasurementsatthetimepointsti. The pute due to, e.g., hybrid dynamics. In such cases, optimizationproblemisthenformulatedas derivative-free optimization algorithms offer an alter- min f(x). (2) nativefordesignandparameteroptimization. x∈Rn In this paper, we present an implementation of subjecttothesystemdynamics,intheFMIcasegiven derivative-free optimization algorithms for parameter by a hybrid Ordinary Differential Equation (ODE). estimation in the JModelica.org platform. The imple- Additionally,theparametersmaybesubjecttobounds, mentation allows the underlying dynamic system to l≤x≤u. be represented as a Functional Mock-up Unit (FMU), This optimization problem may be solved by tran- andthusenablesparameteroptimizationofmodelsex- scribing the problem into a non-linear programming ported from modeling tools compliant with the Func- problem using either shooting methods [6] or collo- tionalMock-upInterface(FMI). cation methods [6]. These methods, however, both Keywords: Derivative-freeoptimization;Parameter use derivative information, which may be difficult or Estimation;JModelica.org;FMI;Assimulo expensive to compute, e.g., in the case of hybrid sys- tems. Theideaisthentousealgorithmswhichdonot 1 Introduction depend on derivative information, such as the Nelder- Meadsimplexmethod[7]. Inaderivative-freemethod, Increasingly, industry rely on mathematical modeling instead of using information from the derivatives to for evaluating and designing new machines and de- improve the solution, the objective is evaluated at a vices. As the models grow increasingly complex, the chosen set of points which are then used to improve the solution. How the points are chosen and which mentation is applied to two different problems where strategyisusedtoimprovethesolutiondependsonthe thesecondisalargeindustrialexamplewhereamodel method. Typically, computation times are longer than ofanengineiscalibrated. Finally,Section7concludes for derivative-based methods, but on the other hand, thepaperwithasummaryandconclusions. derivative-freemethodsofferafeasibleandrobustop- tionwhenotheralgorithmsfail. 2 Background In this paper, we evaluate three derivative-free op- timization algorithms for parameter estimation avail- 2.1 TheFunctionalMock-upInterface able in the JModelica.org platform: the Nelder-Mead simplexmethod,thedifferentialevolutionmethodand TheFunctionalMock-upInterface[1]definesanopen a genetic algorithm. Based on this evaluation, the standardformodelexchange. Theintentionistoallow Nelder-Mead algorithm seems most appropriate to exchange of models between different modeling and solve the class of parameter optimization problems simulationtools. Thestandarddescribesmodelsashy- considered. brid ODEs with state, step and time events. A model Themaincontributionofthepaperisanimplemen- that implements the FMI standard is called a Func- tation of the Nelder-Mead simplex algorithm. The al- tionalMock-upUnitandisdistributedasacompressed gorithm supports parameter bounds and parallel eval- directorycontainingasharedobjectfileorsourcecode uationoffunctionevaluationswhereFMUmodelsare containingthemodelequations,andasetoffunctions loadedandsimulated. fordataaccess, andanXMLfile, whichdescribesthe We also briefly present the underlying packages model parameters and variables. The standard has re- FMI Library (FMIL), PyFMI1 and ASSIMULO2. ceived a significant amount of attention among ven- These packages are part of JModelica.org, but also dors since the release in 2010 and currently there are available stand-alone, and are used for simulating the 34 environments that support or plan to support the model response. In Figure 1, an overview of the standard. interaction between the packages in JModelica.org when solving a derivative-free optimization problem 2.2 Optimizationtools isshown. There exist many tools for optimization of complex Functional Mock-up Unit systems, both in the public domain and commercially JModelica.org available. Broadly, therearethreedifferentcategories ofoptimizationtools,althoughthescopeissometimes Model response overlapping. In Model integration tools the problem DFO PyFMI ASSIMULO ofinterfacingseveraldesigntoolsintoaasinglecom- putation environment, where analysis, simulation and Parameter guess optimizationcanbeperformedisaddressed. Examples FMIL include ModelCenter [23], OptiY [22], modeFRON- TIER [12], and iSIGHT [10]. Such environments are Figure 1: Overview of the interaction between the capable of integrating several simulation and design packages in JModelica.org when solving a derivative- tools into one computational chain, where the results freeoptimizationproblem. are optimized. The integrated tools may be hetero- geneous in the sense that they model different phys- The paper is outlined as follows. In Section 2, the ical domains by means of different algorithms. Due Functional Mock-up Interface is presented together to this heterogeneity amongst supported tools, opti- with an overview of optimization tools. In Section 3, mization algorithm that does not exploit derivatives anintroductiontotheJModelica.orgplatformisgiven or model structure such as sparsity is commonly em- together with the simulation package ASSIMULO as ployed. Model integration tools typically also have wellasthePythonpackagePyFMIforinteractionwith strongsupportformodelapproximationandvisualiza- FMUs. Next, derivative-free optimization algorithms tion. areintroduced,followedbyadescriptionoftheimple- Many modeling and simulation tools has optimiza- mentation in JModelica.org. In Section 6, the imple- tion add-ons, e.g., Dymola [9], gPROMS [24], Jaco- 1http://www.pyfmi.org bian [19], and OMOptim [18]. The level of support 2http://www.assimulo.org for optimization in this category differs between the tools. Dymola,forexample,offersadd-onsforparam- tion oriented Modelica environment for op- eter identification and design optimization [11, 20]. timization and simulation of complex dy- gPROMS on the other hand, offers support for so- namic systems, built on well-recognized lution of optimal control problems and has the ad- technology and supporting major plat- ditional benefit in comparison with Modelica tools forms.” to provide support for partial differential equations JModelica.orgprovidescompilersfortheModelica (PDEs). Toolsinthiscategoryusuallysupportasetof language and the extension Optimica [25]. For sim- derivative-basedandderivative-freeoptimizationalgo- rithms. Optimization problems are typically formu- ulations, the Python package ASSIMULO is used for bothsimulatingODEsandDAEs. Dynamicoptimiza- latedbymeansofgraphicaluserinterfaces. tion is available using direct local collocation algo- In the third category there are numerical packages rithms based on the DAE formulation of the model. for dynamic optimization, often developed as part of The user interaction with JModelica.org is based on researchprograms. ExamplesareACADO[21],Mus- theprogramminglanguagePython. codII[28],andDynoPC[17]. Suchpackagesaretyp- Included in JModelica.org are packages that can ically focused on efficient implementation of an op- alsobeusedstand-alone. Inthefollowingsubsections, timization algorithm for a particular class of dynamic systems. Also,detailedinformationaboutthemodelto thepackagesFMILibrary,PyFMIandASSIMULOare presented. optimize is generally required in order for such algo- rithms to work, including accurate derivatives and in some cases also sparsity patterns. While these pack- 3.1 FMILibrary ages offer state of the art algorithms, they typically FMI Library (FMIL) is a C package designed for come with simple or no user interface. Their usage working with FMUs and serving as support for ap- is therefore limited due to the effort required to code plications interfacing the FMI. The package con- the model and optimization descriptions. A notable tainsconvenientmethodsfordecompressingofFMUs, example is CasADi [4], which provides an efficient parsingXMLinformationandconnectingthebinary5. AD kernel, interfaces to numerical optimization algo- ThelibrarysupportsFMI1.0formodelexchangeand rithmsandacomprehensiblePythoninterfaceforcus- forco-simulationsandisintendedforcustomintegra- tomdevelopmentofdynamicoptimizationalgorithms. tion of FMI technology in applications. FMIL is also CasADi also support import of Modelica models in usedasabasisofthePythonpackagePyFMI. XMLformat,see[5]. The approach presented in this paper falls into 3.2 PyFMI the category of additions to modeling and simulation tools. Specifically,modelsexportedfromFMIcompli- PyFMI[2]isapackageforinteractingwithFMUsus- ant tools can be optimized. The presented algorithm ing Python, based on the FMI Library. It provides uses Python scripting as a means to formulate opti- convenienthigh-levelfunctionsforinteractingwithan mization problems, and in this respect it differs from, FMU, retrieving values and accessing variable infor- e.g.,theapproachtakeninDymola. mation from the XML information. Additionally, a low-levelmappingofthefunctionsspecifiedinthein- terface can also be accessed. A model can be loaded 3 JModelica.org and made available from Python using the following JModelica.org3 [26] is a platform for modeling, sim- Pythoncode: ulation and optimization of complex physical sys- #Import the model class tems primarily based on the Modelica4 modeling lan- from pyfmi import FMUModel guage. JModelica.org is a community-based open- #Load the model into Python sourceprojectstartedatLundUniversitywiththefol- model = FMUModel("bouncingBall.fmu") lowingaim: PyFMIalsoprovidesaconnectiontothesimulation “To offer a community-based, free, package ASSIMULO and thus enables access to state- open-source, accessible, user and applica- of-the-art solvers such as CVode and IDA from the Sundials suite, capable of simulating hybrid systems. 3http://www.jmodelica.org 4http://www.modelica.org 5http://www.jmodelica.org/FMILibrary A simulation is performed by using the simulate δ Operationtype method. −1 insidecontraction 2 #Simulate the model using Assimulo 1 outsidecontraction 2 res = model.simulate(final_time=10) 1 reflection 2 expansion 3.3 ASSIMULO Table1: Differentδ-valueswithcorrespondingopera- tiontypes. ASSIMULO [3] is a Python package for solving first or second order explicit ordinary differential equa- tions (ODEs) or implicit ordinary differential equa- We shall now introduce three different derivative- tions(DAEs). free optimization algorithms which have been imple- ASSIMULO combines a variety of different solvers mented or interfaced in the JModelica.org platform written in FORTRAN, C and Python via a com- [13]: the Nelder-Mead simplex method, the differen- mon high-level interface. The state-of-the-art solvers tialevolutionmethodandageneticalgorithm. CVode and IDA from the SUNDIALS suite [15] as well as RADAU5 [14] are amongst the available 4.1 TheNelder-Meadsimplexmethod solvers. ASSIMULO is divided into two parts, namely prob- The Nelder-Mead simplex method has obtained its lemdefinitionsandsolvers. Aproblemdefinitionmay name from the fact that each iteration is based on in addition to the right-hand side of the differential a simplex. A simplex in Rn is a set of n+1 ver- equationalsocontainforinstancetheJacobianaswell ticesx ,...,x ∈Rnsuchthatthevectorsx −x ,i= 1 n+1 i 1 as event functions in order to support simulation of 2,...,n+1arelinearlyindependent, i.e. itisagener- hybridsystems. Theideaistoseparateinformationre- alizationofatriangletoarbitrarydimension. latedtoaproblemfromthesolver. Forinstance,which IneachiterationoftheNelder-Meadalgorithm, the statesarealgebraicisinformationthatisrelatedtothe objective is to replace the vertex with the highest cost problem and not the solver. In Figure 2, an overview in the n-dimensional simplex with a better point. The isgivenshowingtheavailableproblemdefinitionsand verticesareorderedbyincreasingvalueof f suchthat solvers in ASSIMULO. Also shown is the connection f(x )≤...≤ f(x ). The new point is searched for 1 n+1 betweenthedifferentproblemformulations. alongthelinethroughthevertexwiththehighestcost, x ,andthecentroid, n+1 Implicit ODE Explicit Overdetermined ODE 1 n Problems Implicit Explicit ODE xc= ∑xi, (3) O ODE (2nd order) n L i=1 U M SI of the remaining vertices x ,...,x . This line has the S 1 n A Solvers ODASSL IDA CVODE HHT-alpha equation methods RADAU5 GLIMDA RODAS LSODAR Newmark RADAU5 DOPRI5 x=x +δ(x −x ), δ ∈R. (4) c c n+1 Figure 2: Connection between the different problem The parameter δ defines the type of the operation formulationsandthedifferentsolversavailableinAS- performedonthesimplex. Therearefourdifferentop- SIMULO. eration types that are performed by the algorithm: re- flection, expansion, inside contraction or outside con- traction,resultinginthereflectionpoint,x ,theexpan- r 4 Derivative-free Optimization sion point, x , the inside contraction point, x , or the e ic outside contraction point, x respectively. Table 4.1 oc In applications where derivatives are difficult or com- displays the δ-values corresponding to these four op- putationally expensive to obtain, there is a need for erations. Ifnoneoftheseoperationsresultsinabetter derivative-free optimization methods. Examples in- point than x , the simplex is shrunk toward the ver- n+1 clude very large models which also contains hybrid tex with the lowest cost, x . That is, the n points with 1 elements. the highest costs are replaced by new points obtained from within which the individuals live. The value f(x¯) de- termines how fit the individual x¯ is to survive in the 1 x=x + (x −x ), i=2,...,n+1. (5) environment;alowervaluemeansabetterfit. Ateach 1 i 1 2 iteration, or generation, a new population of possi- Thisprocedureisrepeateduntilsometerminationcri- ble solutions is produced through mutation, crossover terionisfulfilled. Thereareusuallythreedifferentter- and selection. Mutation is a mechanism for maintain- mination criteria, one of which has to be fulfilled in inggeneticdiversitybymodifyinganexistingsolution orderforthealgorithmtoterminate: while crossover means combining two existing solu- tionsintoanewone. • Convergence criterion for x – the simplex is suf- ficientlysmallaccordingtoauser-providedtoler- 4.2.1 Thedifferentialevolutionmethod ance. The differential evolution method [27] works accord- • Convergencecriterionfor f –thefunctionvalues ingtothefollowingsteps. at the simplex vertices are sufficiently close ac- Initialization: An initial population of N individu- cordingtoauser-providedtolerance. als,orvectors,isgeneratedrandomlyinsidethefeasi- bleregion. • Termination criterion without convergence – the Mutation: At each iteration, the population con- maximum number of iterations or function eval- sistsofN vectors, x ∈Rn,i=1,...,N. Foreachvec- uationshasbeenreached. i tor x, the target vector, a mutant vector, v ∈ Rn, is i i In Figure 3, two iterations of the algorithm are produced by adding the weighted difference between shown,illustratinghowthesimplexchangesformand twovectorsinthecurrentpopulationtoathirdoneac- position. cordingtothefollowingformula: v =x +F(x −x ), i r r r 1 2 3 Simplex search 6 wherer ,r ,r ∈{1,2,...,N}arerandomindices,dis- 1 2 3 4 tinct from each other and from i, and F ∈ [0,2] is a constant. 2 Crossover: The mutant vector, v, is then recom- i bined with its corresponding target vector, x, through 0 i a mixing of their elements, generating a trial vector, 2 ui ∈Rn. Thetrialvectorreceiveselementsofthemu- tant vector with probability P∈[0,1] and elements of 4 thetargetvectorwithprobability1−P. Selection: Thetrialvector,u,iscomparedwiththe 6 i 6 4 2 0 2 4 6 targetvector,x,andtheonegivingthelowestvalueof i thefitnessfunction, f, isselectedforthenextgenera- Figure 3: Two simplex iterations where the solid tri- tion. angle is the initial simplex which transforms into the The phases mutation, crossover and selection con- dashedtriangle(δ =2)andthenthedash-dottriangle tinueuntilaterminationcriterionisfulfilled. (δ =−1). 2 4.2.2 Geneticalgorithms Ingeneticalgorithms[16]theindividualsareencoded 4.2 Evolutionaryalgorithms as bit strings. There are various genetic algorithms The differential evolution method and genetic algo- which differ from one another but the following is a rithms belong to the class of evolutionary algorithms, generaldescription. which consists of stochastic optimization algorithms Initialization: An initial population of size N is inspired by the principles of biological evolution the- generatedrandomlyinsidethefeasibleregion. ory. In such algorithms, each candidate solution, x¯∈ Selection: Ineachgeneration,aselectionprobabil- Rn,representsanindividualandtheobjectivefunction, ity, p(x), is definedfor each individual, x ∈Rn. The i i f(x), or fitness function, represents the environment selection probability depends on the fitness function value for the individual, f(x), a smaller value gives basedbasedonexecutiontimeandconvergencetothe i alargerprobability. Twoindividualsarethenselected optimalsolution. randomlyaccordingtotheirselectionprobabilities. Crossover: Crossover is performed on the two 6.1 Furutapendulum selected individuals with a certain probability, the TheFurutapendulumisasystemconsistingofahori- crossover rate. A common choice for this probability zontal arm driven by a motor which is connected to a isaround0.7. Therearedifferentcrossovertechniques vertical pendulum, see Figure 4. The system has two butacommonapproachistorandomlychooseaposi- degrees of freedom, namely the angle of the arm, φ, tioninthebitstringsandswapallbitsbetweenthetwo and the angle of the pendulum, θ. Additionally, there stringsafterthatposition. isfrictioninboththearmjointandthependulumjoint. Mutation: Mutation is performed by flipping bits Due to the discontinuities introduced by the friction, (from 0 to 1 or vice versa) at random positions in the thesystemisnotwellsuitedforderivative-basedopti- bit strings. The probability of flipping a bit, the mu- mizationalgorithms. tation rate, should be much lower than the crossover rate. Selection, crossover and mutation is repeated until aterminationcriterionisreached. 5 Implementation ThealgorithmsevaluatedinSection4,havebeenmade availableinJModelica.org. TheNelder-Meadsimplex algorithm has been implemented and is now provided as part of JModelica.org, while the differential evolu- tion algorithm and a genetic algorithm has been in- terfaced through the OpenOpt package 6. The algo- rithmsareavailablethroughthePythonfunctionfmin inJModelica.org. The method fmin requires as input the objective function together with the initial conditions as well Figure4: TheFurutapendulum. asoptionsforspecifyingtheintendedoptimizational- The Furuta pendulum is modeled by a Modelica gorithm and tolerances. In Section 6.1, it is shown model, see Figure 5. The problem at hand is to cal- how the objective function can be defined when the ibratetheunknownfrictioncoefficientsofthearmand dynamicmodeliscontainedinanFMU. pendulum, respectively, against the given measure- In the Nelder-Mead algorithm, support for parallel mentsusingtheNelder-Meadsimplexalgorithm. The evaluation of the objective function, f(x), has been objectiveisthus implemented. In each iteration of the algorithm, the evaluations of the n+1 vertices are distributed over a user-supplied number of processes, as well as the M f(x)= ∑(φsim(t,x)−φmeas(t))2+ evaluations of the reflection, expansion and contrac- i i i=1 tionpoints. (6) M Forfurtherimplementationdetails,see[13]. ∑(θsim(t,x)−θmeas(t))2 i i i=1 wherexisavectorcontainingthefrictioncoefficients 6 Examples forthearmandthependulumrespectively. The measurements were generated by simulation In [13], the different derivative-free algorithms was of the Modelica model for the Furuta pendulum and tested and the result indicated that the Nelder-Mead white measurement noise was added to the outputs. algorithm is the preferred algorithm for the tested pa- The measurements were given for a period of 40 sec- rameterestimationproblems. Theevaluationwasdone onds and were contained in a data file. The data was 6http://openopt.org/ loadedintoPythonbythefollowingcode: theta_sim = res[’pendulumJoint.phi’] t_sim = res[’time’] # Evaluate the objective function y_sim = N.vstack((phi_sim,theta_sim)) obj = dfo.quad_err(t_meas,y_meas, t_sim,y_sim) return obj Finally, the objective is provided to the optimization function fmin together with the initial guess and the parameter bounds. The initial guess, i.e., the nomi- nalvalues,wereobtainedthroughmanualtesting. The objectreturnedbyfmincontainstheoptimizedparam- eterstogetherwithstatistics,suchasthenumberofit- erationsperformed: Figure5: AModelicamodelfortheFurutapendulum. # Specify initial conditions (scaled) x0 = N.array([0.012,0.002])*1e3 from scipy.io import loadmat # Lower and Upper bounds import numpy as N lb = N.zeros(2) ub = x0 + 10 # Load measurement data from file data = loadmat(’FurutaData’) # Solve using the Nelder-Mead algorithm res = dfo.fmin(furuta_dfo_cost, # Extract data series xstart=x0,lb=lb,ub=ub, t_meas = data[’time’][:,0] x_tol=1e-3,f_tol=1e-2) phi_meas = data[’phi’][:,0] theta_meas = data[’theta’][:,0] # Optimal point rescaled [armFriction_opt,pendFriction_opt] = y_meas = N.vstack((phi_meas,theta_meas)) res[0]/1e3 TheobjectivefunctionisdefinedasaPythonfunction The optimized parameter values were found to be wheretheFMU,generatedbyDymola, fortheFuruta 0.010 for the arm friction coefficient and 0.0010 for pendulumisloadedandsimulatedforgivenparameter thependulumfrictioncoefficient. Theresultisvisual- values. ized in Figure 6, where it can be seen that the model responseissignificantlymoreaccurateusingtheopti- from pyfmi import FMUModel from pyjmi.optimization import dfo mized parameters as compared to the response given from the nominal parameters. In Figure 7, the error # Define the objective function isshownbetweenthemeasurementsandthesimulated def furuta_dfo_cost(x): response using both the nominal parameters and the #Scale down optimizedparameters. armFriction = x[0]/1e3 pendFriction = x[1]/1e3 6.2 DieselEngine # Load the FMU Model model = FMUModel(’Furuta.fmu’) In this example, parameters in a model of an exhaust # Set new parameter values gas pipe in a diesel engine is calibrated against mea- model.set(’armFriction’, surements. ThemodelwasdevelopedinDymolausing armFriction) the Engine Dynamics Library and models a 13 liters model.set(’pendulumFriction’, Volvotruckengine[8]. Theenergyoftheexhaustgas pendFriction) afterthecombustionisconvertedtotorque,beforere- # Simulate the model response leasing the gas to the purification process. In Figure res = model.simulate(final_time=40) 8, an overview of the model is shown. The energy is converted into torque by two turbines, shown as two # Load simulation result phi_sim = res[’armJoint.phi’] trapezoids, where the first drives a compressor at the theta [rad] theta 6 101 5 MSiemausluarteiomne nnotsminal parameters 100 MMeeaassuurreemmeennttss -- NOopmtiminaall 4 Simulation optimal parameters d]10-1 32 error [ra111000---432 1 10-5 00 5 10 15 20 25 30 35 40 10-60 5 10 15 p2h0i 25 30 35 40 0.1 phi [rad] 100 Measurements - Nominal 0.0 MSiemausluarteiomne nnotsminal parameters 10-1 Measurements - Optimal 0.1 0.2 Simulation optimal parameters ad]10-2 00..43 error [r10-3 0.5 10-4 0.6 0.7 10-5 0.8 0 5 10 15 20 25 30 35 40 0 5 10 15 20 25 30 35 40 t [s] t [s] Figure 7: Error between the measurements and Figure 6: Simulation profiles corresponding to the the simulated profiles using the nominal parame- optimized parameters (dashed-dotted), profiles result- ters (dashed) and the optimized parameters (dashed- ing from simulation with nominal parameter values dotted). )dashed)andmeasurements(solid). air intake of the engine and the second is connected tothedriveshaft. Additionally, therearetwogasvol- umes which are connected to two thermal conductors thattransportheattothesurroundingair. Theendpoint circlesrepresenttheboundaryconditionsforthegas. Theuncertainparametersarethethermalcapacities inthewallsofthegasvolumestogetherwiththether- malconductancefromgastowallinthevolumes. Theinputsofthemodelarethegastemperatureand pressure entering the system, angular velocity of the Figure8: Overviewofthemodelofthedieselengine. turbines and the gas pressure exiting the system. The outputisthegastemperatureexitingthesystem. Measurements are provided for the inputs and the andthethermalconductanceintheleftvolume, using output sampled every second over a thirty minute pe- the results from the first problem. This procedure is riod. InFigure9,theresultisshownwhensimulating used since the parameters of the first and second vol- themodelusingnominalparametervalues. ume are correlated. Optimizing all parameters simul- The problem is to minimize the error between the taneouslythenresultsinover-parameterization. simulatedgastemperaturethatexitsthesystemandthe Foreachoptimizationproblem,thefirstthirdofthe measuredtemperature, measurement data sequences are used for calibration andtheremainingpartisusedforvalidation. M The model was exported from Dymola as an FMU min ∑(Tsim(t,x)−Tmeas(t))2 (7) x∈Rn i i and thereby made available to the DFO algorithms i=1 in JModelica.org. The two problems are then solved subjectto x≥0 (8) using the Nelder-Mead simplex algorithm. Figure 9 where M is the number of measurement points and n shows the resulting simulation response for the opti- thenumberofparameters. mizedparameters. InFigure10,thecorrespondinger- Insteadofoptimizingthefouruncertainparameters rorprofilesareshownforthecalibrationandvalidation simultaneously, the problem is divided into two prob- data sets respectively. As can be seen, the optimized lems. The first problem is to determine the thermal parameters significantly increase the accuracy of the capacityandthethermalconductanceintherightvol- model. The (scaled) RMS error was decreased from ume. Thesecondistodeterminethethermalcapacity 1.0to0.18forthecalibrationdatasetandfrom1.0to 0.36forthevalidationdataset. e.g., simulation of FMUs and comparison with mea- surement data or algorithmic evaluation of complex Exhaust gas temperature (scaled) discontinuouscosts. 1.00 Measurements Simulation with nominal parameters Simulation with estimated parameters 0.95 8 Acknowledgments The authors gratefully acknowledges financial sup- 0.90 portfromVinnovaunderthecontract(Projectnumber P35278-5) and from the Lund Center for Control of 0.85 ComplexSystems,LCCC,fundedbytheSwedishRe- searchCouncil. 0.80 References 0.75 0.0 0.2 0.4 0.6 0.8 1.0 time [1] Functional Mock-up Interface for Model Ex- Figure9: Simulationresultwiththeoptimizedparam- change. Interface specification, MODELISAR, eterstogetherwithresultusingthenominalparameter January2010. valuesandmeasurements. [2] C. Andersson, J. Åkesson, C. Führer, and M. Gäfvert. Import and export of Functional Mock-up Units in JModelica.org. In In 8th In- Exhaust gas temperature error (scaled) 10-1 ternational Modelica Conference 2011. Model- 10-2 data10-3 icaAssociation,2011. Calibration 111000---654 MMeeaassuurreemmeennttss -- NOopmtiminaall [3] JC..ÅAkensdseornss.oAn,wJo.rkAbnendcrehafsosornm,uClti.boFdüyhrseyrs,teamnds 10-70.00 0.05 0.10 0.15 0.20 0.25 0.30 ODE and DAE solvers. In The Second Joint In- 10-1 10-2 ternationalConferenceonMultibodySystemDy- data10-3 namics,2012. Validation 1100--54 Measurements - Nominal [4] J. Andersson, J. Åkesson, and M. Diehl. 10-6 Measurements - Optimal 10-7 0.4 0.5 0.6 0.7 0.8 0.9 1.0 CasADi—Asymbolicpackageforautomaticdif- time ferentiation and optimal control. In S. Forth, P. Hovland, E. Phipps, J. Utke, and A. Walther, Figure 10: Error profiles for the calibration data set editors, Proc. 6th International Conference (top)andthevalidationdataset(bottom). on Automatic Differentiation, Lecture Notes in Computational Science and Engineering. Springer,2012. 7 Summary [5] Joel Andersson, Johan Åkesson, Francesco Casella, and Moritz Diehl. Integration of casadi An implementation of derivative-free optimization al- andjmodelica.org.In8thInternationalModelica gorithms in JModelica.org has been presented. The Conference,March2011. implementation has been successfully applied to two dynamicmodelswherethedynamicsarecontainedin [6] T. Binder, L. Blank, H.G. Bock, R. Bulirsch, a Functional Mock-up Unit. In one of the examples, W. Dahmen, M. Diehl, T. Kronseder, W Mar- a Volvo truck engine was calibrated against measure- quardt,J.P.Schlöder,andO.v.Stryk.OnlineOp- ment data, demonstrating the industrial applicability timizationofLargeScaleSystems,chapterIntro- oftheapproach. ductiontomodelbasedoptimizationofchemical The Python-based user interface enables flexible processes on moving horizons, pages 295–339. implementation of complex cost functions involving, Springer-Verlag,BerlinHeidelberg,2001.

Description:
native for design and parameter optimization. In this paper, we present an implementation of derivative-free optimization algorithms for parameter estimation in the JModelica.org platform. The imple- mentation allows the underlying dynamic system to be represented as a Functional Mock-up Unit (FMU)
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.