An air pump is used in an aquarium to promote gas exchange, which oxygenates the water and removes carbon dioxide. These pumps force air to the bottom of the tank to create bubbles and often have to overcome a considerable amount of pressure head to accomplish this. They also happen to be great examples of multi-domain dynamical systems that are fun to mathematically model.
In this informal modeling project, I create a mathematical model of the coupled electrical, magnetic, mechanical, and fluidic domain physics of an aquarium pump.
A cantilevered beam constitutes the heart of the pumping mechanism where it acts like a large lever. On the tip of the beam is a magnet that, under the forcing caused by a changing magnetic field, oscillates to deform a flexible diaphragm below the center of the beam.
The diaphragm encloses a chamber that contains inlet and outlet ports, each with check valves arranged such that air flows from the inlet to the outlet. The diaphragm and chamber are together modeled as a piston and cylinder arrangement.
The check valves are an inherently nonlinear component; they permit flow in a single direction only, and no flow otherwise. Because of this, extra care must be taken when creating the linear graph or bond graph to ensure the appropriate causality. To better understand why, consider a simple piecewise linear model for the inlet check valve:
In this case, the flow is well-defined: given a pressure drop across the inlet check value, a corresponding flow rate can be computed. However, this function is also not invertible; because of this, the causal chain in the graphs must enforce a specific causality. This implies omitting the check valve dissipating elements from the normal tree (linear graph) and ensuring derivative causality on the dissipating elements (bond graph).
Modeling is as much an art as it is a science; mathematical models are, initially, a product of intuition and guesswork since one typically cannot know a priori all of the salient factors that influence the behavior of a model with great certainty until empirical work is carried out. Making a model is, therefore, a sort of back-and-fourth between proposing the underpinnings of a system and corroborating that proposal with experimentation until the model is adequately predictive. Of course, many models have been proposed for many different systems, so starting with secondary research for the system of interest is always helpful when developing a model, as is access to extant empirical data for validating a modeling hypothesis.
To make the guesswork part of model development more explicit, I like to enumerate all of the major modeling assumptions I plan on making before creating a model consistent with those assumptions; if the model fails to predict reality in the way I’d like, I can then turn my attention to the list of assumptions to try to determine which one may not be valid.
Some of the most consequential assumptions for the pump model are:
EIN – The input voltage, applied to the coil
RC – Coil winding resistance
i – Current in the coil
K – This coefficient relates the electrical domain to the mechanical domain. It is often approximated using the product of the magnetic field strength, the “effective length” of the coil, and the number of wire turns in the winding.
m – magnet mass
Vm – velocity of the magnet mass
Fm – force on magnet mass
A (as a subscript) – a point on the lever mechanism defined as the location of attachment of the diaphragm
B (as a subscript) – a point defined as the magnet end of the lever mechanism, also assumed to be the same point as the effective center of mass of the magnet
Vp – velocity of the piston
kp – linear spring stiffness of diaphragm
A – effective area of the piston. Because the diaphragm deforms in order to displace fluid, this is not necessarily equal to the inner diameter of the chamber. It is, perhaps, best to measure this relationship between displacement and volumetric flow rate (or force and pressure) empirically. Can be estimated by assuming by assuming a geometry of deformation.
C – fluid (air) compliance. Can be determined using an ideal gas law. In our case, it can be estimated by C=V⁄nP, where V is the volume of the chamber, n is the polytropic index, and P is the pressure.
R1 – linear fluid resistance of the input check valve. This may also be considered to be the sum of all resistances on the input side.
R2 – linear fluid resistance of the output check valve. This may also be considered to be the sum of all resistances on the output side.
pc – chamber pressure
PIN, POUT – input and output pressure, respectively
e1, F1, F2, Q3 – “placeholder” variables, used to complete transducer constitutive relationships
Note that the above list of variables is not necessarily exhaustive; however, the meaning of any variable introduced later should be clear in context.
The term linear graph refers to a graphical representation of a system and also a generic, multi-domain, graphical modeling technique that could be considered a generalization of electrical circuit models – in fact, when you look at a linear graph, you’re very nearly looking at an equivalent circuit model. Rules for finding the normal tree are used to determine independent energy storage elements, which constitute the system states. Equations that arise from application of the compatibility condition (a generalization of Kirchhoff’s voltage law) and continuity condition (a generalization of Kirchhoff’s current law) allow for algebraically finding the state equations. Care is taken to avoid causality conflicts and algebraic loops, which often arise from poor modeling assumptions and are not always immediately obvious when modeling multi-domain systems.
As with a linear graph, the term bond graph refers to both a graphical representation of a dynamical system as well as a generic, multi-domain, graphical modeling technique that aids in the understanding of systems and in the derivation of the state equations. Elements in the graph are connected with bonds that represent bi-directional exchange of energy. Similar to identification of the normal tree with linear graphs, causality assignment is used to determine the independent energy storage elements in the system and thus the state variables. Compatibility and continuity conditions allow for the algebraic isolation of the state variables. Care is taken to avoid causality conflicts and algebraic loops, which often arise from poor modeling assumptions and are not always immediately obvious when modeling multi-domain systems.
Either the linear graph or bond graph may be used, together with the element and transducer constitutive relations, to derive a state-space representation of the system. Most of the nonlinearities in this system were neglected for the sake of keeping a toy problem simple; assume for a moment we may treat the check valves in the same manner. Then, the state-space representation may take the familiar matrix form:
In this case, a state was added to track the displacement of the magnet in the output. Also, an additional output equation was derived to track the output volumetric flow rate of the pump, which seems useful as a design variable for a pump model.
Of course, for a real model to be useful, the piecewise linear check valve model would need to be incorporated, which also means that the system cannot be written in matrix form. In this case, it may be more appropriate to choose the volume of the air chamber as a state variable instead of the pressure; this volume could be expressed in terms of the volumetric flow rate variables for the check valves, which can then be computed using the piecewise linear model.