AND AUTOMATED SIMULATION
5.4 EXTENDED FORMULATION METHODS—ALGEBRAIC LOOPS Constructing models of physical systems always requires modeling assumptions
5.4 EXTENDED FORMULATION METHODS—ALGEBRAIC LOOPS
vi(t) v′
vm
F(t)
F(t)
m
b1
b2 k
m′ (a)
0 1
C:1/k
Se 1 0 Sf:vi(t)
I:m R:b2
R: b
1
1 2
3
4
9 8 6
7
vm 5 v′
(b)
0 1
R C
Se 1 0 Sf
R: b
1
I
1 2
3
4
9 8 6
7 vm 5
0 1
R C
Se 1 0 Sf
R: b
1
I
1 2
3
4
9 8 6
7 vm 5
(d) (c)
:
FIGURE 5.10. Extended formulation—algebraic loop. Example 1.
The procedure for handling algebraic loops is to first make an arbitrary causal assignment on one of the causally unassigned bonds and then propagate the causal information as far as possible. If the causality completes after one arbitrary assignment, then there is one algebraic loop. If a second arbitrary assignment is required, then a second algebraic loop is present, and so on. The more loops involved, the more difficult the final formulation becomes. In Figure 5.10c an arbitrary assignment has been made onR4, which remained causally unassigned after the sources and energy storage elements had been assigned according to the procedure. The effort, e4, has been assigned as an output from the R-element.
This requirese5 to be an output from the 0-junction, and now withe5ande7as inputs to the 1-junction, we are constrained to haveR6in the causality indicated.
Thus, making one arbitrary assignment has yielded a causally complete bond graph, and thus there is only one algebraic loop for this example.
From the appearance of Figure 5.10c, one would not realize that there is a problem. The bond graph causality is complete, all energy storage elements are in integral causality, and there are no causal conflicts. Let’s see what happens if we attempt to derive the state equations using the procedure of the previous section.
The state variables arep2andq8, and the co-energy variables aref2ande8. The input variables from sources aree1andfa. Then,
˙
p2=e1−e3=e1−e4=e1−R4f4=e1−R4(p2/I2−f6) . (5.50) So far, all looks fine. But,
f6=(1/R6)e6=(1/R6)(e5−e7)=(1/R6) (e4−(1/C8)q8) , (5.51) and
e4=R4f4=R4(f3−f5)=R4(p2/I2−f6)= · · · (5.52) The flow, f6, in Eq. (5.52) comes from Eq. (5.51), which leads back to e4
again and we find ourselves in an endless loop of substitutions. This loop is not the fault of bond graphs. It is a direct result of the modeling assumptions that went into the schematic of Figure 5.10a. However, bond graphs and causality let you know there is a problem before any equations are derived.
The procedure for handling algebraic loops is to first recognize the problem from the resulting incomplete causality. This is followed by making an arbitrary causal assignment and extending the information according to the sequential assignment rules. This continues until all bonds are assigned. While it makes no difference which bond is selected for the arbitrary assignment, it is recom- mended from step 5 of the sequential causality assignment procedurethat when a resistance element is involved in the algebraic loop (i.e., it has a causally unas- signed bond), the resistance element be chosen for the arbitrary assignment. This was done in Figure 5.10c where the element R4 was chosen for the arbitrary assignment.
As mentioned earlier, an algebraic loop is an indicator that some effort or flow variable involved in the loop is algebraically related to itself and other source and state variables. The next step in the procedure is to derive this algebraic relationship. When a resistance element is involved in the loop, it is customary to choose the variable that was arbitrarily selected to be the output from the R-element and the input to the rest of the system. For the example here, since R4 was assigned arbitrarily, we select e4 as the variable to be related to itself.
Thus, we writee4 on the left-hand side of an equation and then use causality in the normal way to derive the desired relationship, thus,
e4=R4f4=R4(f3−f5)=R4((1/I2)p2−f6)=R4((1/I2)p2−(1/R6)e6)
=R4((1/I2)p2−(1/R6) (e4−(1/C8)q8)) . (5.53) Equation (5.53) is an algebraic relationship that relatese4to source variables, state variables, and toe4itself.
The next step is to solve the resulting relationship for the algebraic variable, e4 in this case,
(5.54) e4= (R4/I2)
(1+R4/R6)p2+ (R4/R6C8) (1+R4/R6)q8.
The final step is to derive the state equations following the standard procedure, only stop the formulation when the algebraic variable enters the formulation. For our example,
˙
p2=e1−e3=e1−e4,
˙
q8=f9+f7=f9+f6=f9+(1/R6) (e4−(1/C8)q8) . (5.55) We now substitute (5.54) into (5.55) and end up with the state equations in standard explicit form,
˙
p2=e1− (R4/I2)
(1+R4/R6)p2− (R4/R6C8) (1+R4/R6)q8,
˙
q8=f9−(1/R6C8)q8+ 1 R6
R4/I2
(1+R4/R6)p2+ R4/R6C8
(1+R4/R6)q8
. (5.56) To complete this discussion of algebraic loops, Figure 5.10d shows the same example system with a different arbitrary causal assignment. This time f4 is assigned as the output from R4, and the causality completes as shown. It makes no difference what bond is assigned arbitrarily. This system has an algebraic
problem consisting of one algebraic loop. Choosing f4 as the variable to relate to itself, we write,
f4=(1/R4)e4=(1/R4)e5=(1/R4)(e6+e7)=(1/R4) (R6f6+(1/C8)q8)
=(1/R4) (R6(f3−f4)+(1/C8)q8)
=(1/R4) (R6((1/I2)p2−f4)+(1/C8)q8) . (5.57) Solving forf4yields
f4= R6
(1+R6/R4)R4I2
p2+ 1
(1+R6/R4)R4C8
q8. (5.58) Equation derivation would follow the standard procedure except that we would stop whenf4 enters the formulation,
˙
p2=e1−R4f4,
˙
q8=f9+f5=f9+(1/I2)p2−f4. (5.59) The formulation is completed when (5.58) is substituted into (5.59). It is left to any non-believing reader to show that the resulting state equations are identical to (5.56).
So far in this section we have determined that some modeling assumptions can lead to algebraic formulation problems, and that bond graphs identify such a problem by the presence of incomplete causality after using the sequential causal assignment procedure up to step 4. A procedure has been presented through an example of a linear system that shows how to solve the algebraic problem and end up with state equations in standard form.
For linear systems, this procedure will work for multiple loops involving several algebraic variables, although solving by hand becomes formidable rather quickly. For nonlinear systems, it may not be possible to invert some of the algebraic relationships. For example, friction is a very common resistance effect in mechanical systems and is represented by an R-element in a bond graph.
For the most common friction representation (see Figure 8.2 in Section 8.1 of Chapter 8), the velocity (or flow) must be an input and the friction force (or effort) must be an output from the element. If the friction element was involved in an algebraic loop that required its inversion (calculation of velocity from knowledge of the force), in many cases it could not be done because a given force may have no corresponding velocity or several.
We probably should look into the modeling assumptions that created the prob- lem in the first place. In Figure 5.10a, the connection of the spring and damper wasassumed to be massless. The connection is not actually massless, it was just assumed to be and the assumption was probably justifiable during the modeling process. Consider Figure 5.11a, where a small mass,m, has been associated with the connection point. Figure 5.11b shows the bond graph for the system with causality assigned. No arbitrary assignment is required and there is no algebraic
vi(t) v′
vm
F(t) m
b1
b2 k
m′ (a)
(b) 0
1
I:m′
R:b2 C:1/k
Se 1 0 Sf:vi(t)
R:b
1
I:m
1 2
3
4
9 8 6
7
10
F(t): vm 5 v′
FIGURE 5.11. Eliminating an algebraic loop by revisiting modeling assumptions in Example 1.
loop. Equation derivation is straightforward for this system. If this had been the first model constructed, we would never have known that a potential problem exists. In Chapter 13, the concept of algebraic loops is dealt with more formally, and the idea of revisiting modeling assumptions when formulation issues arise is developed in much more detail. Reference [1] describes a formal vector-field method for generating state space equations.
5.4.1 Extended Formulation Methods—Derivative Causality
In this section we study systems where, after sequential causal assignment, one or more energy storage elements are forced into derivative causality. As with algebraic loops, the occurrence of derivative causality is due to the modeling assumptions made during the model construction. Storage elements in derivative causality are not dynamically independent of the remaining storage elements, and they do not contribute a state variable to the final equations.
Mathematically, Eqs. (5.10) or (5.11), are calledexplicit differential equations because the state variable derivatives are given as explicit functions of the state variables and the input variables. It is this form of the equations of motion that is best suited to analysis and simulation. When derivative causality arises, the state equations become implicit, meaning that some of the state variable derivatives
become functions of themselves as well as of the state and input variables. In principle, implicit state equations can be algebraically transformed to explicit ones but, as we will see, this is not necessarily a simple task and many computer simulation programs are not equipped to do it.
The independent state variables remain the p’s on I’s and theq’s onC’s in integral causality. The derivative elements do still store energy, and this energy is accounted for in the bond graph. By being dynamically dependent, their asso- ciated energy variable, p or q, is algebraically related to the independent state variables. So, knowledge of the independent state variables allows algebraic deter- mination of the energy variables on the derivative elements, and thus calculation of their contribution to the system energy. The algebraic relationships, relating the dependent and the independent energy variables must be derived before it is possible to have a state representation in explicit form. This is demonstrated through example.
Consider the physical system shown in Figure 5.12a. It consists of a perma- nent magnet dc motor driving a rotational load, J, through a flexible shaft of torsional stiffness,kτ. There is also some rotational damping with constant,bτ. On the electrical side of the motor, the winding resistance,Rw, and the winding inductance,L, are important dynamic effects. It has been decided, for this appli- cation, that the rotational inertia of the motor is negligible and it is not included.
Figure 5.12b shows a bond graph for this system where the motor has been characterized as a gyrator with coupling constant,T[N·m/A] (see Section 4.4.2 to remind you how to model dc motors).
In the figure, the bonds have been numbered and causality has been assigned using the sequential assignment procedure. The inductance,I3, has been put into integral causality. As a result, the compliance, C6, was constrained to be in derivative causality. The state variables for this system arep3 andp8, and only two state equations need to be derived. The single input variable isec. The energy variable, q6, is not an independent state variable, but is algebraically dependent on the independent state variables.
We cannot simply ignore the presence of the derivative element. If we try to derive the equations without its consideration, then we would write,
˙
p3=e1−e2−e4=e1−(R2/I3)p3−Tf5
=e1−(R2/I3)p3−T (f6+(1/I8)p8) . (5.60) The appearance off6 is where the derivative element enters the formulation, andf6must be dealt with before final formulation can be done.
We next recognize that
f6= ˙q6,
but there is no state equation forq6, and more work must be done.
The next step is to derive the algebraic relationship relatingq6to the state vari- ables and source variables. When we do this, we start by writing the constitutive