Problem Set #9 (With Solutions)

Size: px
Start display at page:

Download "Problem Set #9 (With Solutions)"

Transcription

1 IC-3 Optimal Control Spring 009 Benoît Chachuat ME C 6, Ph: 3518, benoit@mcmaster.ca Problem Set #9 (With Solutions) The objective of this problem is to solve, via the direct sequential approach, the following scalar optimal control problem: minimize: 0 1 [x 1(t)] dt (1) subject to: ẋ 1 (t) = x (t) + u(t); x 1 (0) = 1 () ẋ (t) = u(t); x (0) = 1 (3) x 1 () = x () = 0 () 10 u(t) 10, 0 t. (5) For simplicity, a piecewise control parameterization over n s stages is considered for approximating, with the time stages being equally spaced, t k = k n s. Questions: u(t) = ω k, t k 1 t t k, k = 1,..., n s, 1. First, reformulate the optimal control problem into the Mayer form (denote the additional state variable by x 3 ). Solutions. Reformulating the problem into the Mayer form proceeds by introducing an extra state variable, x 3, defined by the differential equation, x 3 (t) = 1 [x 1(t)], with initial condition z(0) = 0. An equivalent optimal control formulation is then obtained as: minimize: z() subject to: ẋ 1 (t) = x (t) + u(t); x 1 (0) = 1 ẋ (t) = u(t); x (0) = 1 ẋ 3 (t) = 1 [x 1(t)] ; x 3 (0) = 0 x 1 () = x () = 0. In MatLab, write a m-file calculating the values of the cost (1) and terminal constraints (), for a given number n s of stages and given values of the control parameters ω 1,..., ω ns. Use the function ode15s to integrate the differential equations; set both the absolute and relative integration tolerances to Application. Calculate the cost and constraint values for the following -stage control: { u 0 10, 0 t < 1, (t) = 10, 1 t. (6) Solutions. A possible implementation is as follows: 1

2 fun.m 1 function [ f ] = fun( x0, ns, ts, ws ) 3 % Options for ODE solver optode = odeset( RelTol, 1e-8, AbsTol, 1e-8 ); 5 6 % Forward state integration z0 = [ x0 ]; 8 for ks = 1:ns 9 [tspan,zs] = [ts(ks),ts(ks+1)], z0, optode ); 10 z0 = zs(end,:) ; 11 end 1 % Functions 13 f = zs(end,:) ; 1 15 end 1 function [ dx ] = state( t, x, w, ks ) 3 % State system dx=[ x() + w(ks); 5 - w(ks); 6 x(1)^ /. ]; 8 end state.m 3. Solve the sequentially-discretized NLP problem using the fmincon function in MatLab s Optimization Toolbox: You are to code a main program, as well as two separate m-files called by fmincon that calculate the values of the cost and of the constraints, respectively; these latter m-files should invoke the m-file developed in Question. For simplicity, let fmincon calculate a finite-difference approximation of the cost and constraint derivatives; make sure that the minimum change in variable for finite differencing is consistent with the tolerances set previously for the ODE solver (10 8 ): here, a value of 10 5 appears to be a reasonable choice. Make sure to select the medium-scale SQP algorithm with quasi-newton update and line-search, and set the solution point tolerance, the function tolerance and the constraint tolerance all to 10 9 ; such tight tolerances are needed because the optimal control problem is singular. Set all the control coefficients equal to zero as the initial guess. Application. Solve the optimal control problem for n s =,, 8, 16 and 3 stages, then plot the results. Solution. A simple implementation satisfying the aforementioned specifications is given subsequently.

3 main.m 1 clear all; clf; 3 format long; 5 % Options for NLP Solvers 6 optnlp = optimset( LargeScale, off, GradObj, off, GradConstr, off,... DerivativeCheck, off, Display, iter, TolX, 1e-9,... 8 TolFun, 1e-9, TolCon, 1e-9, MaxFunEval, 300,... 9 DiffMinChange, 1e-5 ); % Time Horizon and Initial State 1 t0 = 0; % Initial time 13 tf = ; % Final time 1 x0 = [ 1; 1; 0 ]; % Initial state ns = 1; 1 for is = 1:5 18 ns = *ns; % Number of stages: ns =,, 8, 16, and 3 19 ts = [t0:(tf-t0)/ns:tf]; % Time stages (equipartition) 0 1 % Initial Guess and Bounds for the Parameters w0 = zeros(ns,1); 3 wl = -10*ones(ns,1); wu = 10*ones(ns,1); 5 6 % Sequential Approach of Dynamic Optimization [ wopt ] = w0, [], [], [], [], wl, wu,... optnlp); 9 30 end 1 function [ J ] = obj( x0, ns, ts, ws ) 3 f = fun( x0, ns, ts, ws ); J = f(3); 5 6 end obj.m ctr.m 1 function [ c, ceq ] = ctr( x0, ns, ts, ws ) 3 f = fun( x0, ns, ts, ws ); ceq = f(1:) ; 5 c = []; 6 end. To increase the reliability and execution speed of the direct sequential procedure, you are to compute the derivatives of the cost (1) and terminal constraints () with respect to the control parameters ω 1,..., ω ns via the forward sensitivity method: 3

