28.01.2013 Views

Adaptative high-gain extended Kalman filter and applications

Adaptative high-gain extended Kalman filter and applications

Adaptative high-gain extended Kalman filter and applications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

tel-00559107, version 1 - 24 Jan 2011<br />

C.2 Computational Function for the Simulation of the DC Machine<br />

if exists ( ’ outport ’ ) then model . out=ones ( outport , 1 ) , ..<br />

model . i n = [ ] ,<br />

else model . out =1, model . i n = [ ] , end<br />

model . e v t i n=1<br />

model . rpar =[]<br />

model . i p a r =[ch ;<br />

range ;<br />

a r e f ;<br />

length (name) ;<br />

a s c i i (name) ’ ]<br />

model . d s t a t e = [ 1 ] ;<br />

model . blocktype= ’ d ’<br />

model . dep ut =[%t %f ]<br />

exprs =[sci2exp ( ch ) ,name , sci2exp ( range ),sci2exp ( a r e f ) ]<br />

gr i =[ ’ x s t r i n g b ( o r i g ( 1 ) , o r i g ( 2 ) , [ ’ ’COMEDI A/D ’ ’ ; name+ ’ ’ ..<br />

CH− ’ ’+s t r i n g ( ch ) ] , sz ( 1 ) , sz ( 2 ) , ’ ’ f i l l ’ ’ ) ; ’ ]<br />

x=st<strong>and</strong>ard define ( [ 3 2 ] , model , exprs , g r i)<br />

end<br />

endfunction<br />

C.2 Computational Function for the Simulation of the DC<br />

Machine<br />

This first code are given only to provide a complete picture with regard to the implementation.<br />

This simulation presents no difficulties. Let us remark that an alternative solution to the<br />

definition of the parameter in the code itself is to pass them through the real parameter vector<br />

entry of the interfacing function, see [41].<br />

function name DCmachine number of zero crossing<br />

surfaces<br />

0<br />

implicit n initial discrete state []<br />

input port size 2 real parameter vector []<br />

output port size 2 integer parameter vector<br />

[]<br />

input event port size [] initial firing vector []<br />

output event port size [] direct feed through y<br />

initial continuous state ⊛ time dependence y<br />

Table C.1: Arguments of the DC Simulation.<br />

⊛ =[I(0), ωr(0)].<br />

#include <br />

#include <br />

#include <br />

void DCmachine ( s c i c o s b l o c k ∗ block , int f l a g )<br />

{ /∗ t h i s i s t h e l i s t o f t h e f i e l d s we have to use<br />

155

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!