Survey

Survey

Document related concepts

Transcript

Engs 22 — Systems NONLINEAR FLUID ELEMENTS AND LINEARIZATION This handout is not an introduction to fluid systems—it is more detail on the advanced topic of dealing with nonlinearity in fluid and other systems. For introductory material on fluid systems, see the text and the “fluid elements” handout. Thoroughly reading and understanding this is optional. All you really need to know for the problem set is in a box on p. 4. I. Ways to Deal with Nonlinear Systems Many of the analysis methods we have used (e.g., all of the Laplace methods) only work on linear time invariant systems. Most systems in the real world are nonlinear, at least to some degree. There are two ways to deal with nonlinear systems: Firstly, one can analyze them as nonlinear systems, or, secondly, one can approximate them as linear systems, and then use all the linear systems tools. For ENGS 22, you don’t need to become an expert in all of these methods, and homework, quizzes and tests won’t require you to use most of them. But it is useful to be aware of these methods as you consider applying the material from 22 in the future. And we will use the result of this analysis to derive some models of fluid elements that you will use on the homework. A. Analyzing Nonlinear Systems The only completely general method for analyzing nonlinear systems is to do a numerical solution. There are other methods of analyzing nonlinear systems as such, but none are as powerful or general as numerical solutions. It is useful to remember that the modeling methods we have used are generally applicable to nonlinear systems as well as linear systems: accounting or interconnection laws (such as KVL and KCL) work for nonlinear systems as well as for linear systems. The procedure of then using element laws and interconnection laws to write state space equations is also equally valid for nonlinear systems. B. Approximating Nonlinear Systems as Linear Here are three approaches to approximating nonlinear systems as linear. Method 1. Observe that the system or element is linear in the range of interest. This is what we did in the linear/nonlinear systems lab, and it is what we implicitly do for nearly any system that we analyze as a linear system, since most nominally linear elements become nonlinear at some point. Linear model f(x) Actual behavior x Fig. 1. Approximately linear behavior for a limited range. Linearization and nonlinear fluid elements Page 1 Engs 22 — Systems Method 2. The squint method: don’t look to closely and pretend that the system or element is linear in the range of interest. In this method you consider a system that really doesn’t behave linearly in the whole range of interest, but you pretend it does. There is very little mathematical justification for doing this, so if you do this, you will almost certainly want to check your results using a numerical simulation. However, it can give you an idea of what sort of behavior to expect, and can help you gain intuition for design purposes. Actual behavior Linear model f(x) x Fig. 2. The squint method: a rough linear approximation to a nonlinear system. The squint method is not generally mathematically justified, and counting on it can be dangerous. However, it is useful enough that people have developed a somewhat rigorous mathematical theory of it, called describing function analysis. You might see that in an advanced nonlinear control systems course; reference [1] has a chapter on approximate methods that includes describing function analysis. Method 3. Small signal analysis: Draw a tangent near the point of interest. This is a more rigorous method of analyzing a system that really doesn’t behave linearly using linear methods, but it is more limited in its application. It allows you to analyze only what happens with small signals. Fortunately that doesn’t mean that all the variables remain small, but it does mean that they can’t vary much. For example, a system with the waveform in Fig. 3. could be analyzed with small signal analysis. x - - -No minal operating point — Actual signal time Fig. 3. A signal appropriate for small signal analysis. We can write a signal like this as x(t ) = X 0 + ~x (t ) where X0 is the nominal operating point, and ~x (t ) is the small variation around that nominal operating point. If we then want to model a system or component near that operating Linearization and nonlinear fluid elements Page 2 Engs 22 — Systems point, we simply draw a tangent to the curve at that point, as shown in Fig. 4. Since the tangent has the slope of the derivative at that point, the linear model drawn there can be represented mathematically as1 df df f (x) ≈ f (X 0 ) + x˜ = b + a˜x , where b = f ( X 0 ) and a = . dx x = X0 dx x = X 0 Actual behavior Linear model f(x) Operating point x Fig. 4. Small signal analysis. A linear model that works for signals that are very close to an operating point. If the signal is small enough, we know that the linear approximation will be very good. So in the limit of very small signals—small variations around the operating point—the linear systems methods then all work perfectly for analyzing a system like this. II. Some Nonlinear Fluid Elements Fluid elements have inherent nonlinearities, more often than do thermal, mechanical, or electrical elements. A. Fluid Capacitors If we define fluid capacitance as the relationship between pressure and volume, Vol = Cp, analogous to Q = CV, an open tank (with vertical sidewalls) has a capacitance A where A is the area of the tank, ρ is the density of the fluid, ρg and g is the gravitational constant. If we want high pressure, we need a very high tank. For example, 60 psi (414 kPa) is a common pressure for water supply in buildings. That would require a water tank 42 m high. It is often desirable to get some capacitance without having to build anything that big. One approach is to put a piston and spring on top of the tank, as shown in Fig. 5a. The pressure is then p = f/A = kx/A = k Vol/A2. Thus, the capacitance is C = k/A2. However, making such a sprung piston is often impractical because of the requirement to have good high-pressure seals around the edge of the piston. A more practical alternative is to use an air spring, as shown in Fig. 5b. This has the same result, but the air acts as a nonlinear spring. 1 Some of you will recognize this as the first two terms of the Taylor series expansion of the function about that point. But Taylor series is more powerful than what we need here—all we are doing is drawing a line tangent to the operating point, and writing an equation for that line. Linearization and nonlinear fluid elements Page 3 Engs 22 — Systems Air space Piston Fluid Fluid a) With a spung piston. b) With an air chamber to act as a spring. Fig. 5. Two types of fluid capacitors. The behavior of the air spring can be written p⋅Vair = const., where Vair is the volume of the air, assuming constant temperature. That’s a relationship between pressure and volume, but not the one we want for a capacitor, because it is in terms of the air volume not the fluid volume. However, can relate the volumes by Vtot = Vfluid + Vair and rearrange to obtain Vfluid = Vtot − const. . p That’s not a linear relationship, so we don’t have a linear capacitor. However, if we are interested in small variations near some operating point P0, we can approximate this with Vfluid ≈ Vtot − const. d const. const. const. = Vtot − − + p P0 dp p P0 P0 2 For system modeling, we are really interested in the derivative of this, in which case the constant terms drop out and we have just q≈ from which we identify a small signal capacitance C = const. dp P0 2 dt const. . We can write the constant in terms of, V0, the volume P0 2 of air at P0, as const = V0 P0. Thus we have small signal capacitance C = V0 P0 where V0 is the volume of air at the nominal operating point pressure P0 for the air-spring fluid capacitor in Fig. 5b. B. Fluid Resistors In one fairly rare situation, fluid resistance is in fact very close to linear. That is for slow flow in small pipes, where resistance is Rf = 128µL πD4 where D is the diameter of a pipe, L is its length, and µ is the viscosity of the fluid. Specifically, this applies when the flow is smooth, technically termed laminar, as opposed to the more random flow patterns called turbulent. A useful Linearization and nonlinear fluid elements Page 4 Engs 22 — Systems rule of thumb is that when the Reynolds number, NR = ρDv , is below 2000 flow is usually laminar; for higher µ Reynolds numbers it is turbulent. For turbulent flow, the pressure/flow relationship is nonlinear, and is often approximated well by q= K p where K is a constant depending on the geometry and fluid properties that won’t be discussed here. See Doeblin [2] for a detailed treatment of lumped fluid elements, linear and nonlinear. II. Examples A. Emptying Tank Consider a tank emptying through a valve, that has nonlinear fluid resistance, described by q = K p . qin qout Fig. 6. Example nonlinear fluid system. First consider the behavior of this system with qin = 0. The capacitor is described by qcap = - qout = C dp/dt, where p is the pressure at the bottom of the tank, relative to atmospheric pressure, and thus is also the pressure across the valve. The resistor is described by qout = K p . So the whole system is described by qout = K p = −C variable format, dp , or, in state dt dp − K = p . Since this is nonlinear, we solve by ode45 simulation, using values for a one-squaredt C meter area tank initially filled to 1 m height, so that C = 10-4 m5/N, and the initial pressure is 10 kPa. K was chosen so that the tank empties in about 10 seconds, as shown in Fig. 7. Code for used with >>ode45('nltank',[0 10],1e4) to generate Fig. 7. function pdot=nltank(t,p) %derivative function for tank emptying through NL resistance %C. Sullivan C=1e-4; %m^5/N K = 2e-3; %m^3/(s P^0.5) pdot = -K/C*sqrt(p); Linearization and nonlinear fluid elements Page 5 Engs 22 — Systems 10000 pressure [Pa] 8000 6000 4000 2000 0 0 2 4 6 8 10 time [s] Fig. 7. Numerical solution for tank emptying. Now let’s try some linear approximation methods. First, let’s examine a plot of the q-p relationship. In Fig. 8 we see that it is not really linear over the range of interest—pressures from zero to 10 kPa. So we can’t use the first method and say it is linear in the range of interest. Nor can we say we are interested in small signal analysis—we want to examine a transient from all the way full to all the way empty. So all that is left is the “squint” method. We approximate it by a straight line, drawn through the curve to give some sort of rough approximation. The dashed line shown in Fig. 8 is for a resistance of 40 kPa s/m3. 0.25 flow (m3/s) 0.2 0.15 0.1 0.05 0 0 real characteristic 'squint' approximation 2000 4000 6000 Pressure (Pa) 8000 10000 Fig. 8. Nonlinear fluid resistance and a “squinting” approximation (dashed). The linear model makes analysis super-easy. The time constant is RC = 40,000⋅10-4 = 4 seconds. The solution is then p(t) = P0e-t/(RC) This is plotted with the real solution in Fig. 9. The approximation is reasonable, but nowhere near exact. Not surprisingly, the approximate linear solution deviates most at low pressures where the approximation in Fig. 8 deviated most. Linearization and nonlinear fluid elements Page 6 Engs 22 — Systems 10000 real solution 'squint' approximation pressure (Pa) 8000 6000 4000 2000 0 0 2 4 6 8 10 time (s) Fig. 8. Actual solution for the system in Fig. 6 with no input flow, and the solution based on a rough linear approximation. A. Tank with steady flow Now consider the same system in Fig. 6, but with a steady input flow of 0.16 m3/s. The steady state solution will be with the output flow equal to that input flow, QIN, and p = Q2IN /K2= 6400 Pa. That's actually right at the point where the line for the squint method crosses the real nonliner curve, so we might expect the squint method to do well there. Now consider a small disturbance from that steady state (e.g., there is power glitch in the power feeding the pump feeding the system). If the disturbance is small enough, this is a candidate for small-signal analysis. Let's consider a disturbance that drops the pressure to 5000 Pa––perhaps too big to call truly small, but possibly small enough for small-signal analysis to work. The differential equation for this system is the same as before but with an input term added. Q dp − K = p + IN . dt C C We can approximate the right hand side using a tangent to the curve at point P0: d −K dp − K = P0 + p˜ dp C dt C Q p + IN C where we are writing pressure as the sum of the constant P0 plus a small signal portion: p = P0 + p˜ , d( p (−Κ −Κ 1 dp ˜p. The derivative of p˜ is = p˜ = dt dp C C 2 P0 equal to the derivative of p, and so we have a first-order linear differential equation for p˜ , Conveniently, the two constant terms cancel, and we have dp˜ − K 1 = p˜ C 2 P0 dt Linearization and nonlinear fluid elements Page 7 Engs 22 — Systems with a time constant τ = 2C P0 = 8 seconds. This is a different linear approximation to the system and gives a K different time constant than the squint method did. In theory it should be a better approximation to the system behavior, because we have carefully matched the region of the nonlinear curve that we are interested in, near 6400 Pa. Let's compare three solutions––the tangent method, the squint method, and the correct numerical solution. The squint method and the tangent method both predict p(t) = (1400 Pa) −t / τ but with different values of τ : eight seconds for the tangent method, and four seconds for the squint method. Those two solutions are plotted in Fig. 9, along with the ode45 solution of the full nonlinear equations. We see that the more rigorous small-signal tangent method approximates the system nearly perfectly, even for this 22% disturbance which isn't all that small. For smaller disturbances, the curves match even more closely, and become indistinguishable. 6400 6200 pressure (Pa) 6000 5800 5600 5400 real solution 'squint' approximation small signal approximation 5200 5000 0 5 10 time [s] 15 20 Fig. 9. Three solutions for the system in Fig. 6 with steady input flow, for an initial condition 1400 Pa below the steady-state operating point To see why the small-signal approximation is better, consider the pressure-flow relationships corresponding to the three solutions, all shown in Fig. 10. Although both approximations are exact at the operating point, the slope of the small-signal approximation––a tangent to the real curve––is a better approximation. That does not mean, however, that the small-signal model works well for anything. Fig. 11 shows the solution the small signal model would predict for the tank-emptying problem (with no flow in). It is way off. So the small signal solution really is only good for use as intended––small deviations from a defined operating point. Linearization and nonlinear fluid elements Page 8 Engs 22 — Systems 0.25 flow (m3/s) 0.2 0.15 0.1 real solution 'squint' approximation small signal approximation 0.05 0 0 2000 4000 6000 pressure, (Pa) 8000 10000 Fig. 10. The three resistor current/flow relationships used for the solutions in Fig. 9. It is clear that the small- signal approximation, as a tangent to the real relationship, is a better approximation in the region near the 6400 Pa operating point. 10000 real solution 'squint' approximation small signal approximation pressure (Pa) 8000 6000 4000 2000 0 0 2 4 6 8 10 time (s) Fig. 11. This is repeat of Fig. 8, but with another solution––the small-signal approximation for operation near 6400Pa. The small-signal approximation is way off from the actual behavior, showing that although it is a great model for small perturbations right near 6400 Pa, it is no good at all far away from that point. References [1] M. Vidyasagar. Nonlinear System Analysis. Prentice Hall, 1978. Usually considered a graduate level text, but one of the few places that treats linearization by describing function analysis (what I’ve called squinting) somewhat rigorously. [2] Earnest O. Doebelin, System Dynamics: Modeling Analysis and Design. Marcel Dekker, 1998. The most rigorous and thorough treatment of lumped-element modeling I know of. Linearization and nonlinear fluid elements Page 9