4 (a) Write down the state sensitivity equations, as well as the cost and constraint derivatives per the forward sensitivity method. (b) Duplicate the m-file developed in Question above and modify it so that it calculates the cost and constraint derivatives in addition to their values; run this m-file for the -stage control u 0 (t) given in (6). (c) Modify the two m-files passed to fmincon for cost/constraint function evaluation: In the main program, tell fmincon to use the user-supplied cost/constraint derivatives (instead of finite-difference derivatives). Use the DerivativeCheck feature of fmincon to detect inconsistencies in the computed derivatives! Application. Recalculate the solution to the optimal control problem for n s =,, 8, 16 and 3 stages, and make sure that you get the same results as previously. Solution. A possible implementation that calculates the cost and constraints derivatives via the forward sensitivity approach is given subsequently. The m-file disopt.m plots the optimization results and then saves these plots. 1 clear all; clf; 3 format long; main.m 5 % Options for ODE & NLP Solvers 6 optode = odeset( RelTol, 1e-8, AbsTol, 1e-8 ); optnlp = optimset( LargeScale, off, GradObj, on, GradConstr, on,... 8 DerivativeCheck, off, Display, iter, TolX, 1e-9,... 9 TolFun, 1e-9, TolCon, 1e-9, MaxFunEval, 300 ); 10, 300 ); 11 1 % Time Horizon and Initial State 13 t0 = 0; % Initial time 1 tf = ; % Final time 15 x0 = [ 1; 1; 0 ]; % Initial state 16 1 ns = 1; 18 for is = 1:5 19 ns = *ns; % Number of stages: ns =,, 8, 16, and 3 0 ts = [t0:(tf-t0)/ns:tf]; % Time stages (equipartition) 1 % Initial Guess and Bounds for the Parameters 3 w0 = zeros(ns,1); wl = -10*ones(ns,1); 5 wu = 10*ones(ns,1); 6 % Sequential Approach of Dynamic Optimization 8 [ wopt ] = w0, [], [], [], [],... 9 wl, optnlp); 30 dispopt( x0, ns, ts, wopt, optode ); 31 3 end obj.m 1 function [ J, dj ] = obj( x0, ns, ts, ws, optode )

5 3 if nargout == 1 f = fun( x0, ns, ts, ws, optode ); 5 J = f(3); 6 else 8 [f,df] = fun( x0, ns, ts, ws, optode ); 9 J = f(3); 10 dj = df(3,:) ; 11 end 1 13 end ctr.m 1 function [ c, ceq, dc, dceq ] = ctr( x0, ns, ts, ws, optode ) 3 if nargout == f = fun( x0, ns, ts, ws, optode ); 5 ceq = f(1:) ; 6 c = []; 8 else 9 [f,df] = fun( x0, ns, ts, ws, optode ); 10 ceq = f(1:) ; 11 dceq = df(1:,:) ; 1 c = []; 13 dc = []; 1 end end fun.m 1 function [ f, df ] = fun( x0, ns, ts, ws, optode ) 3 % Calculate function values only if nargout == 1 5 % Forward state integration 6 z0 = [ x0 ]; for ks = 1:ns 8 [tspan,zs] = [ts(ks),ts(ks+1)], z0, optode ); 9 z0 = zs(end,:) ; 10 end 11 % Functions 1 f = zs(end,:) ; 13 1 % Calculate both function and gradient values 15 else 16 % Forward state & sensitivity integration 1 z0 = [ x0; zeros(3*ns,1) ]; 18 for ks = 1:ns 19 [tspan,zs] = [ts(ks),ts(ks+1)], z0, optode ); 0 z0 = zs(end,:) ; 1 end % Functions & Gradients 3 f = zs(end,1:3) ; df = []; 5

6 5 for is = 1:ns 6 df(1:3,is) = zs(end,is*3+1:is*3+3); end 8 end 9 30 end 1 function [ dx ] = state( t, x, w, ks ) 3 % State system dx=[ x() + w(ks); 5 - w(ks); 6 x(1)^ /. ]; 8 end state.m 1 function [ dx ] = sens( t, x, w, ks ) 3 % State system dx=[ x() + w(ks); 5 - w(ks); 6 x(1)^ /. ]; 8 % Append sensitivity system 9 for is = 1:length(w) 10 if is == ks 11 uws = 1.; 1 else 13 uws = 0.; 1 end 15 dx = [ dx; 16 x(3*is+) + uws; 1 - uws; 18 x(1) * x(3*is+1) ]; 19 end 0 1 end sens.m 1 function dispopt( x0, ns, ts, ws, optode ) dispopt.m 3 % Forward state integration; store optimal state & control z0 = [ x0 ]; 5 topt = []; 6 xopt = []; uopt = []; 8 for ks = 1:ns 9 [tspan,zs] = [ts(ks),ts(ks+1)], z0, optode ); 10 z0 = zs(end,:) ; 11 topt = [ topt; tspan ]; 6

7 1 xopt = [ xopt; zs ]; 13 uopt = [ uopt; ws(ks)*ones(length(tspan),1) ]; 1 end % Display Optimal Cost 1 disp(sprintf( Optimal cost for ns=%d: %d, ns, zs(end,3))); % Plot results 0 figure(1) 1 plot(topt,xopt(:,1), r,topt,xopt(:,), b ) xlabel( t ) 3 ylabel( x1(t), x(t) ) title([ ns=,intstr(ns)]) 5 saveas(gcf,[ x1(t)_x(t)_,intstr(ns), stg.eps ], psc ) 6 figure() 8 plot(xopt(:,1),xopt(:,), r ) 9 xlabel( x1(t) ) 30 ylabel( x(t) ) 31 title([ ns=,intstr(ns)]) 3 saveas(gcf,[ x(x1)_,intstr(ns), stg.eps ], psc ) 33 3 figure(3) 35 plot(topt,uopt, r ) 36 xlabel( t ) 3 ylabel( u(t) ) 38 title([ ns=,intstr(ns)]) 39 saveas(gcf,[ u(t)_,intstr(ns), stg.eps ], psc ) 0 1 end With the foregoing implementation, one gets the following results: n s J It should be noted that adding more control stages gives very little improvement in terms of the optimal cost, for n s greater than 8. The results obtained with n s = 3 are shown in Fig. 1 below. By inspection an optimal control for the problem (1 5) appears to be composed of 3 arcs: (a) u (t) = 10, 0 t t 1; (b) u (t) = x 1 (t) x (t), t 1 t t ; (c) u (t) = 10, t t. These numerical results should be compared with the analytical solution given in the Example.3 of the class textbook.

8 10 n s = 3 stages n s = 3 stages u (t) 0 x 1(t), x (t) t t Figure 1: Optimal results for CVP with n s = 3. Left plot: optimal control u vs. t; right plot: optimal responses x 1 (red curve), x (blue curve) vs. t. 8

Problem Set #4 (With Corrections)

Problem Set #4 (With Corrections) IC-3 Optimal Control Winter 6 Benoît Chachuat ME C 41, Ph: 33844, benoit.chachuat@epfl.ch Problem Set #4 (With Corrections) 1. Consider the problem of finding the smooth curve y(x), x A x x B, in the vertical

