Main

## Main.DataSimulation History

January 30, 2018, at 05:56 PM by 174.148.219.85 -
Changed lines 19-20 from:
For this exercise, you can assume that the dead-time (theta) is zero and estimate only the time constant (tau) and gain (K). The following data set was generated in class from a voltage input (u) that changed the temperature (x) of a thermistor from the [[Main/ArduinoLab|Arduino Lab]].
to:
For this exercise, you can assume that the dead-time ({\theta}) is zero and estimate only the time constant ({\tau}) and gain (''K''). The following data set was generated in class from a voltage input (''u'') that changed the temperature (''x'') of a thermistor from the [[Main/ArduinoLab|Arduino Lab]].
Changed lines 24-25 from:
Fit the dynamic data to a first order linear system by estimating ''tau'' (time constant) and ''K'' (gain). Determine the 95% and 99% confidence intervals for the parameters (see [[http://youtu.be/rL7Mvl2-XIM|F-test video tutorial]]).
to:
Fit the dynamic data to a first order linear system by estimating {\tau} (time constant) and ''K'' (gain). Determine the 95% and 99% confidence intervals for the parameters (see [[http://youtu.be/rL7Mvl2-XIM|F-test video tutorial]]).
Changed line 62 from:
with p=2 (number of parameters), n=851 (number of measurements), theta=[K,tau] (parameters), theta'^*^' as the optimal parameters, SSE as the sum of squared errors, and the F statistic that has 3 arguments (alpha=confidence level, degrees of freedom 1, and degrees of freedom 2). For many problems, this creates a multi-dimensional nonlinear confidence region. In the case of 2 parameters, the nonlinear confidence region is a 2-dimensional space.
to:
with p=2 (number of parameters), n=851 (number of measurements), {\theta}=[K,{\tau}] (parameters), {\theta^*} as the optimal parameters, SSE as the sum of squared errors, and the F statistic that has 3 arguments (alpha=confidence level, degrees of freedom 1, and degrees of freedom 2). For many problems, this creates a multi-dimensional nonlinear confidence region. In the case of 2 parameters, the nonlinear confidence region is a 2-dimensional space.
January 30, 2018, at 05:54 PM by 174.148.219.85 -
Changed line 60 from:
-> Attach:f-test_equation.gif
to:
{$\frac{SSE(\theta)-SSE(\theta^*)}{SSE(\theta^*)}\le \frac{p}{n-p} F\left(\alpha,p,n-p\right)$}
Changed line 30 from:
{$x_k = \left(x_{k-1}-x_0\right) e^{-\frac{-\Delta t}{\tau}} + \left(u_{k-1}-u_0\right)K\left(1-e^{-\frac{-\Delta t}{\tau}}\right) + x_0$}
to:
{$x_k = \left(x_{k-1}-x_0\right) e^{-\Delta t/\tau} + \left(u_{k-1}-u_0\right)K\left(1-e^{-\Delta t/\tau}\right) + x_0$}
Changed line 30 from:
{$x_k = \left(x_{k-1}-x_0\right) e^{-\frac{-\Delta t}{\tau}} + \left(u_{k-1}-u_0\right)K\left(1-e^{-\frac{-\Delta t}{\tau}}\right) + x_0} to: {$x_k = \left(x_{k-1}-x_0\right) e^{-\frac{-\Delta t}{\tau}} + \left(u_{k-1}-u_0\right)K\left(1-e^{-\frac{-\Delta t}{\tau}}\right) + x_0$} Changed lines 30-33 from: -> Attach:dynamic_discrete_eqn.gif In this equation, the subscripts denote the sampling intervals that are collected at a time interval of delta time = t'_k_'-t'_k-1_'. The above equation and the data are put into an Excel worksheet. The difference between the measured and predicted values are minimized to obtain the optimal parameters ''K'' (gain) and ''tau'' (time constant). to: {$x_k = \left(x_{k-1}-x_0\right) e^{-\frac{-\Delta t}{\tau}} + \left(u_{k-1}-u_0\right)K\left(1-e^{-\frac{-\Delta t}{\tau}}\right) + x_0}

In this equation, the subscripts denote the sampling intervals that are collected at a time interval of delta time =
t'_k_'-t'_k-1_'. The above equation and the data are put into an Excel worksheet. The difference between the measured and predicted values are minimized to obtain the optimal parameters ''K'' (gain) and {\tau} (time constant).
Changed line 45 from:
An alternative approach to the sum of squared errors is to minimize an ''l'_1_'''-norm error to find the optimal values of K (gain) and tau (time constant).
to:
An alternative approach to the sum of squared errors is to minimize an ''l'_1_'''-norm error to find the optimal values of ''K'' (gain) and {\tau} (time constant).
Changed lines 5-7 from:
Many Single Input, Single Output (SISO) dynamic systems can be represented empirically with a First Order Plus Dead Time (FOPDT) model. Model identification involves fitting parameters in a dynamic continuous or discrete form of the FOPDT model. The unknown parameters for this system include the time constant (tau), gain (K), and sometimes dead-time (theta).

-> Attach:dynamic_equation.gif
to:
Many Single Input, Single Output (SISO) dynamic systems can be represented empirically with a First Order Plus Dead Time (FOPDT) model. Model identification involves fitting parameters in a dynamic continuous or discrete form of the FOPDT model. The unknown parameters for this system include the time constant ({\tau}), gain (''K''), and sometimes dead-time ({\theta}).

{$\tau \frac{dx}{dt} = -x + K \, u\left(t-\theta\right)$}
Changed line 19 from:
For this exercise, you can assume that the dead-time (theta) is zero and estimate only the time constant (tau) and gain (K). The following data set was generated in class from a voltage input (u) that changed the temperature (x) of a thermister.
to:
For this exercise, you can assume that the dead-time (theta) is zero and estimate only the time constant (tau) and gain (K). The following data set was generated in class from a voltage input (u) that changed the temperature (x) of a thermistor from the [[Main/ArduinoLab|Arduino Lab]].
Changed line 3 from:
(:description Single Input, Single Output model identification from dynamic data.:)
to:
(:description Single Input, Single Output model identification from dynamic data with example solutions in Excel, MATLAB, and Python.:)
Changed line 3 from:
(:description Simulink (MATLAB) tutorial for adopting Differential Algebraic Equation (DAE) systems in a model for dynamic simulation, estimation, and control:)
to:
(:description Single Input, Single Output model identification from dynamic data.:)
Changed line 2 from:
(:keywords dynamic data, simulation, validation, differential, algebraic, tutorial, Simulink:)
to:
(:keywords dynamic data, model identification, validation, differential, algebraic, tutorial, Simulink:)
Changed line 5 from:
Dynamic estimation involves fitting parameters in a dynamic model. One example of an empirical model is a linear first order differential equation that can approximate the dynamic evolution of many simple systems. The unknown parameters for this system include the time constant (tau), gain (K), and sometimes dead-time (theta).
to:
Many Single Input, Single Output (SISO) dynamic systems can be represented empirically with a First Order Plus Dead Time (FOPDT) model. Model identification involves fitting parameters in a dynamic continuous or discrete form of the FOPDT model. The unknown parameters for this system include the time constant (tau), gain (K), and sometimes dead-time (theta).
Changed line 1 from:
(:title Dynamic Data Simulation:)
to:
(:title SISO Model Identification:)
May 06, 2015, at 01:27 PM by 45.56.3.184 -
Deleted lines 8-14:
For this exercise, you can assume that the dead-time (theta) is zero and estimate only the time constant (tau) and gain (K). The following data set was generated in class from a voltage input (u) that changed the temperature (x) of a thermister.

-> Attach:dynamic_data.png

Fit the dynamic data to a first order linear system by estimating ''tau'' (time constant) and ''K'' (gain). Determine the 95% and 99% confidence intervals for the parameters (see [[http://youtu.be/rL7Mvl2-XIM|F-test video tutorial]]).

Changed lines 17-24 from:
----
to:
!!!! Exercise

For this exercise, you can assume that the dead
-time (theta) is zero and estimate only the time constant (tau) and gain (K). The following data set was generated in class from a voltage input (u) that changed the temperature (x) of a thermister.

-> Attach:dynamic_data.png

Fit the dynamic data to a first order linear system by estimating ''tau'' (time constant) and ''K'' (gain). Determine the 95% and 99% confidence intervals for the parameters (see [[http://youtu.be/rL7Mvl2
-XIM|F-test video tutorial]]).
May 06, 2015, at 01:15 PM by 45.56.3.184 -

!!!! Model/Process Mismatch
May 06, 2015, at 01:11 PM by 45.56.3.184 -
Changed line 43 from:
An alternative approach to the sum of squared errors is to minimize an ''L'_1_'''-norm error to find the optimal values of K (gain) and tau (time constant).
to:
An alternative approach to the sum of squared errors is to minimize an ''l'_1_'''-norm error to find the optimal values of K (gain) and tau (time constant).
May 06, 2015, at 01:09 PM by 45.56.3.184 -

The time constant and gain may be incorrect because of system nonlinearity, bad data, or process drift over time. If the model is used in a model predictive controller, a model gain that is lower than the actual process gain may cause controller oscillation and instability. A model gain that is higher than the actual process may cause sluggish control. Likewise, a model response (time constant) that is slow (higher time constant) than the actual process time constant tends to cause controller instability. On the other hand, a model response (time constant) that is fast (lower time constant) than the actual process tends to cause sluggish controller response. This is illustrated by the following objective function plot that shows model predictive control performance with model mismatch to the process.

Attach:mpc_model_mismatch_K_tau.png

The combination of a low gain and high time constant leads to the highest objective function (poor performance and instability). On the other hand, a high gain and low time constant lead to sluggish control but the controller is able to asymptotically drive the process to the correct set point.
April 30, 2015, at 11:06 PM by 45.56.3.184 -
Changed line 11 from:
to:
Changed line 26 from:
to:
Changed line 39 from:
to:
Changed line 42 from:
The MATLAB and Python plots produce trends that show the optimal solution with an ''L'_1_'''-norm objective function.
to:
The MATLAB and Python plots produce trends that show the optimal solution with an ''l'_1_'''-norm objective function.
April 30, 2015, at 10:58 PM by 45.56.3.184 -

Dynamic estimation involves fitting parameters in a dynamic model. One example of an empirical model is a linear first order differential equation that can approximate the dynamic evolution of many simple systems. The unknown parameters for this system include the time constant (tau), gain (K), and sometimes dead-time (theta).

-> Attach:dynamic_equation.gif

For this exercise, you can assume that the dead-time (theta) is zero and estimate only the time constant (tau) and gain (K). The following data set was generated in class from a voltage input (u) that changed the temperature (x) of a thermister.

-> Attach:dynamic_data.png

Fit the dynamic data to a first order linear system by estimating ''tau'' (time constant) and ''K'' (gain). Determine the 95% and 99% confidence intervals for the parameters (see [[http://youtu.be/rL7Mvl2-XIM|F-test video tutorial]]).

----

!!!! Excel Solution

The dynamic model can be written in discrete form by specifying that the voltage is constant between sampling intervals. The discrete form of the equation accounts for non-zero initial conditions in temperature (''x'_0_''') and voltage (''u'_0_'''). In this case, the voltage does start at zero, but this is not required.

-> Attach:dynamic_discrete_eqn.gif

In this equation, the subscripts denote the sampling intervals that are collected at a time interval of delta time = t'_k_'-t'_k-1_'. The above equation and the data are put into an Excel worksheet. The difference between the measured and predicted values are minimized to obtain the optimal parameters ''K'' (gain) and ''tau'' (time constant).

-> Attach:dynamic_excel.png

The spreadsheet is currently showing non-optimal values. To obtain the optimal values, use Excel Solver available from the Data toolbar. If the solver option does not appear, it can be added with the Add-In manager.

-> Attach:dynamic_solver.png

----

!!!! MATLAB and Python Solutions

An alternative approach to the sum of squared errors is to minimize an ''L'_1_'''-norm error to find the optimal values of K (gain) and tau (time constant).

-> Attach:dynamic_solution_files.png

The MATLAB and Python plots produce trends that show the optimal solution with an ''L'_1_'''-norm objective function.

-> Attach:dynamic_solution_plot.png

The nonlinear confidence interval is shown by producing a contour plot of the SSE objective function with variations in the two parameters. The optimal solution is shown at the center of the plot and the objective function becomes worse (higher) away from the optimal solution.

-> Attach:dynamic_solution_contour.png

The confidence interval is determined with an F-test that specifies an upper limit to the deviation from the optimal solution

-> Attach:f-test_equation.gif

with p=2 (number of parameters), n=851 (number of measurements), theta=[K,tau] (parameters), theta'^*^' as the optimal parameters, SSE as the sum of squared errors, and the F statistic that has 3 arguments (alpha=confidence level, degrees of freedom 1, and degrees of freedom 2). For many problems, this creates a multi-dimensional nonlinear confidence region. In the case of 2 parameters, the nonlinear confidence region is a 2-dimensional space.