MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
IdentARMAXProcess Class Reference

#include <id.h>

Inheritance diagram for IdentARMAXProcess:
Collaboration diagram for IdentARMAXProcess:

Public Member Functions

 IdentARMAXProcess (unsigned int iOut, unsigned int iIn, unsigned int iA, unsigned int iB, ForgettingFactor *pf)
 
virtual ~IdentARMAXProcess (void)
 
virtual void Update (const doublereal *pdYTmp, const doublereal *pdUTmp)
 
virtual void GetTheta (doublereal *pdTheta)
 
void GetErr (doublereal *pdE)
 
virtual integer iGetSize (void) const
 
- Public Member Functions inherited from IdentProcess
 IdentProcess (unsigned int iOut, unsigned int iIn, unsigned int iA, unsigned int iB)
 
virtual ~IdentProcess (void)
 
void CreateIdent (integer size, integer nout, ForgettingFactor *pf)
 
virtual doublereal dGetForgettingFactor (void)
 
integer iGetNumOutput (void) const
 

Protected Member Functions

flag fCheckMA (doublereal *pdTheta)
 

Protected Attributes

integer size
 
doublerealpdBase
 
doublerealpdPhi
 
doublerealpdY
 
doublerealpdErr
 
- Protected Attributes inherited from IdentProcess
unsigned int iNumOutput
 
unsigned int iNumInput
 
unsigned int iOrdA
 
unsigned int iOrdB
 
IdentpIdent
 

Detailed Description

Definition at line 154 of file id.h.

Constructor & Destructor Documentation

IdentARMAXProcess::IdentARMAXProcess ( unsigned int  iOut,
unsigned int  iIn,
unsigned int  iA,
unsigned int  iB,
ForgettingFactor pf 
)

Definition at line 272 of file id.cc.

References IdentProcess::CreateIdent(), pdBase, pdErr, pdPhi, pdY, SAFENEWARR, and size.

275 : IdentProcess(iOut, iIn, iA, iB),
276 size(2*iOut*iA+iIn*(iB+1)), pdBase(NULL), pdPhi(NULL), pdY(NULL), pdErr(NULL)
277 {
278  // size e' il lato lungo di Theta.
279 
280  CreateIdent(size, integer(iOut), pf);
281 
282  integer i = size // Phi
283  +iOut // Y
284  +iOut; // Err
285 
287 
288  pdPhi = pdBase;
289  pdY = pdPhi+size;
290  pdErr = pdY+iOut;
291 
292 
293  for (integer j = i; j-- > 0; ) {
294  pdBase[j] = 0.;
295  }
296 }
void CreateIdent(integer size, integer nout, ForgettingFactor *pf)
Definition: id.cc:182
doublereal * pdErr
Definition: id.h:163
doublereal * pdBase
Definition: id.h:159
IdentProcess(unsigned int iOut, unsigned int iIn, unsigned int iA, unsigned int iB)
Definition: id.cc:167
integer size
Definition: id.h:156
doublereal * pdPhi
Definition: id.h:161
doublereal * pdY
Definition: id.h:162
#define SAFENEWARR(pnt, item, sz)
Definition: mynewmem.h:701
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

IdentARMAXProcess::~IdentARMAXProcess ( void  )
virtual

Definition at line 298 of file id.cc.

References pdBase, and SAFEDELETEARR.

298  {
300 }
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
doublereal * pdBase
Definition: id.h:159

Member Function Documentation

flag IdentARMAXProcess::fCheckMA ( doublereal pdTheta)
protected

Definition at line 370 of file id.cc.

Referenced by GetTheta().

371 {
372  // fa la correzione di Theta in base agli autovalori ed autovettori
373  return flag(0);
374 }
long int flag
Definition: mbdyn.h:43
void IdentARMAXProcess::GetErr ( doublereal pdE)
virtual

Reimplemented from IdentProcess.

Definition at line 363 of file id.cc.

References IdentProcess::iNumOutput, and pdErr.

364 {
365  for (integer i = iNumOutput; i-- > 0; ) {
366  pdE[i] = pdErr[i];
367  }
368 }
doublereal * pdErr
Definition: id.h:163
unsigned int iNumOutput
Definition: id.h:90
long int integer
Definition: colamd.c:51
void IdentARMAXProcess::GetTheta ( doublereal pdTheta)
virtual

Implements IdentProcess.

Definition at line 346 of file id.cc.

References fCheckMA(), IdentProcess::iNumOutput, NO_OP, Ident::pdGetTheta(), IdentProcess::pIdent, and size.