More information

Problem Set #3 (With Corrections)

Problem Set #3 (With Corrections) IC-32 Optimal Control Winter 2006 Benoît Chachuat ME C2 401, Ph: 33844, benoit.chachuat@epfl.ch Problem Set #3 (With Corrections) 1. Consider the following NLP problem: min x IR 3 f(x) := x2 1 + x 1 x

More information

UNCONSTRAINED OPTIMIZATION ALGORITHMS IN MATLAB V7 / OPTIMIZATION TOOLBOX (PARTLY OUTDATED!)

UNCONSTRAINED OPTIMIZATION ALGORITHMS IN MATLAB V7 / OPTIMIZATION TOOLBOX (PARTLY OUTDATED!) UNCONSTRAINED OPTIMIZATION ALGORITHMS IN MATLAB V7 / OPTIMIZATION TOOLBOX (PARTLY OUTDATED!) For up-to-date information: http://www.mathworks.com/access/helpdesk/help/helpdesk.html Only the simplest algorithms

More information

Slovak University of Technology in Bratislava Institute of Information Engineering, Automation, and Mathematics PROCEEDINGS

Slovak University of Technology in Bratislava Institute of Information Engineering, Automation, and Mathematics PROCEEDINGS Slovak University of Technology in Bratislava Institute of Information Engineering, Automation, and Mathematics PROCEEDINGS 16 th International Conference Process Control 2007 Hotel Baník Štrbské Pleso,

More information

AOE 5204: Homework Assignment 4 Due: Wednesday, 9/21 in class. Extended to Friday 9/23 Online Students:

AOE 5204: Homework Assignment 4 Due: Wednesday, 9/21 in class. Extended to Friday 9/23 Online Students: AOE 5204: Homework Assignment 4 Due: Wednesday, 9/21 in class. Extended to Friday 9/23 Online Students: Email (cdhall@vt.edu) by 5 PM Suppose F b is initially aligned with F i and at t = 0 begins to rotate

More information

ISCTE/FCUL - Mestrado Matemática Financeira. Aula de Janeiro de 2009 Ano lectivo: 2008/2009. Diana Aldea Mendes

ISCTE/FCUL - Mestrado Matemática Financeira. Aula de Janeiro de 2009 Ano lectivo: 2008/2009. Diana Aldea Mendes ISCTE/FCUL - Mestrado Matemática Financeira Aula 5 17 de Janeiro de 2009 Ano lectivo: 2008/2009 Diana Aldea Mendes Departamento de Métodos Quantitativos, IBS - ISCTE Business School Gab. 207 AA, diana.mendes@iscte.pt,

More information

MATLAB Functions for Profiled Estimation of Differential Equations

MATLAB Functions for Profiled Estimation of Differential Equations MATLAB Functions for Profiled Estimation of Differential Equations Giles Hooker April 23, 2006 Contents 1 Introduction to Profiling 2 2 Example: FitzHugh-Nagumo Equations 3 3 MATLAB Objects Needed for

More information

An introduction into numerical optimization with KNITRO

An introduction into numerical optimization with KNITRO An introduction into numerical optimization with KNITRO Pawel Doligalski and Dominik Thaler 15 September 2014 KNITRO fval fcount time fmincon -103.6194 2197 1.578750 knitro a'la fmincon -103.1450 144 0.094221

More information

CasADi tutorial Introduction

