DifferenceEquation

From VLE

Jump to: navigation, search

Contents

Introduction

The DifferenceEquation extention allows to develop models that compute the value of one or more real variables in t depends on itself at t-1 t-2, ... and according to other real variables at t, t-1 t-2, ... We called it the difference equations but this extension is more general because only the above property is respected.

There are three ways to handle the difference equations:

  • individually: a model by equation;
  • as a system: a model for a set of equations;
  • and a generic way: the number of variables involved in the equation is indeterminate.

DifferenceEquation::Simple

The Difference::Equation class supports the first way to define Difference Equation: one model by equation.

The structure

You must define three types of port:

  • Ports for synchronization when several difference equations is coupled: update;
  • Ports for the perturbation of the difference equation:perturb;
  • Ports for interrogation by instantaneous events of the difference equation:request for input andresponse to the output.

update ports are defined as input and output if the equation integrates another variables managed by other equations or any other model managing the evolution of a numeric variable (eg QSS ). For these other models, it must respect a certain protocol.

 <in>	
  <port name="update" />
  <port name="request" />
  <port name="perturb" />
 </in>
 <out>	
  <port name="update" />
  <port name="response" />
 </out>

All ports are optional:

  • If you do not want to allow the perturbation, no perturb port;
  • If your equation is not integrated into a graph of numerical models and therefore does not depend on other models or do not involve with other numerical models, no update port;
  • If you do not want interroge your model, no request / response port.

If several equations (in this example m1 and m2) are mutually dependent, it must connect the update ports together.

 <connection type="internal">
  <origin model="m1" port="update" />
  <destination model="m2" port="update" />
 </connection>
 <connection type="internal">
  <origin model="m2" port="update" />
  <destination model="m1" port="update" />
 </connection>

Of course, if model denoted m2 needs only the variable m1 then only my first connection is required.

Remark: the structure and protocol are identical to that of QSS, it allows to build models based on differential equations and based on difference equations.

Initialisations

How to write a model based on DifferenceEquation::Simple?

DifferenceEquation::Multiple

The structure

Initialisations

How to write a model based on DifferenceEquation::Multiple?

How to perturb a DifferenceEquation model?

How to query a DifferenceEquation model?

Coupling with a no DifferenceEquation model

Cookbook

To increase the history size

This page was last modified on 19 July 2010, at 12:35. This page has been accessed 1,849 times.