## 12. Standard Model Forms

• When modeling a system we will first develop a set of equations that describe the system. But to solve or analyze these equations we need to put them into a standard form.

• Two standard forms that we will consider are,

state variable equations.

input-output equations.

12.1 State Variable Equations

• For analysis purposes it is useful to write the differential equations for a system in state variable form.

• These equations will be in the form of first order differential equations. If they are not we will have to do some extra work to get them so that no derivative is higher than first order.

• The term ‘state’ refers to variables that describe the current position of the system.

these elements should be for energy storing elements (potential or kinetic).

the variables must be independent.

they should fully describe the system elements.

• The state variable form is seen below, Problem 12.1 Put the equation below into state variable form. (remember it has to be first order) • We want to select state variables that store energy. A capacitor voltage is a good choice, as is the position of an inertial mass or length of a spring. They both are the result of one or more integration steps.

• The number of unknown values (state variables) must be the same as the number of equations to be able to solve the problem. This means that matrix A must be square.

• Once the equations are in this form it is easy to integrate the values using a numerical technique such as Runge-Kutta integration.

• The general approach to this technique is,

1. Generate the differential equations to model the process.

2. Select the state variables.

3. Rearrange the equations to state variable form.

5. Enter the problem into a computer and solve.

• A simple example is given for a mass/spring combination. • The equations developed in step 3 can be used to solve the differential equations on most modern engineering calculators. For example on a TI-86 the basic steps are outlined in the example below. • To solve these problems in mathcad is a fairly similar method, and this can be seen in the figure below, • Develop the state variable form for the problem below, • Now solve the same problem with an added damper. • Develop the state variable form for the problem below, • Often we will get state equations that have more than one term with the same high order derivative. When this occurs we need to add a new dummy variable. (Note: This quite often happens for a sum of forces without a mass) • Consider the example below. #### 12.1.1 Numerical Integration

• This form of integration is done numerically: this means by doing repeated calculations to solve the equation. Numerical techniques are not as elegant as solving differential equations, and will result in small errors. But these techniques make it possible to solve complex problems much faster.

• This method uses forward/backward differences to estimate derivatives or integrals from measured data. • We can also estimate the change resulting from a derivative using Euler’s equation for a first order difference equation. (This is known as the Euler method.) • Consider the following differential equation,  • These methods can work well if the system is linear. But, if the system is not linear or the integration step is too long they will be very inaccurate.

#### 12.1.2 Taylor Series

• Recall the basic Taylor series, • We can integrate a given function as shown below, #### 12.1.3 Runge-Kutta Integration

• The equations below are for calculating a fourth order Runge-Kutta integration. • Integrate the functions below and use a time step of 0.1. • Mathcad, Working Model and all other computer based mathematics packages use this or a similar method for solving differential equations.

• Try the practice problem below, • Try to simulate the system below using Runge-Kutta. 12.2 Input-Output Equations

• These equations only contain references to the inputs and outputs. To get these equations we need to eliminate all variables that are not inputs or outputs.

• An example of these equations is shown below. Notice that each equation is for a single outputs, but it refers to multiple inputs. • Consider the example, • As an exercise - find the second equation in the previous example.

12.3 Problems

Problem 12.2 a) Put the differential equations below in state variable form.

b) Put the state equations in matrix form Problem 12.3 Find the input-output form for the following equations. Problem 12.4 Write the differential equations for the systems pictured below (assume small angular deflections).

Then, put the equations in state variable form.        Problem 12.5 For the mechanism in the figure below, a. Find the differential equations for the system. Consider the effects of gravity.

b. Put the equations in state variable form.

c. Put the equations in state variable matrices.

d. Use your calculator to find values for x1 and x2 over the first 10 seconds using 1/2 second intervals. Use the values, K1=K2=100N/m, B=10Nm/s, M1=M2=1Kg. Assume that the system starts at rest, and the springs are undeformed initially.

e. Use Mathcad to plot the values for the first 10 seconds.

f. Use working model to find the values for the first 10 seconds.

g. Use Mathcad and the Runge-Kutta calculations in the notes to find the first 10 seconds using half second intervals.

h. Repeat step g. using the first order approximation method.

Problem 12.6 You are given the following systems. a) Draw FBDs and write the differential equations for the individual masses.

b) Combine the equations in input-output form with y as he output and F as the input.

c) Write the equations in state variable matrix form.

d) Use Runge-Kutta to find the system state after 1 second.

Problem 12.7 For the mechanism in the figure below, a. Find the differential equations for the system.

b. Put the equations in state variable form.

c. Put the equations in state variable matrices.

d. Use your calculator to find values for x1 and x2 over the first 10 seconds using 1/2 second intervals. Use the values, Ks1=Ks2=100N/m, Kd1=10Nm/s, M1=M2=1Kg. Assume that the system starts at rest, and the springs are undeformed initially.

e. Use Mathcad to plot the values for the first 10 seconds.

f. Use working model to find the values for the first 10 seconds.

g. Use Mathcad and the Runge-Kutta calculations in the notes to find the first 10 seconds using half second intervals.

h. Repeat step g. using the first order approximation method.