CasADi tutorial Introduction Lund, 6 December 2011 CasADi tutorial Introduction Joel Andersson Department of Electrical Engineering (ESAT-SCD) & Optimization in Engineering Center (OPTEC) Katholieke Universiteit Leuven OPTEC (ESAT

More information

NIRA-3: An improved MATLAB package for finding Nash equilibria in infinite games

NIRA-3: An improved MATLAB package for finding Nash equilibria in infinite games MPRA Munich Personal RePEc Archive NIRA-3: An improved MATLAB package for finding Nash equilibria in infinite games Jacek Krawczyk and James Zuccollo Victoria University of Wellington December 2006 Online

More information

MATLAB Functions for Profiled Estimation of Differential Equations

MATLAB Functions for Profiled Estimation of Differential Equations MATLAB Functions for Profiled Estimation of Differential Equations Giles Hooker May 26, 2006 Contents 1 Introduction to Profiling 2 2 Example: FitzHugh-Nagumo Equations 3 3 MATLAB Objects Needed for the

More information

Optimal Control Techniques for Dynamic Walking

Optimal Control Techniques for Dynamic Walking Optimal Control Techniques for Dynamic Walking Optimization in Robotics & Biomechanics IWR, University of Heidelberg Presentation partly based on slides by Sebastian Sager, Moritz Diehl and Peter Riede

More information

ChE 400: Applied Chemical Engineering Calculations Tutorial 6: Numerical Solution of ODE Using Excel and Matlab

ChE 400: Applied Chemical Engineering Calculations Tutorial 6: Numerical Solution of ODE Using Excel and Matlab ChE 400: Applied Chemical Engineering Calculations Tutorial 6: Numerical Solution of ODE Using Excel and Matlab Tutorial 6: Numerical Solution of ODE Gerardine G. Botte This handout contains information

More information

ME422 Mechanical Control Systems Matlab/Simulink Hints and Tips

ME422 Mechanical Control Systems Matlab/Simulink Hints and Tips Cal Poly San Luis Obispo Mechanical Engineering ME Mechanical Control Systems Matlab/Simulink Hints and Tips Ridgely/Owen, last update Jan Building A Model The way in which we construct models for analyzing

More information

A parameter corresponding to the symmetry of the problem. m can be slab = 0, cylindrical = 1, or spherical = 2.

A parameter corresponding to the symmetry of the problem. m can be slab = 0, cylindrical = 1, or spherical = 2. MATLAB Function Reference pdepe Solve initial-boundary value problems for parabolic-elliptic PDEs in 1-D Syntax sol = pdepe(m,pdefun,icfun,bcfun,xmesh,tspan) sol = pdepe(m,pdefun,icfun,bcfun,xmesh,tspan,options)

More information

DIRECT SEQUENTIAL DYNAMIC OPTIMIZATION WITH AUTOMATIC SWITCHING STRUCTURE DETECTION. Martin Schlegel, Wolfgang Marquardt 1

DIRECT SEQUENTIAL DYNAMIC OPTIMIZATION WITH AUTOMATIC SWITCHING STRUCTURE DETECTION. Martin Schlegel, Wolfgang Marquardt 1 DIRECT SEQUENTIAL DYNAMIC OPTIMIZATION WITH AUTOMATIC SWITCHING STRUCTURE DETECTION Martin Schlegel, Wolfgang Marquardt 1 Lehrstuhl für Prozesstechnik, RWTH Aachen University D 52056 Aachen, Germany Abstract:

More information

SBVP A MATLAB Solver for Singular Boundary Value Problems

SBVP A MATLAB Solver for Singular Boundary Value Problems SBVP 1.0 - A MATLAB Solver for Singular Boundary Value Problems Winfried Auzinger Günter Kneisl Othmar Koch Ewa B. Weinmüller ANUM Preprint No. 02/02 Institute for Applied Mathematics and Numerical Analysis

More information

Appendix A MATLAB s Optimization Toolbox Algorithms

Appendix A MATLAB s Optimization Toolbox Algorithms Appendix A MATLAB s Optimization Toolbox Algorithms Abstract MATLAB s Optimization Toolbox (version 7:2) includes a family of algorithms for solving optimization problems. The toolbox provides functions

More information

Introduction to Simulink

Introduction to Simulink Introduction to Simulink There are several computer packages for finding solutions of differential equations, such as Maple, Mathematica, Maxima, MATLAB, etc. These systems provide both symbolic and numeric

More information

Chemical Reaction Engineering - Part 4 - Integration Richard K. Herz,

Chemical Reaction Engineering - Part 4 - Integration Richard K. Herz, Chemical Reaction Engineering - Part 4 - Integration Richard K. Herz, rherz@ucsd.edu, www.reactorlab.net Integrating the component balance for a batch reactor For a single reaction in a batch reactor,

More information

Parameters Estimation of Material Constitutive Models using Optimization Algorithms

Parameters Estimation of Material Constitutive Models using Optimization Algorithms The University of Akron IdeaExchange@UAkron Honors Research Projects The Dr. Gary B. and Pamela S. Williams Honors College Spring 2015 Parameters Estimation of Material Constitutive Models using Optimization

More information

Introduction to Optimization Problems and Methods

Introduction to Optimization Problems and Methods Introduction to Optimization Problems and Methods wjch@umich.edu December 10, 2009 Outline 1 Linear Optimization Problem Simplex Method 2 3 Cutting Plane Method 4 Discrete Dynamic Programming Problem Simplex

More information

Engineering Mathematics (4)

Engineering Mathematics (4) Engineering Mathematics (4) Zhang, Xinyu Department of Computer Science and Engineering, Ewha Womans University, Seoul, Korea zhangxy@ewha.ac.kr Example With respect to parameter: s (arc length) r( t)

More information

Parameter Estimation in Differential Equations: A Numerical Study of Shooting Methods

Parameter Estimation in Differential Equations: A Numerical Study of Shooting Methods Parameter Estimation in Differential Equations: A Numerical Study of Shooting Methods Franz Hamilton Faculty Advisor: Dr Timothy Sauer January 5, 2011 Abstract Differential equation modeling is central

More information

Trajectory Optimization

Trajectory Optimization C H A P T E R 12 Trajectory Optimization So far, we have discussed a number of ways to solve optimal control problems via state space search (e.g., Dijkstra s and Dynamic Programming/Value Iteration).

More information

PERI INSTITUTE OF TECHNOLOGY DEPARTMENT OF ECE TWO DAYS NATIONAL LEVEL WORKSHOP ON COMMUNICATIONS & IMAGE PROCESSING "CIPM 2017" Matlab Fun - 2

PERI INSTITUTE OF TECHNOLOGY DEPARTMENT OF ECE TWO DAYS NATIONAL LEVEL WORKSHOP ON COMMUNICATIONS & IMAGE PROCESSING CIPM 2017 Matlab Fun - 2 Table of Contents PERI INSTITUTE OF TECHNOLOGY DEPARTMENT OF ECE TWO DAYS NATIONAL LEVEL WORKSHOP ON COMMUNICATIONS & IMAGE PROCESSING "CIPM 2017" - 2 What? Matlab can be fun... 1 Plot the Sine Function...

More information

MATLAB Solution of Linear Programming Problems

MATLAB Solution of Linear Programming Problems MATLAB Solution of Linear Programming Problems The simplex method is included in MATLAB using linprog function. All is needed is to have the problem expressed in the terms of MATLAB definitions. Appendix

More information

Introduction to Finite Element Modelling in Geosciences: Introduction to MATLAB

Introduction to Finite Element Modelling in Geosciences: Introduction to MATLAB Introduction to Finite Element Modelling in Geosciences: Introduction to MATLAB D. A. May & M. Frehner ETH Zürich July 7, 2014 1 Introduction This main goal of this part of the course is to learn how to

More information

Mathematical Methods and Modeling Laboratory class. Numerical Integration of Ordinary Differential Equations

Mathematical Methods and Modeling Laboratory class. Numerical Integration of Ordinary Differential Equations Mathematical Methods and Modeling Laboratory class Numerical Integration of Ordinary Differential Equations Exact Solutions of ODEs Cauchy s Initial Value Problem in normal form: Recall: if f is locally

More information

Fuel-Optimal Trajectory Planning of a VTOL Spacecraft Using SQP and RRT

Fuel-Optimal Trajectory Planning of a VTOL Spacecraft Using SQP and RRT Lehigh University Lehigh Preserve Theses and Dissertations 2015 Fuel-Optimal Trajectory Planning of a VTOL Spacecraft Using SQP and RRT Ian Miller Lehigh University Follow this and additional works at:

More information

Math Scientific Computing - Matlab Intro and Exercises: Spring 2003

Math Scientific Computing - Matlab Intro and Exercises: Spring 2003 Math 64 - Scientific Computing - Matlab Intro and Exercises: Spring 2003 Professor: L.G. de Pillis Time: TTh :5pm 2:30pm Location: Olin B43 February 3, 2003 Matlab Introduction On the Linux workstations,

More information

Numerical Methods Lecture 7 - Optimization

Numerical Methods Lecture 7 - Optimization Numerical Methods Lecture 7 - Optimization Topics: numerical optimization - Newton again - Random search - Golden Section Search READING : text pgs. 331-349 Optimization - motivation What? Locating where

More information

MATLAB Functions for Profiled Estimation of Differential Equations

MATLAB Functions for Profiled Estimation of Differential Equations MATLAB Functions for Profiled Estimation of Differential Equations Giles Hooker August 11, 2006 Contents 1 Introduction 2 1.1 Defining the problem......................... 2 1.2 The profiling estimation

More information

What you will learn today

What you will learn today What you will learn today Tangent Planes and Linear Approximation and the Gradient Vector Vector Functions 1/21 Recall in one-variable calculus, as we zoom in toward a point on a curve, the graph becomes

More information

APPLIED OPTIMIZATION WITH MATLAB PROGRAMMING

APPLIED OPTIMIZATION WITH MATLAB PROGRAMMING APPLIED OPTIMIZATION WITH MATLAB PROGRAMMING Second Edition P. Venkataraman Rochester Institute of Technology WILEY JOHN WILEY & SONS, INC. CONTENTS PREFACE xiii 1 Introduction 1 1.1. Optimization Fundamentals

More information

Quasilinear First-Order PDEs

Quasilinear First-Order PDEs MODULE 2: FIRST-ORDER PARTIAL DIFFERENTIAL EQUATIONS 16 Lecture 3 Quasilinear First-Order PDEs A first order quasilinear PDE is of the form a(x, y, z) + b(x, y, z) x y = c(x, y, z). (1) Such equations

More information

An interface between MATLAB and SIPAMPL for semi-infinite programming problems

An interface between MATLAB and SIPAMPL for semi-infinite programming problems An interface between MATLAB and SIPAMPL for semi-infinite programming problems A. Ismael F. Vaz Edite M.G.P. Fernandes Production and Systems Department Engineering School Minho University - Braga - Portugal

More information

Stream Function-Vorticity CFD Solver MAE 6263

Stream Function-Vorticity CFD Solver MAE 6263 Stream Function-Vorticity CFD Solver MAE 66 Charles O Neill April, 00 Abstract A finite difference CFD solver was developed for transient, two-dimensional Cartesian viscous flows. Flow parameters are solved

More information

Workshop Matlab/Simulink in Drives and Power electronics Lecture 3

Workshop Matlab/Simulink in Drives and Power electronics Lecture 3 Workshop Matlab/Simulink in Drives and Power electronics Lecture 3 : DC-Motor Control design Ghislain REMY Jean DEPREZ 1 / 29 Workshop Program 8 lectures will be presented based on Matlab/Simulink : 1

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Other models of interactive domains Marc Toussaint University of Stuttgart Winter 2018/19 Basic Taxonomy of domain models Other models of interactive domains Basic Taxonomy of domain

More information

Introduction to Programming for Engineers Spring Final Examination. May 10, Questions, 170 minutes

Introduction to Programming for Engineers Spring Final Examination. May 10, Questions, 170 minutes Final Examination May 10, 2011 75 Questions, 170 minutes Notes: 1. Before you begin, please check that your exam has 28 pages (including this one). 2. Write your name and student ID number clearly on your

More information

Panagiotis Tsiotras. Dynamics and Control Systems Laboratory Daniel Guggenheim School of Aerospace Engineering Georgia Institute of Technology

Panagiotis Tsiotras. Dynamics and Control Systems Laboratory Daniel Guggenheim School of Aerospace Engineering Georgia Institute of Technology Panagiotis Tsiotras Dynamics and Control Systems Laboratory Daniel Guggenheim School of Aerospace Engineering Georgia Institute of Technology ICRAT 12 Tutotial on Methods for Optimal Trajectory Design

More information

Bucknell University Using ODE45 MATLAB Help

Bucknell University Using ODE45 MATLAB Help Bucknell University Using ODE45 MATLAB Help MATLAB's standard solver for ordinary differential equations (ODEs) is the function ode45. This function implements a Runge-Kutta method with a variable time

More information

CS205b/CME306. Lecture 9

CS205b/CME306. Lecture 9 CS205b/CME306 Lecture 9 1 Convection Supplementary Reading: Osher and Fedkiw, Sections 3.3 and 3.5; Leveque, Sections 6.7, 8.3, 10.2, 10.4. For a reference on Newton polynomial interpolation via divided

More information

Parallelization Strategy

Parallelization Strategy COSC 335 Software Design Parallel Design Patterns (II) Spring 2008 Parallelization Strategy Finding Concurrency Structure the problem to expose exploitable concurrency Algorithm Structure Supporting Structure

More information

Introduction to MATLAB for Economics

Introduction to MATLAB for Economics Introduction to MATLAB for Economics Introduction to Optimization in MATLAB Javier Barbero Universidad Autónoma de Madrid http://www.javierbarbero.net October 31, 2014 Javier Barbero (UAM) Introduction

More information

Shape Modeling. Differential Geometry Primer Smooth Definitions Discrete Theory in a Nutshell. CS 523: Computer Graphics, Spring 2011

Shape Modeling. Differential Geometry Primer Smooth Definitions Discrete Theory in a Nutshell. CS 523: Computer Graphics, Spring 2011 CS 523: Computer Graphics, Spring 2011 Shape Modeling Differential Geometry Primer Smooth Definitions Discrete Theory in a Nutshell 2/15/2011 1 Motivation Geometry processing: understand geometric characteristics,

More information

Fall 2014 MAT 375 Numerical Methods. Introduction to Programming using MATLAB

Fall 2014 MAT 375 Numerical Methods. Introduction to Programming using MATLAB Fall 2014 MAT 375 Numerical Methods Introduction to Programming using MATLAB Some useful links 1 The MOST useful link: www.google.com 2 MathWorks Webcite: www.mathworks.com/help/matlab/ 3 Wikibooks on

More information

Space Shuttle External Tank Optimization

Space Shuttle External Tank Optimization Space Shuttle External Tank Optimization Anonymous MIT Students System Design and Management Massachusetts Institute of Technology Abstract A simplified model of the Space Shuttle External Tank was used

More information

SIMULINK FOR BEGINNERS:

SIMULINK FOR BEGINNERS: 1 SIMULINK FOR BEGINNERS: To begin your SIMULINK session open first MATLAB ICON by clicking mouse twice and then type»simulink You will now see the Simulink block library. 2 Browse through block libraries.

More information

Introduction to Multi-body Dynamics

Introduction to Multi-body Dynamics division Graduate Course ME 244) Tentative Draft Syllabus 1. Basic concepts in 3-D rigid-body mechanics 1. Rigid body vs flexible body 2. Spatial kinematics (3-D rotation transformations) and Euler theorem

