Return to search

Simulering av simulinkmodeller med Extended Kalman Filter

Simulations of simulink models using Kalman filters are often very time-consuming. This problem depends mainly on the fact that the Kalman correction has to be performed at each sample instance through the whole simulation. The goal for this thesis work is to reduce that time-consumption for the filtering part (the integration partis treated in a complementary report) of a simulation. Furthermore a Matlab routine to perform parameter tuning and finally a graphical user interface is developed. The filtering part of the simulation in this thesis is based on an Extended Kalman Filter (EKF). The time optimization of this filter considers searching for the possibility to replace the today’s existing Matlab functions that is used to perform the filtering calculations. Examples of such functions are routines for linearization and integration. To decrease the time-consumption, we have also developed a routine to make it possible to convert a simulink model to a state-space description. This conversion makes it possible to avoid a lot of time-consuming calls to the simulink model. In this case it is the built-in functions in Matlab that causes the large time-consumption. The main time-consuming parts in the filter are the built-in routines for linearization (linmod) and the numerical method that is used to calculate the prediction error (riccatiequation). By creating new routines to solve these problems, the total time-consumption for the filtering part is reduced by approximately a factor of eighteen. As a final step the time optimized Kalman filter and the time optimized integration (treated in a complementary report) are brought together in a time efficient routine for simulation. This final routine for simulation may further be used to perform a time efficient simulation, but also to form a routine, which can be used to estimate unknown parameters in a simulink model. Using the time optimized parts of the simulation routine will make it possible to reduce the execution time for a filtering simulation by approximately a factor of ten. Three kinds of models are used to confirm that the different element of the Kalman filter and the new developed routines work properly. These models consist of one fermentation system that describes a biological process, and two different tank systems that describe the level and the torrent of water in several water tanks. / Vid filtrerande simulering av simulinkmodeller är tidsåtgången i dagsläget mycket påtaglig, mest beroende på att kalmankorrigeringen måste appliceras i varje samplingspunkt. Målet med detta examensarbete är att minska tidsåtgången som för närvarande råder för den filtrerande delen (den integrerande delen av simuleringen behandlas i en komplimenterande rapport) av en simulering. Utöver detta utvecklas även en Matlab-rutin för parametersökning samt ett enkelt grafiskt användargränssnitt som underlättar användandet av utvecklade rutiner. Den filtrerande delen av simuleringen består i detta examensarbete av ett s.k. utvidgat kalmanfilter, EKF (Extended Kalman Filter). Tidsoptimeringen av detta filter bygger på att undersöka och eventuellt ersätta de inbyggda Matlabfunktioner som i dagsläget måste användas för att genomföra en sådan filtrering. Exempel på sådana är funktioner för linjarisering och integrering. För att minska tidsåtgången utvecklas även en rutin för konvertering av simulinkmodeller till en s.k. tillståndsbeskrivning. Detta medför bl.a. att tidsödande anrop till simulinkmodellen kan undvikas. De i Matlab inbyggda funktioner som i detta fall står för den största delen av den påtagliga tidsåtgången är linmod för linjarisering samt en inbyggd numerisk metod för att beräkna prediktionsfelets varians (riccati-ekvationen). Genom att skapa nya metoder för att lösa dessa problem, har tidsåtgången för att utföra den filtrerande delen av simuleringen reducerats med en faktor 18. I ett slutskede sammanfogas sedan det tidsoptimerade kalmanfiltret med en tidsoptimerad rutin för integrering (behandlas i en komplimenterande rapport) till en komplett simuleringsrutin. Denna simuleringsrutin kan sedan användas för tidseffektiva simuleringar av simulinkmodeller, men utnyttjas även som grundstomme vid utveckling av parametersökningsrutinen. Den sammanfogade simuleringsrutinen har med hjälp av de två tidsoptimerade delarna för kalmanfiltrering och integrering medfört att tidsåtgången för att genomföra en filtrerande simulering reducerats med ungefär en faktor 10. För att testa de olika momenten och de utvecklade rutinerna används tre olika modeller. Dessa modeller består av ett fermatorsystem som beskriver en biologisk tillväxtprocess samt två olika tanksystem som beskriver flöden och nivåer i det aktuella systemets vattentankar.

Identiferoai:union.ndltd.org:UPSALLA1/oai:DiVA.org:kth-109457
Date January 2005
CreatorsBack, Per
PublisherKTH, Reglerteknik
Source SetsDiVA Archive at Upsalla University
LanguageSwedish
Detected LanguageSwedish
TypeStudent thesis, info:eu-repo/semantics/bachelorThesis, text
Formatapplication/pdf
Rightsinfo:eu-repo/semantics/openAccess

Page generated in 0.0025 seconds