Introduction to Optimization

Size: px
Start display at page:

Download "Introduction to Optimization"

Transcription

1 Introduction to Optimization The maximizing or minimizing of a given function subject to some type of constraints. Make your processes as effective as possible. In a typical chemical plant, there are many control variables for controlling the process, such as maintaining a temperature, level, or flow.

2 Part 1: Process Control and Control has to do with adjusting flow rates to maintain the controlled variables of the process at specified set-points. Optimization chooses the values for key set-points such that the process operates at the best economic conditions. Optimization What is optimal operation temperature?

3 Economic Objective Function V B > V C, V A, or V AF V is the chemical values. At low T, little formation of B; At high T, too much of B reacts to form C; Therefore, the exits an optimum reactor temperature, T* QCAVA QCB VB QCC VC QCA0 V AF Graphical Solution of Optimum Reactor Temperature, T* k1(t) k2(t) A B C

4 Use of fmincon in MATLAB for process optimization ceq, and c describes the nonlinear equalities/inequalities among parameters A and b describes the linear inequalities among parameters Aeq and beq describes the linear equalities among parameters X = fmincon(fun, X0, A, B, Aeq, Beq, lb, ub) defines a set of lower and upper bounds on the design variables, X, so that a solution is found in the range LB <= X <= UB. Use empty matrices for LB and UB if no bounds exist. [x fval] = fmincon(fun,x0,a,b,aeq,beq,lb,ub,nonlcon,options) Estimated parameters Errors of predicted and observed results Function that you want to minimize, i.e. the error Initial guess of the parameters Boundaries of the parameters Choose the right solver The function NONLCON accepts X and returns the vectors C and Ceq, representing the nonlinear inequalities and equalities respectively.

5 Example 1 Find values of x that minimize starting at the point x = [10; 10; 10] and subject to the constraints X = fmincon(fun, X0, A, B, Aeq, Beq, lb, ub) minimizes FUN subject to the linear equalities Aeq*X = Beq as well as A*X <= B. (Set A=[] and B=[] if no inequalities exist.)

6 Use fmincon for optimization %file name example1 clc;close all;clear all; int_guess=[10;10;10];% INITIAL GUESS FOR U'S A=[ ;1 2 2]; % linear inequalities constraints B=[0 72]; [u]=fmincon(@eg_1,int_guess,a,b) % CALL FOR OPTIMIZER %file name eg_1.m function [err]=eg_1(u) x1=u(1); x2=u(2); x3=u(3); err=-x1*x2*x3;

7 Example 2 (dynamic optimization) Consider the batch reactor with following reaction A B C Find the temperature, at which the product B is maximum Mathematical Representation of the system is as :

8 clc;close all;clear all; warning off int_guess=300;% INITIAL GUESS FOR U'S LB=298; % LOWER BOUND OF U UB=398;% UPPER BOUND ON U [u,fval]=fmincon(@reactor_problem,int_guess,[],[],[],[],lb,ub,[]); % CALL FOR OPTIMIZER PROBABLY NOT TO CHANGE BE USER [err]=reactor_problem(u); load data_for_system plot(t,y(:,1),'k') hold on plot(t,y(:,2),'m') legend('opt c_a','opt c_b') u opt c A opt c B 0.2 T=

9 Call ODE to solve the model ode45 slot, init, [opt], [par1, par2,...]) Maximize B function [err]=reactor_problem(u) A=[1 0]; %initial condition [t,y]=ode15s(@reactor_ode,[0 1],A,[],u); %tspan=1 err=-y(end,2); %make the maximum B save data_for_system t Y %just for plotting function [YPRIME]=reactor_ODE(t,x,u) YPRIME=zeros(2,1); T=u; k1=4000*exp(-2500/t); k2=620000*exp(-5000/t); YPRIME(1)=-k1*(x(1))^2; YPRIME(2)=(k1*x(1)^2)-k2*x(2); ODE calculation

10 Part 2: Inverse problem (from experimental data to model construction) Parameter fitting for dynamic model

11 An example for parameter fitting of dynamic bioprocess model

12 A) Nonlinear Parameter Estimation via fmincon in MATLAB References (e.g. literature) Mathematic Model References (e.g. literature) Mathematic Model v.s. Known Parameters Unknown Parameters Simulated Results Parameter estimation Simulated Results v.s. ε Forward problem Experimental Results Inverse problem Experimental Results

13 Nonlinear Parameter Estimation 1. Parameter estimation for linear systems y = A x + b y, x are the vector of dependent and independent variables, A, b are parameters to be estimated regress command in MATLAB (for linear model) 2. Parameter estimation for nonlinear systems y = f (parameters, x) f is the nonlinear function of the estimated parameters For example, y=β 1 +β 2 sin(β 3 t) cftool box for more complicated model equations 3. Parameter estimation for dynamic ode models ( fmincon, nlinfit, etc. in MATLAB)

14 Example 1: parameter estimation in bioengineering Bioreactor model dx dt dp dt ds dt X Y K P / X 1 Y max S X / S S S X X X Five parameters to be estimated: Y P/X, Y X/S, µ max, K s, and S(0) Initial conditions: X(0) = 0.05 g/l; P(0) = 0 g/l; Experimental data t X P S We will use fmincon to find the parameters

15 function [error,ypred] = reactor_model(beta) The Error Function global yobs global t %reactor model S0=beta(5); y0=[ S0]; tspan=t; %we want y at every t [t,y]=ode45(@ff,tspan,y0); function dy = ff(t,y) %function that computes the dydt umax=beta(1); Ks=beta(2); Ypx=beta(3); Yxs=beta(4); X=y(1); P=y(2); S=y(3); u=umax.*s./(ks+s); dy(1)=u.*x; dy(2)=ypx.*u.*x; dy(3)=-1/yxs.*u.*x-u.*x; dy=dy'; end y1=y(:,1); y2=y(:,2); y3=y(:,3); ypred=[y1; y2; y3]; error=sum((ypred-yobs).^2); end Input the observed data Settings to run ODEs The ODEs that describe bioreactor behaviors Calculate the error