More information

Chapter 3 Numerical Methods

Chapter 3 Numerical Methods Chapter 3 Numerical Methods Part 1 3.1 Linearization and Optimization of Functions of Vectors 1 Problem Notation 2 Outline 3.1.1 Linearization 3.1.2 Optimization of Objective Functions 3.1.3 Constrained

More information

A Moving Mesh Method for Time dependent Problems Based on Schwarz Waveform Relaxation

A Moving Mesh Method for Time dependent Problems Based on Schwarz Waveform Relaxation A Moving Mesh Method for Time dependent Problems Based on Schwarz Waveform Relaation Ronald D. Haynes, Weizhang Huang 2, and Robert D. Russell 3 Acadia University, Wolfville, N.S., Canada. ronald.haynes@acadiau.ca

More information

Optimal Mobile Sensing Policy for Parameter Estimation of Distributed Parameter Systems: Finite Horizon Closed-loop Solution

Optimal Mobile Sensing Policy for Parameter Estimation of Distributed Parameter Systems: Finite Horizon Closed-loop Solution Optimal Mobile Sensing Policy for Parameter Estimation of Distributed Parameter Systems: Finite Horizon Closed-loop Solution Christophe Tricaud and YangQuan Chen Introduction In control engineering practice,

More information

A Brief Introduction to MATLAB

