Week 4 Modeling
Objectives
To learn how to model dynamic systems with Excel. To observe the dynamic response of the mathematical model for a system. To observe the impact of parameter values on the dynamic response. To learn how to obtain modeling results in graphical and tabular form.
See below for details on Excel software and this week's assignment.
FOR THE FUTURE
Save the results of the steady state and step response experiments. Specifically, you must save
Gain, K
to, dead time
t, (tau) first-order time constantat your chosen operating point (both for step up and step down) and the values of the steady-state input and output parameters at the operating point.
Post these results on your team's web BlackBoard File Exchange area.
Modeling SOPDT - Excel
SOPDT
If the input function to a SOPDT is a step function, having a step of A occur at time t= td,
![]()
then the time response of the SOPDT system is
where K is the gain, to is the dead-time and
t1 and t2 are the second-order time constant, or characteristic time, of the SOPDT system. The variables m(t) and c(t) in these equations are deviation variables.We want to have Excel draw a graph of these equations so we can see the effect of the various parameters.
Excel Tutorial
Open Excel by double clicking on the Excel icon.
You'll see a spreadsheet open, named Worksheet 1. We're going to enter in three columns of numbers to have Excel plot for us. The columns are "Time," "Input" and "Output." Type each of these names in the top row of the spreadsheet in columns
A, B and C, respectively. Move to the right in the spreadsheet by touching the "tab" key or using the -> key or by clicking where you want to move to.In cell
A2, enter a 0 (zero). In cell A3, enter this:=1.+A2
and then touch "return." This has put a formula in cell
A3 that adds 1.0 to the value of cell A2.We're going to put formulas in cells
B2 and C2 for the functions m(t) and c(t). For now, we're going to use values for td, A, K, to and t. Let's use 2, 3, 4, 5 and 6, respectively.Click on
B2 and put in this formula:=if(A2>2,3,0)
This says, "if the value of cell A2 is greater than 2, then this cell takes the value 3, else it takes the value 0."
Click on
C2 and put in this formula:=if(A2>2+5,3*4*(1-exp(-(A2-2-5)/6)),0)
Now click on cell
A3 and notice in the lower right corner of the cell there is a small square dot. Move your cursor to that square (your cursor will change shape into aNow, do a similar thing in column
B, dragging down to the same cell you dragged to in column A.Now, do a similar thing in column
C, dragging down to the same cell you dragged to in column A.Now do a related thing. Click in the last time-value in column
A and drag across to column C and release the mouse. All three cells should be selected. Now click on the square at the right bottom of that selection and drag it down (off the screen and it will scroll down) to a ways, maybe, say, to row 40.Now you should have 3 columns with the values in them that we want. The values in row 40 should be 38, 3 and about 11.9.
Graphing
Scroll back to the top of the spreadsheet. Highlight the three columns we want to plot by clicking on the
A at the top of column A and dragging over to the C above column C.Now click on the graphing button that looks like this: ![]()
Then answer questions posed by the Chart-Wizard. ALWAYS CHOOSE SCATTER PLOT!
Using Parameters
Go back to the spreadsheet and enter a table of the parameters that we are interested in. Let's make a table like this
|
D |
E | |
|
1 |
td= |
2 |
|
2 |
A= |
3 |
|
3 |
K= |
4 |
|
4 |
to= |
5 |
|
5 |
tau1= |
6 |
|
5 |
tau2= |
7 |
Now click on cell
E1. Pull down the Insert menu to Name -> , and choose Define and release the mouse button. That cell now is defined as having the name shown ("td"). Repeat this for cells E2 through E5.Now go back and click on cell
B2. Click next to the "2" that represents the td, delete it and type "td" (without the quotes).Do this also for the "3" in the formula. Replace with "A".
Repeat in the formula in
C2. Replacing the 2, 3, 4, 5, and 6 with the parameter names.Now, again highlight cells
B2 and C2, then drag them down to row 40, as you did before.Look at the chart. It should be the same.
Now go back to the parameter cells and change one of them and watch the graph change.
Save your Excel file. Put it in the BB/Teams/File Exchange. Send e-mail to your instructor that you have done that. You will need the file again next week.