16 The fmincon Function %Use fmincon to find the parameters in reactor model clear clc data =xlsread('reactor_model_data.xlsx'); t=data(:,1); X=data(:,2); P=data(:,3); S=data(:,4); x=t; Read data from Excel global yobs global t yobs=[x;p;s]; umax=0.1; Ks=10; Ypx=0.11; Yxs=0.45; S0=14.86; beta0(1)=umax; %initial guess beta0(2)=ks; %initial guess beta0(3)=ypx; %initial guess beta0(4)=yxs; %initial guess beta0(5)=s0; %initial guess Set up the initial guess of parameters

17 %fmincon A=[]; b=[]; Aeq=[]; beq=[]; lb=zeros(5,1); ub=lb+20; nonlcon=[]; x0=beta0;%lb+rand.*(ub-lb); options=optimset('algorithm','interior-point'); The fmincon Function (continued) Q: How to find the global solution? [param, fval] = fmincon(fun,x0,a,b,aeq,beq,lb,ub,nonlcon,options) Settings to run fmincon %get the predicted resutls [error,ypred]=reactor_model(param); n=length(t); Xpred=ypred(1:n); Ppred=ypred(n+1:2*n); Spred=ypred(2*n+1:3*n); A: Randomly perturb the initial guess Run the model again to get the predicted results figure(1) set(gca, 'fontsize',14,'fontweight','bold'); hold on plot(x,xpred,'-r','linewidth',2.5); plot(x,ppred,'-g','linewidth',2.5) plot(x,spred,'-b','linewidth',2.5) plot(x,x,'r+','markersize',10); plot(x,p,'go','markersize',10) plot(x,s,'bx','markersize',10) xlabel('time') ylabel('y') legend('x g/l','p g/l','s g/l') Plot the predicted v.s. observed results

18 Parameters Estimated via fmincon param = fval = µmax = (1/h) Ks = (g/l) Ypx = (g/g) Yxs = (g/g) S0 = (g/l)

19 Estimating confidence intervals of parameters via fmincon Which one makes sense? Numbers in the brackets are the 95% confidence interval of µmax µmax = [ ] (1/h) Or µmax = [ ] (1/h) Estimation of µmax is reliable µmax cannot be accurately estimated How to estimate the confidence intervals of parameters? bootstrap method: randomly resample the experimental observations; and for each new set of sampled experimental observations, use fmincon to find a new set of parameters. Monte Carlo method: randomly perturb the experimental observations within the measurement errors (i.e. standard derivation); and for each new set of perturbed experimental observations, use fmincon to find a new set of parameters.

20 B: Parameter fitting using nlinfit Unlike forward problems, inverse problems require experimental data, and an iterative solution. Because inverse problems require solving the forward problem numerous time, the ode45 solver will be nested within a nonlinear regression routine called nlinfit. The syntax is: [param, r, J, COVB, mse] = nlinfit(x, y, fun, beta0); returns the fitted coefficients param, the residuals r, the Jacobian J of function fun, the estimated covariance matrix COVB for the fitted coefficients, and an estimate MSE of the variance of the error term. X is a matrix of n rows of the independent variable y is n-by-1 vector of the observed data fun is a function handle to a separate m-file to a function of this form: yhat = fun(b,x) where yhat is an n-by-1 vector of the predicted responses, and b is a vector of the parameter values. beta0 is the initial guesses of the parameters.

21 y Example 1: Model fitting ODE equation dy k y dt data =xlsread('exp_data.xls'); %read data from excel yo=100; k=0.6; beta0(1)=yo; beta0(2)=k; ypred yobs Based on experimental data, find y0 and k time (min) x=data(:,1); yobs=data(:,2); [param,resids,j,covb,mse] = nlinfit(x,yobs,'forderinv',beta0); rmse=sqrt(mse); %root mean square error = SS/(n-p) %R is the correlation matrix for the parameters, sigma is the standard error vector [R,sigma]=corrcov(COVB); %confidence intervals for parameters ci=nlparci(param,resids,j); %computed Cpredicted by solving ode45 once with the estimated parameters ypred=forderinv(param,x); %mean of the residuals meanr=mean(resids);

22 Redisuals: the residual of an observed value is the difference between the observed value and the estimated function value. The Jacobian determinant carries important information about the local behavior of F. The root-mean-square error (RMSE) is a measure of the differences between value (Sample and population values) predicted by a model or an estimator and the values actually observed. The covariance matrix generalizes the notion of variance to multiple dimensions. R = corrcov(c) computes the correlation matrix R that corresponds to the covariance matrix C. [R,sigma]=corrcov(COVB); nlparci : The confidence interval calculation is valid when the length of RESID exceeds the length of BETA, and J has full column rank. When J is ill-conditioned, confidence intervals may be inaccurate.