A Brief Introduction to MATLAB A Brief Introduction to MATLAB MATLAB (Matrix Laboratory) is an interactive software system for numerical computations and graphics. As the name suggests, MATLAB was first designed for matrix computations:

More information

MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations)

MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations) MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations) In this session we look at basic numerical methods to help us understand the fundamentals of numerical approximations.

More information

Ordinary differential equations solving methods

Ordinary differential equations solving methods Radim Hošek, A07237 radhost@students.zcu.cz Ordinary differential equations solving methods Problem: y = y2 (1) y = x y (2) y = sin ( + y 2 ) (3) Where it is possible we try to solve the equations analytically,

More information

Dynamic Optimization in JModelica.org

Dynamic Optimization in JModelica.org Dynamic Optimization in JModelica.org Magnusson, Fredrik; Åkesson, Johan Published in: Processes DOI: 10.3390/pr3020471 2015 Document Version: Publisher's PDF, also known as Version of record Link to publication

More information

EE 301 Lab 1 Introduction to MATLAB

EE 301 Lab 1 Introduction to MATLAB EE 301 Lab 1 Introduction to MATLAB 1 Introduction In this lab you will be introduced to MATLAB and its features and functions that are pertinent to EE 301. This lab is written with the assumption that

More information

Chapter 2 A Second-Order Algorithm for Curve Parallel Projection on Parametric Surfaces

Chapter 2 A Second-Order Algorithm for Curve Parallel Projection on Parametric Surfaces Chapter 2 A Second-Order Algorithm for Curve Parallel Projection on Parametric Surfaces Xiongbing Fang and Hai-Yin Xu Abstract A second-order algorithm is presented to calculate the parallel projection

More information

A Moving Mesh Method for Time Dependent Problems based on Schwarz Waveform Relaxation

A Moving Mesh Method for Time Dependent Problems based on Schwarz Waveform Relaxation A Moving Mesh Method for Time Dependent Problems based on Schwarz Waveform Relaation Ronald D. Haynes, Weizhang Huang 2, and Robert D. Russell 3 Acadia University, Wolfville, N.S., Canada ronald.haynes@acadiau.ca

More information

Chapter 6 Some Applications of the Integral

Chapter 6 Some Applications of the Integral Chapter 6 Some Applications of the Integral More on Area More on Area Integrating the vertical separation gives Riemann Sums of the form More on Area Example Find the area A of the set shaded in Figure

More information

Parallel MATLAB: Parallel For Loops

Parallel MATLAB: Parallel For Loops Parallel MATLAB: Parallel For Loops John Burkardt (FSU) & Gene Cliff (AOE/ICAM) 2pm - 4pm, Tuesday, 31 May 2011 Mathematics Commons Room... vt 2011 parfor.pdf... FSU: Florida State University AOE: Department

More information

Math 226A Homework 4 Due Monday, December 11th

Math 226A Homework 4 Due Monday, December 11th Math 226A Homework 4 Due Monday, December 11th 1. (a) Show that the polynomial 2 n (T n+1 (x) T n 1 (x)), is the unique monic polynomial of degree n + 1 with roots at the Chebyshev points x k = cos ( )

More information

LECTURE NOTES Non-Linear Programming

LECTURE NOTES Non-Linear Programming CEE 6110 David Rosenberg p. 1 Learning Objectives LECTURE NOTES Non-Linear Programming 1. Write out the non-linear model formulation 2. Describe the difficulties of solving a non-linear programming model

More information

dy = dx y dx Project 1 Consider the following differential equations: I. xy II. III.

dy = dx y dx Project 1 Consider the following differential equations: I. xy II. III. Project 1 Consider the following differential equations: dy = dy = y dy x + sin( x) y = x I. xy II. III. 1. Graph the direction field in the neighborhood of the origin. Graph approximate integral curves

More information

README for Generalized Model Aggregation (GMA) codes

