Let’s consider a pneumatic system, which consists of a flat tire and an air compressor to inflate it. The system can be modeled as follows:
: is the compressor’s pneumatic resistance.
: models the tire’s capacitance
: models the losses due to the puncture.
To develop a hybrid model I chose the following variables:
: stands for the manometric pressure in the tire.
: stands for the state of the compressor (‘on’ or ‘off’).
The compressor turns on if the pressure falls below and it turns off when the pressure inside the tire reaches . Between this two limits the pressure flows according to the following equation:
This equation was obtained under the following assumptions:
• The variation of the tire’s volume is negligible, then tire’s capacitance is constant.
• The compressor is a constant pressure source of value
• The pressure never exceeds the limits or
The hybrid model is then defined by:
The Matlab code written to simulate the system using HyEQ Toolbox is presented below. The values of the parameters were chosen in order to obtain results that could be quickly visualized, but they must be changed for more appropiate values.
function inC = C(x) %check if in C p = x(1); eps = 0.12; pmin = 8; pmax = 11; if (p>=pmin+eps && p<=pmax-eps) || p>=pmax+eps inC = 1; else inC = 0; end end
function inD = D(x) %check if in D p = x(1); eps = 0.12; eps = 0.12; pmin = 8; pmax = 11; if (p<=pmin+eps && p>=pmin-eps ) || (p<=pmax+eps && p>=pmax-eps ) inD = 1; else inD = 0; end end
function xdot = f(x) %flow map p = x(1); q = x(2); if q == 1 %pdot=-(Rc+Rp)/(Rc*Rp*Cc)*p+psource/(Cc*Rc) pdot = -0.2*p+0.3*7.5; else %pdot=-Cc/Rp*p pdot = -0.1*p; end qdot = 0; xdot = [pdot qdot]'; end
function xplus = g(x) % jump map p = x(1); q = x(2); pmin = 8; pmax = 11; eps = 0.12; if p<=pmax+eps && p>=pmax-eps qplus = 0; pplus = pmax-eps; elseif p<=pmin+eps && p>=pmin-eps qplus = 1; pplus = pmin+eps; end xplus = [pplus qplus]'; end