23 figure hold on h1(1)=plot(x,ypred,'-','linewidth',3); %predicted y values h1(2)=plot(x,yobs,'square', 'Markerfacecolor', 'r'); legend(h1,'ypred','yobs') xlabel('time (min)') ylabel('y') %residual scatter plot figure hold on plot(x, resids, 'square','markerfacecolor', 'b'); YLine = [0 0]; XLine = [0 max(x)]; plot (XLine, YLine,'R'); %plot a straight red line at zero ylabel('observed y - Predicted y') xlabel('time (min) ) Function with ode45 function y = forderinv(param,t) %first-order reaction equation tspan=t; %we want y at every t [t,y]=ode45(@ff, tspan, param(1)); %param(1) is y(0) function dy = ff(t, y) %function that computes the dydt dy(1)= -param(2)*y(1); end end

24 Observed y - Predicted y y time (min) ypred yobs One ODE time (min) Time y Raw data File name: exp_data.xls Time y

25 y Example 2: Three ODES for batch fermentation 15 S 10 /s 5 X P Yp/s=Yx/s*Yp/x time (min)

26 Three ODEs parameter fitting File name: HW217.xls t X P S

27 Fitting four parameters Script clear all %clear all variables global y0 data =xlsread('hw217.xls'); %initial conditions y0=[ ]; %initial guess Umax=0.1; Ks=10; Ypx=0.11; Yxs=0.45; beta0(1)=umax; beta0(2)=ks; beta0(3)=ypx; beta0(4)=yxs; %Measured data x=data(:,1); yobsx=data(:,2); yobsp=data(:,3); yobss=data(:,4); yobs=[yobsx; yobsp; yobss]; %nlinfit returns parameters, residuals, Jacobian (sensitivity coefficient matrix), %covariance matrix, and mean square error. ode45 is solved many times %iteratively [param,resids,j,covb,mse] = nlinfit(x, yobs,'forderinv2', beta0);

28 rmse=sqrt(mse); %root mean square error = SS/(n-p) n=size(x); nn=n(1); %confidence intervals for parameters ci=nlparci(param,resids,j); %computed Cpredicted by solving ode45 once with the estimated parameters ypred=forderinv2(param,x); ypredx=ypred(1:nn); ypredp=ypred(nn+1:2*nn); ypreds=ypred(2*nn+1:3*nn); %mean of the residuals meanr=mean(resids); Script

29 Script figure hold on plot(x, ypredx, x, ypredp, x, ypreds); %predicted y values plot(x, yobsx, 'r+', x, yobsp, 'ro', x, yobss, 'rx'); xlabel('time (min)') ylabel('y') %residual scatter plot x3=[x; x; x]; figure hold on plot(x3, resids, 'square', 'Markerfacecolor', 'b'); YLine = [0 0]; XLine = [0 max(x)]; plot (XLine, YLine,'R'); %plot a straight red line at zero ylabel('observed y - Predicted y') xlabel('time (min) )

30 function y = forderinv2(param,t) %first-order reaction equation global y0; tspan=t; %we want y at every t [t,y]=ode45(@ff,tspan,y0); %param(1) is y(0) function dy = ff(t,y) %function that computes the dydt dy(1)= param(1)*y(3)/(param(2)+y(3))*y(1); %biomass dy(2)= param(1)*param(3)*y(3)/(param(2)+y(3))*y(1); %product dy(3)= -1/param(4)*dy(1)-1/(param(3)*param(4))*dy(2); %substrate dy=dy'; end % after the ode45, rearrange the n-by-3 y matrix into a 3n-by-1 matrix % and send that back to nlinfit. y1=y(:,1); y2=y(:,2); y3=y(:,3); y=[y1; y2; y3]; end Function and sub-function

Data Assimilation. Matylda Jab lońska. University of Dar es Salaam, June Laboratory of Applied Mathematics Lappeenranta University of Technology

Data Assimilation. Matylda Jab lońska. University of Dar es Salaam, June Laboratory of Applied Mathematics Lappeenranta University of Technology Laboratory of Applied Mathematics Lappeenranta University of Technology University of Dar es Salaam, June 2013 Overview 1 Empirical modelling 2 Overview Empirical modelling Experimental plans for various

More information

Nonlinear Regression. Chapter 2 of Bates and Watts. Dave Campbell 2009

Nonlinear Regression. Chapter 2 of Bates and Watts. Dave Campbell 2009 Nonlinear Regression Chapter 2 of Bates and Watts Dave Campbell 2009 So far we ve considered linear models Here the expectation surface is a plane spanning a subspace of the observation space. Our expectation

More information

A First Course on Kinetics and Reaction Engineering Supplemental Unit S4. Numerically Fitting Models to Data

A First Course on Kinetics and Reaction Engineering Supplemental Unit S4. Numerically Fitting Models to Data Supplemental Unit S4. Numerically Fitting Models to Data Defining the Problem Many software routines for fitting a model to experimental data can only be used when the model is of a pre-defined mathematical

More information

CHAPTER 2: QUADRATIC PROGRAMMING

CHAPTER 2: QUADRATIC PROGRAMMING CHAPTER 2: QUADRATIC PROGRAMMING Overview Quadratic programming (QP) problems are characterized by objective functions that are quadratic in the design variables, and linear constraints. In this sense,

More information

SplineLinear.doc 1 # 9 Last save: Saturday, 9. December 2006

SplineLinear.doc 1 # 9 Last save: Saturday, 9. December 2006 SplineLinear.doc 1 # 9 Problem:... 2 Objective... 2 Reformulate... 2 Wording... 2 Simulating an example... 3 SPSS 13... 4 Substituting the indicator function... 4 SPSS-Syntax... 4 Remark... 4 Result...

More information

Terminal velocity of solid particles in the fluid can be determined from;

Terminal velocity of solid particles in the fluid can be determined from; 1 Numerical calculation using Matlab 1 Terminal velocity of solid particles in the fluid can be determined from; 4g( ρ p ρ) D p ut = 3C D ρ u t = terminal velocity, D p = particle size, ρ p = particle

More information

Finite Difference Methods for Boundary Value Problems

Finite Difference Methods for Boundary Value Problems Finite Difference Methods for Boundary Value Problems October 2, 2013 () Finite Differences October 2, 2013 1 / 52 Goals Learn steps to approximate BVPs using the Finite Difference Method Start with two-point

More information

AMS 27L LAB #8 Winter 2009

AMS 27L LAB #8 Winter 2009 AMS 27L LAB #8 Winter 29 Solving ODE s in Matlab Objectives:. To use Matlab s ODE Solvers 2. To practice using functions and in-line functions Matlab s ODE Suite Matlab offers a suite of ODE solvers including:

More information

Math 240 Calculus III

Math 240 Calculus III Calculus III Summer 2015, Session II Monday, August 3, 2015 Agenda 1. 2. Introduction The reduction of technique, which applies to second- linear differential equations, allows us to go beyond equations

More information

SECTION 7: CURVE FITTING. MAE 4020/5020 Numerical Methods with MATLAB

SECTION 7: CURVE FITTING. MAE 4020/5020 Numerical Methods with MATLAB SECTION 7: CURVE FITTING MAE 4020/5020 Numerical Methods with MATLAB 2 Introduction Curve Fitting 3 Often have data,, that is a function of some independent variable,, but the underlying relationship is

More information

assumes a linear relationship between mean of Y and the X s with additive normal errors the errors are assumed to be a sample from N(0, σ 2 )

assumes a linear relationship between mean of Y and the X s with additive normal errors the errors are assumed to be a sample from N(0, σ 2 ) Multiple Linear Regression is used to relate a continuous response (or dependent) variable Y to several explanatory (or independent) (or predictor) variables X 1, X 2,, X k assumes a linear relationship

More information

Chapter #4 EEE8086-EEE8115. Robust and Adaptive Control Systems

Chapter #4 EEE8086-EEE8115. Robust and Adaptive Control Systems Chapter #4 Robust and Adaptive Control Systems Nonlinear Dynamics.... Linear Combination.... Equilibrium points... 3 3. Linearisation... 5 4. Limit cycles... 3 5. Bifurcations... 4 6. Stability... 6 7.

More information

Minimizing & Maximizing Functions

Minimizing & Maximizing Functions Minimizing & Maximizing Functions Nonlinear functions may have zero to many minima and maxima. Example: find the minimum of y = 3x 2 2x + 1 Minima & maxima occur in functions where the slope changes sign

More information

A First Course on Kinetics and Reaction Engineering Example S3.1

A First Course on Kinetics and Reaction Engineering Example S3.1 Example S3.1 Problem Purpose This example shows how to use the MATLAB script file, FitLinSR.m, to fit a linear model to experimental data. Problem Statement Assume that in the course of solving a kinetics

More information

Deterministic Dynamic Programming

Deterministic Dynamic Programming Deterministic Dynamic Programming 1 Value Function Consider the following optimal control problem in Mayer s form: V (t 0, x 0 ) = inf u U J(t 1, x(t 1 )) (1) subject to ẋ(t) = f(t, x(t), u(t)), x(t 0

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP 2. Use MATLAB solvers for solving higher order ODEs and

More information

CHAPTER 6 STATE SPACE: FREQUENCY RESPONSE, TIME DOMAIN

CHAPTER 6 STATE SPACE: FREQUENCY RESPONSE, TIME DOMAIN CHAPTER 6 STATE SPACE: FREQUENCY RESPONSE, TIME DOMAIN 6. Introduction Frequency Response This chapter will begin with the state space form of the equations of motion. We will use Laplace transforms to

More information

Two-Stage Stochastic and Deterministic Optimization

Two-Stage Stochastic and Deterministic Optimization Two-Stage Stochastic and Deterministic Optimization Tim Rzesnitzek, Dr. Heiner Müllerschön, Dr. Frank C. Günther, Michal Wozniak Abstract The purpose of this paper is to explore some interesting aspects

More information

A First Course on Kinetics and Reaction Engineering Example 13.2

A First Course on Kinetics and Reaction Engineering Example 13.2 Example 13. Problem Purpose This example illustrates the analysis of kinetics data from a CSTR where the rate expression must be linearized. Problem Statement A new enzyme has been found for the dehydration

More information

Physics 584 Computational Methods

Physics 584 Computational Methods Physics 584 Computational Methods Introduction to Matlab and Numerical Solutions to Ordinary Differential Equations Ryan Ogliore April 18 th, 2016 Lecture Outline Introduction to Matlab Numerical Solutions

More information

Chapter 9b: Numerical Methods for Calculus and Differential Equations. Initial-Value Problems Euler Method Time-Step Independence MATLAB ODE Solvers

Chapter 9b: Numerical Methods for Calculus and Differential Equations. Initial-Value Problems Euler Method Time-Step Independence MATLAB ODE Solvers Chapter 9b: Numerical Methods for Calculus and Differential Equations Initial-Value Problems Euler Method Time-Step Independence MATLAB ODE Solvers Acceleration Initial-Value Problems Consider a skydiver

More information

MAS223 Statistical Inference and Modelling Exercises

MAS223 Statistical Inference and Modelling Exercises MAS223 Statistical Inference and Modelling Exercises The exercises are grouped into sections, corresponding to chapters of the lecture notes Within each section exercises are divided into warm-up questions,

More information

Variance. Standard deviation VAR = = value. Unbiased SD = SD = 10/23/2011. Functional Connectivity Correlation and Regression.

Variance. Standard deviation VAR = = value. Unbiased SD = SD = 10/23/2011. Functional Connectivity Correlation and Regression. 10/3/011 Functional Connectivity Correlation and Regression Variance VAR = Standard deviation Standard deviation SD = Unbiased SD = 1 10/3/011 Standard error Confidence interval SE = CI = = t value for

More information

Uncertainty Propagation

Uncertainty Propagation Setting: Uncertainty Propagation We assume that we have determined distributions for parameters e.g., Bayesian inference, prior experiments, expert opinion Ṫ 1 = 1 - d 1 T 1 - (1 - ")k 1 VT 1 Ṫ 2 = 2 -

More information

Lecture 2: From Linear Regression to Kalman Filter and Beyond

Lecture 2: From Linear Regression to Kalman Filter and Beyond Lecture 2: From Linear Regression to Kalman Filter and Beyond January 18, 2017 Contents 1 Batch and Recursive Estimation 2 Towards Bayesian Filtering 3 Kalman Filter and Bayesian Filtering and Smoothing

More information

Deterministic Global Optimization Algorithm and Nonlinear Dynamics

Deterministic Global Optimization Algorithm and Nonlinear Dynamics Deterministic Global Optimization Algorithm and Nonlinear Dynamics C. S. Adjiman and I. Papamichail Centre for Process Systems Engineering Department of Chemical Engineering and Chemical Technology Imperial

More information

Chemical Reaction Engineering - Part 8 - more data analysis Richard K. Herz,

Chemical Reaction Engineering - Part 8 - more data analysis Richard K. Herz, Chemical Reaction Engineering - Part 8 - more data analysis Richard K. Herz, rherz@ucsd.edu, www.reactorlab.net Gases reacting - using change in pressure or volume When we have gases reacting, we may be

More information

Introduction to System Dynamics

Introduction to System Dynamics SE1 Prof. Davide Manca Politecnico di Milano Dynamics and Control of Chemical Processes Solution to Lab #1 Introduction to System Dynamics Davide Manca Dynamics and Control of Chemical Processes Master

More information

A First Course on Kinetics and Reaction Engineering Example 13.3

A First Course on Kinetics and Reaction Engineering Example 13.3 Example 13.3 Problem Purpose This example illustrates the analysis of CSTR data using linear least squares for a situation where there are two independent variables in the model being fit to the data.

More information

Applied Computational Economics Workshop. Part 3: Nonlinear Equations

Applied Computational Economics Workshop. Part 3: Nonlinear Equations Applied Computational Economics Workshop Part 3: Nonlinear Equations 1 Overview Introduction Function iteration Newton s method Quasi-Newton methods Practical example Practical issues 2 Introduction Nonlinear

More information

Pursuit Curves. Molly Severdia May 16, 2008

Pursuit Curves. Molly Severdia May 16, 2008 Pursuit Curves Molly Severdia May 16, 2008 Abstract This paper will discuss the differential equations which describe curves of pure pursuit, in which the pursuer s velocity vector is always pointing directly

More information

Excel for Scientists and Engineers Numerical Method s. E. Joseph Billo

Excel for Scientists and Engineers Numerical Method s. E. Joseph Billo Excel for Scientists and Engineers Numerical Method s E. Joseph Billo Detailed Table of Contents Preface Acknowledgments About the Author Chapter 1 Introducing Visual Basic for Applications 1 Chapter

More information

CHEM-E3205 BIOPROCESS OPTIMIZATION AND SIMULATION

CHEM-E3205 BIOPROCESS OPTIMIZATION AND SIMULATION CHEM-E3205 BIOPROCESS OPTIMIZATION AND SIMULATION TERO EERIKÄINEN ROOM D416d tero.eerikainen@aalto.fi COURSE LECTURES AND EXERCISES Week Day Date Time Place Lectures/Execises 37 Mo 12.9.2016 10:15-11:45

More information

Homework #2 Due Monday, April 18, 2012

Homework #2 Due Monday, April 18, 2012 12.540 Homework #2 Due Monday, April 18, 2012 Matlab solution codes are given in HW02_2012.m This code uses cells and contains the solutions to all the questions. Question 1: Non-linear estimation problem

More information

How to simulate in Simulink: DAE, DAE-EKF, MPC & MHE

How to simulate in Simulink: DAE, DAE-EKF, MPC & MHE How to simulate in Simulink: DAE, DAE-EKF, MPC & MHE Tamal Das PhD Candidate IKP, NTNU 24th May 2017 Outline 1 Differential algebraic equations (DAE) 2 Extended Kalman filter (EKF) for DAE 3 Moving horizon

More information

MATH 312 Section 8.3: Non-homogeneous Systems

MATH 312 Section 8.3: Non-homogeneous Systems MATH 32 Section 8.3: Non-homogeneous Systems Prof. Jonathan Duncan Walla Walla College Spring Quarter, 2007 Outline Undetermined Coefficients 2 Variation of Parameter 3 Conclusions Undetermined Coefficients

More information

Matlab Controller Design. 1. Control system toolbox 2. Functions for model analysis 3. Linear system simulation 4. Biochemical reactor linearization

Matlab Controller Design. 1. Control system toolbox 2. Functions for model analysis 3. Linear system simulation 4. Biochemical reactor linearization Matlab Controller Design. Control system toolbox 2. Functions for model analysis 3. Linear system simulation 4. Biochemical reactor linearization Control System Toolbox Provides algorithms and tools for

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MATLAB sessions: Laboratory 4 MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP 2. Use MATLAB solvers for

More information

Essential of Simple regression

Essential of Simple regression Essential of Simple regression We use simple regression when we are interested in the relationship between two variables (e.g., x is class size, and y is student s GPA). For simplicity we assume the relationship

More information

Lecture 8: Calculus and Differential Equations

Lecture 8: Calculus and Differential Equations Lecture 8: Calculus and Differential Equations Dr. Mohammed Hawa Electrical Engineering Department University of Jordan EE201: Computer Applications. See Textbook Chapter 9. Numerical Methods MATLAB provides

More information

Lecture 8: Calculus and Differential Equations

Lecture 8: Calculus and Differential Equations Lecture 8: Calculus and Differential Equations Dr. Mohammed Hawa Electrical Engineering Department University of Jordan EE21: Computer Applications. See Textbook Chapter 9. Numerical Methods MATLAB provides

More information

Solutions - Homework #2

Solutions - Homework #2 Solutions - Homework #2 1. Problem 1: Biological Recovery (a) A scatterplot of the biological recovery percentages versus time is given to the right. In viewing this plot, there is negative, slightly nonlinear

More information

HOMEWORK 3: Phase portraits for Mathmatical Models, Analysis and Simulation, Fall 2010 Report due Mon Oct 4, Maximum score 7.0 pts.

HOMEWORK 3: Phase portraits for Mathmatical Models, Analysis and Simulation, Fall 2010 Report due Mon Oct 4, Maximum score 7.0 pts. HOMEWORK 3: Phase portraits for Mathmatical Models, Analysis and Simulation, Fall 2010 Report due Mon Oct 4, 2010. Maximum score 7.0 pts. Three problems are to be solved in this homework assignment. The

More information

Bootstrapping, Randomization, 2B-PLS

Bootstrapping, Randomization, 2B-PLS Bootstrapping, Randomization, 2B-PLS Statistics, Tests, and Bootstrapping Statistic a measure that summarizes some feature of a set of data (e.g., mean, standard deviation, skew, coefficient of variation,

More information

Gaussian processes. Chuong B. Do (updated by Honglak Lee) November 22, 2008

Gaussian processes. Chuong B. Do (updated by Honglak Lee) November 22, 2008 Gaussian processes Chuong B Do (updated by Honglak Lee) November 22, 2008 Many of the classical machine learning algorithms that we talked about during the first half of this course fit the following pattern:

More information

MB4018 Differential equations

MB4018 Differential equations MB4018 Differential equations Part II http://www.staff.ul.ie/natalia/mb4018.html Prof. Natalia Kopteva Spring 2015 MB4018 (Spring 2015) Differential equations Part II 0 / 69 Section 1 Second-Order Linear

More information

Lab 13: Ordinary Differential Equations

Lab 13: Ordinary Differential Equations EGR 53L - Fall 2009 Lab 13: Ordinary Differential Equations 13.1 Introduction This lab is aimed at introducing techniques for solving initial-value problems involving ordinary differential equations using

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MAT 75 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP. Use MATLAB solvers for solving higher order ODEs and systems

More information

OWELL WEEKLY JOURNAL

OWELL WEEKLY JOURNAL Y \»< - } Y Y Y & #»»» q ] q»»»>) & - - - } ) x ( - { Y» & ( x - (» & )< - Y X - & Q Q» 3 - x Q Y 6 \Y > Y Y X 3 3-9 33 x - - / - -»- --

More information

NUMERICAL METHODS. lor CHEMICAL ENGINEERS. Using Excel', VBA, and MATLAB* VICTOR J. LAW. CRC Press. Taylor & Francis Group

NUMERICAL METHODS. lor CHEMICAL ENGINEERS. Using Excel', VBA, and MATLAB* VICTOR J. LAW. CRC Press. Taylor & Francis Group NUMERICAL METHODS lor CHEMICAL ENGINEERS Using Excel', VBA, and MATLAB* VICTOR J. LAW CRC Press Taylor & Francis Group Boca Raton London New York CRC Press is an imprint of the Taylor & Francis Croup,

More information

9. Introduction and Chapter Objectives

9. Introduction and Chapter Objectives Real Analog - Circuits 1 Chapter 9: Introduction to State Variable Models 9. Introduction and Chapter Objectives In our analysis approach of dynamic systems so far, we have defined variables which describe

More information

Univariate analysis. Simple and Multiple Regression. Univariate analysis. Simple Regression How best to summarise the data?

Univariate analysis. Simple and Multiple Regression. Univariate analysis. Simple Regression How best to summarise the data? Univariate analysis Example - linear regression equation: y = ax + c Least squares criteria ( yobs ycalc ) = yobs ( ax + c) = minimum Simple and + = xa xc xy xa + nc = y Solve for a and c Univariate analysis

More information

ENGM 670 & MECE 758 Modeling and Simulation of Engineering Systems (Advanced Topics) Winter 2011 Lecture 10: Extra Material M.G. Lipsett University of Alberta http://www.ualberta.ca/~mlipsett/engm541/engm541.htm

More information

Dynamic Systems: Ordinary Differential Equations. Ordinary Differential Equations

Dynamic Systems: Ordinary Differential Equations. Ordinary Differential Equations Dynamic Systems: Ordinary Differential Equations Adapted From: Numerical Methods in Biomedical Engineering Stanley M. Dunn, Alkis Constantinides, Prabhas V. Moghe Chapter 7 Kim Ferlin and John Fisher Ordinary

More information

Consider the joint probability, P(x,y), shown as the contours in the figure above. P(x) is given by the integral of P(x,y) over all values of y.

Consider the joint probability, P(x,y), shown as the contours in the figure above. P(x) is given by the integral of P(x,y) over all values of y. ATMO/OPTI 656b Spring 009 Bayesian Retrievals Note: This follows the discussion in Chapter of Rogers (000) As we have seen, the problem with the nadir viewing emission measurements is they do not contain

More information

Mathematics Revision Guide. Algebra. Grade C B

Mathematics Revision Guide. Algebra. Grade C B Mathematics Revision Guide Algebra Grade C B 1 y 5 x y 4 = y 9 Add powers a 3 a 4.. (1) y 10 y 7 = y 3 (y 5 ) 3 = y 15 Subtract powers Multiply powers x 4 x 9...(1) (q 3 ) 4...(1) Keep numbers without

More information

Chapter 5 Joint Probability Distributions

Chapter 5 Joint Probability Distributions Applied Statistics and Probability for Engineers Sixth Edition Douglas C. Montgomery George C. Runger Chapter 5 Joint Probability Distributions 5 Joint Probability Distributions CHAPTER OUTLINE 5-1 Two

More information

SV6: Polynomial Regression and Neural Networks

SV6: Polynomial Regression and Neural Networks Signal and Information Processing Laboratory Institut für Signal- und Informationsverarbeitung Fachpraktikum Signalverarbeitung SV6: Polynomial Regression and Neural Networks 1 Introduction Consider the

More information

Sequential and reinforcement learning: Stochastic Optimization I

Sequential and reinforcement learning: Stochastic Optimization I 1 Sequential and reinforcement learning: Stochastic Optimization I Sequential and reinforcement learning: Stochastic Optimization I Summary This session describes the important and nowadays framework of

More information

Least squares problems

Least squares problems Least squares problems How to state and solve them, then evaluate their solutions Stéphane Mottelet Université de Technologie de Compiègne 30 septembre 2016 Stéphane Mottelet (UTC) Least squares 1 / 55

More information

(6.2) -The Shooting Method for Nonlinear Problems

(6.2) -The Shooting Method for Nonlinear Problems (6.2) -The Shooting Method for Nonlinear Problems Consider the boundary value problems (BVPs) for the second order differential equation of the form (*) y f x,y,y, a x b, y a and y b. When f x,y,y is linear

More information

10 Numerical Solutions of PDEs

10 Numerical Solutions of PDEs 10 Numerical Solutions of PDEs There s no sense in being precise when you don t even know what you re talking about.- John von Neumann (1903-1957) Most of the book has dealt with finding exact solutions

More information

Numerical Methods for Differential Equations Mathematical and Computational Tools

Numerical Methods for Differential Equations Mathematical and Computational Tools Numerical Methods for Differential Equations Mathematical and Computational Tools Gustaf Söderlind Numerical Analysis, Lund University Contents V4.16 Part 1. Vector norms, matrix norms and logarithmic

More information

Confidence Estimation Methods for Neural Networks: A Practical Comparison

Confidence Estimation Methods for Neural Networks: A Practical Comparison , 6-8 000, Confidence Estimation Methods for : A Practical Comparison G. Papadopoulos, P.J. Edwards, A.F. Murray Department of Electronics and Electrical Engineering, University of Edinburgh Abstract.

More information

Solutions - Homework #2

Solutions - Homework #2 45 Scatterplot of Abundance vs. Relative Density Parasite Abundance 4 35 3 5 5 5 5 5 Relative Host Population Density Figure : 3 Scatterplot of Log Abundance vs. Log RD Log Parasite Abundance 3.5.5.5.5.5

More information

POL 213: Research Methods

POL 213: Research Methods Brad 1 1 Department of Political Science University of California, Davis April 15, 2008 Some Matrix Basics What is a matrix? A rectangular array of elements arranged in rows and columns. 55 900 0 67 1112

More information

Introduction to Differential Equations

Introduction to Differential Equations Chapter 1 Introduction to Differential Equations 1.1 Basic Terminology Most of the phenomena studied in the sciences and engineering involve processes that change with time. For example, it is well known

More information

(1) Sensitivity = 10 0 g x. (2) m Size = Frequency = s (4) Slenderness = 10w (5)

(1) Sensitivity = 10 0 g x. (2) m Size = Frequency = s (4) Slenderness = 10w (5) 1 ME 26 Jan. May 2010, Homeork #1 Solution; G.K. Ananthasuresh, IISc, Bangalore Figure 1 shos the top-vie of the accelerometer. We need to determine the values of, l, and s such that the specified requirements

More information

Physics 403. Segev BenZvi. Parameter Estimation, Correlations, and Error Bars. Department of Physics and Astronomy University of Rochester

Physics 403. Segev BenZvi. Parameter Estimation, Correlations, and Error Bars. Department of Physics and Astronomy University of Rochester Physics 403 Parameter Estimation, Correlations, and Error Bars Segev BenZvi Department of Physics and Astronomy University of Rochester Table of Contents 1 Review of Last Class Best Estimates and Reliability

More information

STUDENT NAME: STUDENT SIGNATURE: STUDENT ID NUMBER: SECTION NUMBER RECITATION INSTRUCTOR:

STUDENT NAME: STUDENT SIGNATURE: STUDENT ID NUMBER: SECTION NUMBER RECITATION INSTRUCTOR: MA262 FINAL EXAM SPRING 2016 MAY 2, 2016 TEST NUMBER 01 INSTRUCTIONS: 1. Do not open the exam booklet until you are instructed to do so. 2. Before you open the booklet fill in the information below and

More information

Nonlinear State Estimation! Extended Kalman Filters!

Nonlinear State Estimation! Extended Kalman Filters! Nonlinear State Estimation! Extended Kalman Filters! Robert Stengel! Optimal Control and Estimation, MAE 546! Princeton University, 2017!! Deformation of the probability distribution!! Neighboring-optimal

More information

APPM 2460 CHAOTIC DYNAMICS

APPM 2460 CHAOTIC DYNAMICS APPM 2460 CHAOTIC DYNAMICS 1. Introduction Today we ll continue our exploration of dynamical systems, focusing in particular upon systems who exhibit a type of strange behavior known as chaos. We will

More information

g(t) = f(x 1 (t),..., x n (t)).

g(t) = f(x 1 (t),..., x n (t)). Reading: [Simon] p. 313-333, 833-836. 0.1 The Chain Rule Partial derivatives describe how a function changes in directions parallel to the coordinate axes. Now we shall demonstrate how the partial derivatives

More information

Quantitative Methods in Economics Conditional Expectations

Quantitative Methods in Economics Conditional Expectations Quantitative Methods in Economics Conditional Expectations Maximilian Kasy Harvard University, fall 2016 1 / 19 Roadmap, Part I 1. Linear predictors and least squares regression 2. Conditional expectations

More information

The roots are found with the following two statements. We have denoted the polynomial as p1, and the roots as roots_ p1.

The roots are found with the following two statements. We have denoted the polynomial as p1, and the roots as roots_ p1. Part II Lesson 10 Numerical Analysis Finding roots of a polynomial In MATLAB, a polynomial is expressed as a row vector of the form [an an 1 a2 a1 a0]. The elements ai of this vector are the coefficients

More information

STA2603/205/1/2014 /2014. ry II. Tutorial letter 205/1/

STA2603/205/1/2014 /2014. ry II. Tutorial letter 205/1/ STA263/25//24 Tutorial letter 25// /24 Distribution Theor ry II STA263 Semester Department of Statistics CONTENTS: Examination preparation tutorial letterr Solutions to Assignment 6 2 Dear Student, This

More information

Six Sigma Black Belt Study Guides

Six Sigma Black Belt Study Guides Six Sigma Black Belt Study Guides 1 www.pmtutor.org Powered by POeT Solvers Limited. Analyze Correlation and Regression Analysis 2 www.pmtutor.org Powered by POeT Solvers Limited. Variables and relationships

More information

Statistical Modelling in Stata 5: Linear Models

Statistical Modelling in Stata 5: Linear Models Statistical Modelling in Stata 5: Linear Models Mark Lunt Arthritis Research UK Epidemiology Unit University of Manchester 07/11/2017 Structure This Week What is a linear model? How good is my model? Does

More information

Regression for finding binding energies

Regression for finding binding energies Regression for finding binding energies (c) 2016 Justin Bois. This work is licensed under a Creative Commons Attribution License CC-BY 4.0. All code contained herein is licensed under MIT license. Now

More information

Monte Carlo Simulations

Monte Carlo Simulations Monte Carlo Simulations What are Monte Carlo Simulations and why ones them? Pseudo Random Number generators Creating a realization of a general PDF The Bootstrap approach A real life example: LOFAR simulations

More information

Example Example Example Example

Example Example Example Example 7. More Practice with Iteration and Conditionals Through Graphics We will Draw Pictures Using Three User-Defined* Graphics Functions For-Loop Problems Introduce While-Loops DrawRect DrawDisk DrawStar Rectangles

More information

154 Chapter 9 Hints, Answers, and Solutions The particular trajectories are highlighted in the phase portraits below.

154 Chapter 9 Hints, Answers, and Solutions The particular trajectories are highlighted in the phase portraits below. 54 Chapter 9 Hints, Answers, and Solutions 9. The Phase Plane 9.. 4. The particular trajectories are highlighted in the phase portraits below... 3. 4. 9..5. Shown below is one possibility with x(t) and

More information

Learning From Data Lecture 25 The Kernel Trick

Learning From Data Lecture 25 The Kernel Trick Learning From Data Lecture 25 The Kernel Trick Learning with only inner products The Kernel M. Magdon-Ismail CSCI 400/600 recap: Large Margin is Better Controling Overfitting Non-Separable Data 0.08 random

More information

Generate a theoretical model, which provides a functional form for the data points. global warming, try theoretical model

Generate a theoretical model, which provides a functional form for the data points. global warming, try theoretical model CURVE FITTING Basic part of a wide range of physics - fit data to a model e.g. Global warming - CO 2 level in atmosphere what is estimated rate of increase in CO 2 per year? 166 Modelling of data Generate

More information

MLMED. User Guide. Nicholas J. Rockwood The Ohio State University Beta Version May, 2017

MLMED. User Guide. Nicholas J. Rockwood The Ohio State University Beta Version May, 2017 MLMED User Guide Nicholas J. Rockwood The Ohio State University rockwood.19@osu.edu Beta Version May, 2017 MLmed is a computational macro for SPSS that simplifies the fitting of multilevel mediation and

More information

Intermediate Tier - Algebra revision

Intermediate Tier - Algebra revision Intermediate Tier - Algebra revision Contents : Collecting like terms Multiplying terms together Indices Expanding single brackets Expanding double brackets Substitution Solving equations Finding nth term

More information

Chapter III. Unconstrained Univariate Optimization

Chapter III. Unconstrained Univariate Optimization 1 Chapter III Unconstrained Univariate Optimization Introduction Interval Elimination Methods Polynomial Approximation Methods Newton s Method Quasi-Newton Methods 1 INTRODUCTION 2 1 Introduction Univariate

More information

Solving ODEs and PDEs in MATLAB. Sören Boettcher

Solving ODEs and PDEs in MATLAB. Sören Boettcher 16.02.2009 Introduction Quick introduction to syntax ODE in the form of Initial Value Problems (IVP) what equations can handle how to code into how to choose the right solver how to get the solver to do

More information

Qualifying Examination

Qualifying Examination Summer 24 Day. Monday, September 5, 24 You have three hours to complete this exam. Work all problems. Start each problem on a All problems are 2 points. Please email any electronic files in support of

More information

Comments on Productivity of Batch & Continuous Bioreactors (Chapter 9)

Comments on Productivity of Batch & Continuous Bioreactors (Chapter 9) Comments on Productivity of Batch & Continuous Bioreactors (Chapter 9) Topics Definition of productivity Comparison of productivity of batch vs flowing systems Review Batch Reactor Cell Balances (constant

More information

1 A Review of Correlation and Regression

1 A Review of Correlation and Regression 1 A Review of Correlation and Regression SW, Chapter 12 Suppose we select n = 10 persons from the population of college seniors who plan to take the MCAT exam. Each takes the test, is coached, and then

More information

Optimal Control - Homework Exercise 3

Optimal Control - Homework Exercise 3 Optimal Control - Homework Exercise 3 December 17, 2010 In this exercise two different problems will be considered, first the so called Zermelo problem the problem is to steer a boat in streaming water,

More information

2D Plotting with Matlab

2D Plotting with Matlab GEEN 1300 Introduction to Engineering Computing Class Meeting #22 Monday, Nov. 9 th Engineering Computing and Problem Solving with Matlab 2-D plotting with Matlab Script files User-defined functions Matlab

More information

TEST CODE: MMA (Objective type) 2015 SYLLABUS

TEST CODE: MMA (Objective type) 2015 SYLLABUS TEST CODE: MMA (Objective type) 2015 SYLLABUS Analytical Reasoning Algebra Arithmetic, geometric and harmonic progression. Continued fractions. Elementary combinatorics: Permutations and combinations,

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Violeta Ivanova, Ph.D. Educational Technology Consultant MIT Academic Computing violeta@mit.edu http://web.mit.edu/violeta/www/iap2006 Topics MATLAB Interface and Basics Linear Algebra

More information

Lesson 14: Van der Pol Circuit and ode23s

Lesson 14: Van der Pol Circuit and ode23s Lesson 4: Van der Pol Circuit and ode3s 4. Applied Problem. A series LRC circuit when coupled via mutual inductance with a triode circuit can generate a sequence of pulsing currents that have very rapid

More information

Computer Intensive Methods in Mathematical Statistics

Computer Intensive Methods in Mathematical Statistics Computer Intensive Methods in Mathematical Statistics Department of mathematics johawes@kth.se Lecture 16 Advanced topics in computational statistics 18 May 2017 Computer Intensive Methods (1) Plan of

More information

Testing Indirect Effects for Lower Level Mediation Models in SAS PROC MIXED

Testing Indirect Effects for Lower Level Mediation Models in SAS PROC MIXED Testing Indirect Effects for Lower Level Mediation Models in SAS PROC MIXED Here we provide syntax for fitting the lower-level mediation model using the MIXED procedure in SAS as well as a sas macro, IndTest.sas

More information

Computational Methods

Computational Methods 1 / 55 Computational Methods Copyright c 2018 by Nob Hill Publishing, LLC We summarize many of the fundamental computational procedures required in reactor analysis and design. We illustrate these procedures

More information

Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C.

Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C. Lecture 9 Approximations of Laplace s Equation, Finite Element Method Mathématiques appliquées (MATH54-1) B. Dewals, C. Geuzaine V1.2 23/11/218 1 Learning objectives of this lecture Apply the finite difference

More information