README for Generalized Model Aggregation (GMA) codes README for Generalized Model Aggregation (GMA) codes MATLAB (Version 2) Summary: This document provides you with: - instructions on how to read and execute the codes - descriptions about the notations

More information

ME 4943 Course Project - Part I

ME 4943 Course Project - Part I ME 4943 Course Project - Part I Numerical Implementation of the Source Panel Method by Jeffrey A. Kornuta Mechanical Engineering Louisiana State University October 9, 27 1 Contents 1 Verification of Algorithm

More information

Working Environment : Python #1

Working Environment : Python #1 Working Environment : Python #1 Serdar ARITAN Biomechanics Research Group, Faculty of Sports Sciences, and Department of Computer Graphics Hacettepe University, Ankara, Turkey 1 Physics has several aspects:

More information

Global Solution of Mixed-Integer Dynamic Optimization Problems

Global Solution of Mixed-Integer Dynamic Optimization Problems European Symposium on Computer Arded Aided Process Engineering 15 L. Puigjaner and A. Espuña (Editors) 25 Elsevier Science B.V. All rights reserved. Global Solution of Mixed-Integer Dynamic Optimization

More information

Introduction to Matlab. SAMSI Undergraduate Workshop May 15, 2006

Introduction to Matlab. SAMSI Undergraduate Workshop May 15, 2006 Introduction to Matlab SAMSI Undergraduate Workshop May 15, 2006 1 The things you need to know about Matlab How arrays and matrices are stored How to use operators on arrays and matrices How to write a.m

More information

Trajectory Optimization for. Robots

Trajectory Optimization for. Robots LA (x0, U ; µ, ) = `f (xn ) + N X 1 2 k=0 N X1 `(xk, uk ) + k=0 Trajectory Optimization for @c(x, u) @c(x, u) ˆ Q =Q + I Underactuated @x @x (and other) @c(x, u) @c(x, u) ˆ =Q + Q I + I Robots @u @u c(xk,uk

More information

Level Set Methods and Fast Marching Methods

Level Set Methods and Fast Marching Methods Level Set Methods and Fast Marching Methods I.Lyulina Scientific Computing Group May, 2002 Overview Existing Techniques for Tracking Interfaces Basic Ideas of Level Set Method and Fast Marching Method

More information

Systematic Calculation of Loop Points for Parametric Curves

Systematic Calculation of Loop Points for Parametric Curves Systematic Calculation of Loop Points for Parametric Curves Skip Thompson Department of Mathematics & Statistics Radford University Radford, VA 24142 thompson@radford.edu January 11, 2013 Abstract We consider

More information

Fast Direct Multiple Shooting Algorithms for Optimal Robot Control

Fast Direct Multiple Shooting Algorithms for Optimal Robot Control Fast Direct Multiple Shooting Algorithms for Optimal Robot Control Moritz Diehl, Hans Georg Bock, Holger Diedam, Pierre-Brice Wieber To cite this version: Moritz Diehl, Hans Georg Bock, Holger Diedam,

More information

Introduction to Control Structures

Introduction to Control Structures Introduction to Control Structures Aniel Nieves-González Institute of Statistics Spring 2014 Logical and relational operators Let x be a boolean variable, i.e., it can only be {0, 1} ({TRUE, FALSE}). For

More information

Simulation of Mechatronic Systems

Simulation of Mechatronic Systems Examination WS 2002/2003 Simulation of Mechatronic Systems Prof. Dr.-Ing. K. Wöllhaf Remarks: Check if the examination is complete (9 pages) Put your name and Matr.Nr. on any sheet of paper You must not

More information

Fondamenti di Informatica

Fondamenti di Informatica Fondamenti di Informatica Scripts and Functions: examples lesson 9 2012/04/16 Prof. Emiliano Casalicchio emiliano.casalicchio@uniroma2.it Agenda Examples Bisection method Locating roots Secant methods

More information

Chapter 3 Path Optimization

Chapter 3 Path Optimization Chapter 3 Path Optimization Background information on optimization is discussed in this chapter, along with the inequality constraints that are used for the problem. Additionally, the MATLAB program for

More information

Introduction to Simulink. The Use of Mathematic Simulations in Electrical Engineering

Introduction to Simulink. The Use of Mathematic Simulations in Electrical Engineering Introduction to Simulink The Use of Mathematic Simulations in Electrical Engineering Lecture Outline 1) Introduction to Simulink 2) Modelling of dynamics systems 2 Simulink Tool for modeling, simulating,

More information

Overview. 1. Ordinary Differential Equations, Algebraic Equations. 2. Block Diagrams

Overview. 1. Ordinary Differential Equations, Algebraic Equations. 2. Block Diagrams Overview 1. Ordinary Differential Equations, Algebraic Equations 2. Block Diagrams 3. Causal Block Diagrams denotational semantics (modelling) operational semantics (simulation) 4. Virtual Experimentation

More information

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah)

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah) Introduction ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah) MATLAB is a powerful mathematical language that is used in most engineering companies today. Its strength lies

More information

Solving semi-infinite programming problems by using an interface between MATLAB and SIPAMPL

Solving semi-infinite programming problems by using an interface between MATLAB and SIPAMPL Proceedings of the 6th WSEAS International Conference on Simulation, Modelling and Optimization, Lisbon, Portugal, September -4, 006 83 Solving semi-infinite programming problems by using an interface

More information

ESD.77 Multidisciplinary System Design Optimization Spring Barge Design Optimization

ESD.77 Multidisciplinary System Design Optimization Spring Barge Design Optimization ESD.77 Multidisciplinary System Design Optimization Spring 2010 Barge Design Optimization Anonymous MIT Students What is a barge? Flat bottomed vessel, typically non selfpropelled, used to carry low value,

More information

Lab - Introduction to Finite Element Methods and MATLAB s PDEtoolbox

Lab - Introduction to Finite Element Methods and MATLAB s PDEtoolbox Scientific Computing III 1 (15) Institutionen för informationsteknologi Beräkningsvetenskap Besöksadress: ITC hus 2, Polacksbacken Lägerhyddsvägen 2 Postadress: Box 337 751 05 Uppsala Telefon: 018 471

More information

MS213: Numerical Methods Computing Assignments with Matlab

MS213: Numerical Methods Computing Assignments with Matlab MS213: Numerical Methods Computing Assignments with Matlab SUBMISSION GUIDELINES & ASSIGNMENT ADVICE 1 Assignment Questions & Supplied Codes 1.1 The MS213 Numerical Methods assignments require students

More information

An Investigation into Iterative Methods for Solving Elliptic PDE s Andrew M Brown Computer Science/Maths Session (2000/2001)

An Investigation into Iterative Methods for Solving Elliptic PDE s Andrew M Brown Computer Science/Maths Session (2000/2001) An Investigation into Iterative Methods for Solving Elliptic PDE s Andrew M Brown Computer Science/Maths Session (000/001) Summary The objectives of this project were as follows: 1) Investigate iterative

More information

Code from Maple, MATLAB, and Fortran for Example 1 from "Extending Explicit and Linearly Implicit ODE Solvers for Index-1 DAEs."

Code from Maple, MATLAB, and Fortran for Example 1 from Extending Explicit and Linearly Implicit ODE Solvers for Index-1 DAEs. Appendix A Code from Maple, MATLAB, and Fortran for Example 1 from "Extending Explicit and Linearly Implicit ODE Solvers for Index-1 DAEs." 1. Maple Code (using dsolve s rkf45) Use y1, y2, etc. for all

More information

Topic 5.1: Line Elements and Scalar Line Integrals. Textbook: Section 16.2

Topic 5.1: Line Elements and Scalar Line Integrals. Textbook: Section 16.2 Topic 5.1: Line Elements and Scalar Line Integrals Textbook: Section 16.2 Warm-Up: Derivatives of Vector Functions Suppose r(t) = x(t) î + y(t) ĵ + z(t) ˆk parameterizes a curve C. The vector: is: r (t)

More information

l1 ls: A Matlab Solver for Large-Scale l 1 -Regularized Least Squares Problems

l1 ls: A Matlab Solver for Large-Scale l 1 -Regularized Least Squares Problems l ls: A Matlab Solver for Large-Scale l -Regularized Least Squares Problems Kwangmoo Koh deneb@stanford.edu Seungjean Kim sjkim@stanford.edu May 5, 2008 Stephen Boyd boyd@stanford.edu l ls solves l -regularized

More information

Optimization of Components using Sensitivity and Yield Information

Optimization of Components using Sensitivity and Yield Information Optimization of Components using Sensitivity and Yield Information Franz Hirtenfelder, CST AG franz.hirtenfelder@cst.com www.cst.com CST UGM 2010 April 10 1 Abstract Optimization is a typical component

More information

Euler s Methods (a family of Runge- Ku9a methods)

Euler s Methods (a family of Runge- Ku9a methods) Euler s Methods (a family of Runge- Ku9a methods) ODE IVP An Ordinary Differential Equation (ODE) is an equation that contains a function having one independent variable: The equation is coupled with an

More information

Nested functions & Local functions

Nested functions & Local functions Lab 5 Nested functions & Local functions Nested functions are functions defined within functions. They are helpful when: - We wish to write small or temporary functions which do not merit creation of a

More information

1 2 (3 + x 3) x 2 = 1 3 (3 + x 1 2x 3 ) 1. 3 ( 1 x 2) (3 + x(0) 3 ) = 1 2 (3 + 0) = 3. 2 (3 + x(0) 1 2x (0) ( ) = 1 ( 1 x(0) 2 ) = 1 3 ) = 1 3

1 2 (3 + x 3) x 2 = 1 3 (3 + x 1 2x 3 ) 1. 3 ( 1 x 2) (3 + x(0) 3 ) = 1 2 (3 + 0) = 3. 2 (3 + x(0) 1 2x (0) ( ) = 1 ( 1 x(0) 2 ) = 1 3 ) = 1 3 6 Iterative Solvers Lab Objective: Many real-world problems of the form Ax = b have tens of thousands of parameters Solving such systems with Gaussian elimination or matrix factorizations could require

More information

Lecture 19: November 5

Lecture 19: November 5 0-725/36-725: Convex Optimization Fall 205 Lecturer: Ryan Tibshirani Lecture 9: November 5 Scribes: Hyun Ah Song Note: LaTeX template courtesy of UC Berkeley EECS dept. Disclaimer: These notes have not

More information

Matlab Handout Nancy Chen Math 19 Fall 2004

Matlab Handout Nancy Chen Math 19 Fall 2004 Matlab Handout Nancy Chen Math 19 Fall 2004 Introduction Matlab is a useful program for algorithm development, numerical computation, and data analysis and visualization. In this class you will only need

More information

User-Defined Function

User-Defined Function ENGR 102-213 (Socolofsky) Week 11 Python scripts In the lecture this week, we are continuing to learn powerful things that can be done with userdefined functions. In several of the examples, we consider

More information

Eric W. Hansen. The basic data type is a matrix This is the basic paradigm for computation with MATLAB, and the key to its power. Here s an example:

Eric W. Hansen. The basic data type is a matrix This is the basic paradigm for computation with MATLAB, and the key to its power. Here s an example: Using MATLAB for Stochastic Simulation. Eric W. Hansen. Matlab Basics Introduction MATLAB (MATrix LABoratory) is a software package designed for efficient, reliable numerical computing. Using MATLAB greatly

More information

Computer Project 3. AA Computational Fluid Dyanmics University of Washington. Mishaal Aleem March 17, 2015

Computer Project 3. AA Computational Fluid Dyanmics University of Washington. Mishaal Aleem March 17, 2015 Computer Project 3 AA 543 - Computational Fluid Dyanmics University of Washington Mishaal Aleem March 17, 2015 Contents Introduction........................................... 1 3.1 Grid Generator.......................................

More information

AMS527: Numerical Analysis II

AMS527: Numerical Analysis II AMS527: Numerical Analysis II A Brief Overview of Finite Element Methods Xiangmin Jiao SUNY Stony Brook Xiangmin Jiao SUNY Stony Brook AMS527: Numerical Analysis II 1 / 25 Overview Basic concepts Mathematical

More information