347 {
348  // fa calcolare il nuovo theta
349  doublereal* p = pIdent->pdGetTheta();
350 
351  // se e' il caso, corregge la parte di MA di Theta
352  if (fCheckMA(p)) {
353  // se la parte MA di theta e' stata corretta, e' stata aggiornata in loco
354  NO_OP;
355  }
356 
357  // restituisce il nuovo theta
358  for (integer i = iNumOutput*size; i-- > 0; ) {
359  pdTheta[i] = p[i];
360  }
361 }
doublereal * pdGetTheta(void)
Definition: id.cc:115
flag fCheckMA(doublereal *pdTheta)
Definition: id.cc:370
#define NO_OP
Definition: myassert.h:74
integer size
Definition: id.h:156
unsigned int iNumOutput
Definition: id.h:90
Ident * pIdent
Definition: id.h:95
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

virtual integer IdentARMAXProcess::iGetSize ( void  ) const
inlinevirtual

Implements IdentProcess.

Definition at line 177 of file id.h.

References size.

177  {
178  return size;
179  };
integer size
Definition: id.h:156
void IdentARMAXProcess::Update ( const doublereal pdYTmp,
const doublereal pdUTmp 
)
virtual

Implements IdentProcess.

Definition at line 304 of file id.cc.

References IdentProcess::iNumInput, IdentProcess::iNumOutput, IdentProcess::iOrdA, IdentProcess::iOrdB, pdErr, Ident::pdGetErr(), pdPhi, pdY, IdentProcess::pIdent, and Ident::Update().

306 {
307  // qui iniziano gli errori
309 
310  // sposta di un passo (iNumOutput) le uscite e gli errori
311  for (integer i = iNumOutput*(iOrdA-1); i-- > 0; ) {
312  pdPhi[i+iNumOutput] = pdPhi[i]; // Y vecchi
313  pdTmp[i+iNumOutput] = pdTmp[i]; // Err vecchi
314  }
315  // aggiunge in testa le uscite e gli errori al passo precedente
316  for (integer i = iNumOutput; i-- > 0; ) {
317  pdPhi[i] = pdY[i]; // Y all'ultima iterazione
318  pdY[i] = pdYTmp[i]; // Y nuovo
319  pdTmp[i] = pdErr[i]; // Err all'ultima iterazione
320  }
321 
322  // qui iniziano gli ingressi
323  pdTmp = pdPhi+iNumOutput*iOrdA;
324  // sposta di un passo (iNumInput) gli ingressi
325  // if (iOrdB == 0) // ARMA is implicitly satisfied
326  for (integer i = iNumInput*iOrdB; i-- > 0; ) {
327  pdTmp[i+iNumInput] = pdTmp[i];
328  }
329  // aggiunge in testa gli ingressi al passo corrente
330  for (integer i = iNumInput; i-- > 0; ) {
331  pdTmp[i] = pdUTmp[i];
332  }
333 
334  // fa aggiornare la stima di Theta
335  pIdent->Update(pdPhi, pdY);
336 
337  // err al passo corrente e' stato calcolato da Ident; lo ricopia
338  doublereal* pd = pIdent->pdGetErr();
339  for (integer i = iNumOutput; i-- > 0; ) {
340  pdErr[i] = pd[i];
341  }
342 }
unsigned int iOrdA
Definition: id.h:92
doublereal * pdErr
Definition: id.h:163
doublereal * pdGetErr(void)
Definition: id.cc:133
void Update(const doublereal *pphi, const doublereal *yy)
Definition: id.cc:137
doublereal * pdPhi
Definition: id.h:161
doublereal * pdY
Definition: id.h:162
unsigned int iNumOutput
Definition: id.h:90
Ident * pIdent
Definition: id.h:95
unsigned int iNumInput
Definition: id.h:91
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
unsigned int iOrdB
Definition: id.h:93

Here is the call graph for this function:

Member Data Documentation

doublereal* IdentARMAXProcess::pdBase
protected

Definition at line 159 of file id.h.

Referenced by IdentARMAXProcess(), and ~IdentARMAXProcess().

doublereal* IdentARMAXProcess::pdErr
protected

Definition at line 163 of file id.h.

Referenced by GetErr(), IdentARMAXProcess(), and Update().

doublereal* IdentARMAXProcess::pdPhi
protected

Definition at line 161 of file id.h.

Referenced by IdentARMAXProcess(), and Update().

doublereal* IdentARMAXProcess::pdY
protected

Definition at line 162 of file id.h.

Referenced by IdentARMAXProcess(), and Update().

integer IdentARMAXProcess::size
protected

Definition at line 156 of file id.h.

Referenced by GetTheta(), IdentARMAXProcess(), and iGetSize().


The documentation for this class was generated from the following files: