Lab session on week 13 (9th/last meeting) After this, good bye…

Slides:



Advertisements
Similar presentations
Motion in 2D o Vectors o Projectile Motion Physics -101 Piri Reis University 2010.
Advertisements

Intro to modeling April Part of the course: Introduction to biological modeling 1.Intro to modeling 2.Intro to biological modeling (Floor) 3.Modeling.
259 Lecture 17 Working with Data in MATLAB. Overview  In this lecture, we’ll look at some commands that are useful for working with data!  fzero  sum,
Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
1 Chapter 13 Curve Fitting and Correlation This chapter will be concerned primarily with two separate but closely interrelated processes: (1) the fitting.
Introduction to Matlab 7
Using MatLab and Excel to Solve Building Energy Simulation Problems Jordan Clark
Differential Equations Math Review with Matlab: Finding Solutions to Differential Equations S. Awad, Ph.D. M. Corless, M.S.E.E. D. Cinpinski E.C.E. Department.
Inpainting Assigment – Tips and Hints Outline how to design a good test plan selection of dimensions to test along selection of values for each dimension.
Mathematics Algebra 1 Trigonometry Geometry The Meaning of Numbers Choosing the Correct Equation(s) Trig and Geometry Mathematics is a language. It is.
Least squares CS1114
Click here to enter. Click a menu option to view more details Starters Main Courses Desserts Click on the coffee cup to return when Navigating For Vocabulary.
3-Dimensional Projectile Motion Homework 6. The object we are trying to hit has displacement vector as follows- ( I’m going to use BIG V to represent.
Programming in Visual Basic
SLOPE AND PARALLEL AND PERPENDICULAR LINES.
About Me Tutor Name: Steven Halim Full-time Teaching Assistant and part-time PhD (final year?) in SoC, NUS Former Teaching Assistant for IT1005, Sem 2,
Lecture 16 Symbolic Mathematics Symbolic mathematics: algebraezplotcalculus © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
CITS2401 Computer Analysis & Visualisation
Chapter 1 Computing Tools Data Representation, Accuracy and Precision Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Section 2.3 Gauss-Jordan Method for General Systems of Equations
By Hrishikesh Gadre Session II Department of Mechanical Engineering Louisiana State University Engineering Equation Solver Tutorials.
Copyright (c) Bani K. Mallick1 STAT 651 Lecture #18.
Matlab Matlab is a powerful mathematical tool and this tutorial is intended to be an introduction to some of the functions that you might find useful.
Dynamical Systems Analysis II: Evaluating Stability, Eigenvalues By Peter Woolf University of Michigan Michigan Chemical Process Dynamics.
Support Vector Machines
Mr Barton’s Maths Notes
Test Preparation Strategies
A quadratic equation is a second degree polynomial, usually written in general form: The a, b, and c terms are called the coefficients of the equation,
START EXCEL BUILD OR RETRIEVE YOUR OPTIMIZATION MODEL SAVE YOUR WORKBOOK!! CHOOSE “Solver…” IN THE “Tools” MENU SPECIFY IN SOLVER DIALOG BOX: 1.CELL TO.
CMPS1371 Introduction to Computing for Engineers NUMERICAL METHODS.
1 Tips for solving Project 1 Reactor SO 3 SO 2 +O 2.
An Introduction to Programming and Algorithms. Course Objectives A basic understanding of engineering problem solving process. A basic understanding of.
Hydroinformatics: Session4 Dr Ivan Stoianov Room 328B Dr Andrew Ireson (Room 304) Mr Juan Rodriguez-Sanchez (411A) Mr Baback.
Physics 114: Exam 2 Review Lectures 11-16
hoe Last viewed 1 PowerPoint Slide Show (.pps) You can advance through each part of the screen by left clicking When you see the at the top right of the.
Computer Programming TCP1224 Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
MATLAB Basics. The following screen will appear when you start up Matlab. All of the commands that will be discussed should be typed at the >> prompt.
Lecture 1 - Introduction June 3, 2002 CVEN 302. Lecture’s Goals General Introduction to CVEN Computer Applications in Engineering and Construction.
Chapter 2: First Steps in MuPAD MATLAB for Scientist and Engineers Using Symbolic Toolbox.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
An Introduction to MathCAD Finding Solutions and Symbolic Maths.
Introduction to MATLAB 7 Engineering 161 Engineering Practices II Joe Mixsell Spring 2010.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation
MATLAB Harri Saarnisaari, Part of Simulations and Tools for Telecommunication Course.
IT1005 Lab session on week 9 (5 th meeting) Good Friday and Happy Easter to all students, especially for those who understand the meaning and celebrate.
Getting Started with MATLAB (part2) 1. Basic Data manipulation 2. Basic Data Understanding 1. The Binary System 2. The ASCII Table 3. Creating Good Variables.
Introduction to MATLAB Session 4 Simopekka Vänskä, THL 2010.
A string is an array of characters Strings have many uses in MATLAB Display text output Specify formatting for plots Input arguments for some functions.
Introduction to MATLAB 7 MATLAB Programming for Engineer Hassan Migdadi Spring 2013.
IT1005 Lab session on week 11 (7 th meeting) 1 or 2 more weeks to go…
SEM Basics 2 Byrne Chapter 2 Kline pg 7-15, 50-51, ,
Introduction to MATLAB 7 Engineering 161 Engineering Practices II Joe Mixsell Spring 2012.
Recap Cubic Spline Interpolation Multidimensional Interpolation Curve Fitting Linear Regression Polynomial Regression The Polyval Function The Interactive.
Polynomials, Curve Fitting and Interpolation. In this chapter will study Polynomials – functions of a special form that arise often in science and engineering.
 In this packet we will look at:  The meaning of acceleration  How acceleration is related to velocity and time  2 distinct types acceleration  A.
Algorithms and Pseudocode
University of Colorado Boulder ASEN 5070 Statistical Orbit determination I Fall 2012 Professor George H. Born Professor Jeffrey S. Parker Lecture 9: Least.
CSSE463: Image Recognition Day 14 Lab due Weds. Lab due Weds. These solutions assume that you don't threshold the shapes.ppt image: Shape1: elongation.
“Moh’d Sami” AshhabSummer 2008University of Jordan MATLAB By (Mohammed Sami) Ashhab University of Jordan Summer 2008.
CN – Kinematic Graphs What is kinematics? 3 types of Kinematic Graphs.
Week 1 Real Numbers and Their Properties (Section 1.6, 1.7, 1.8)
AP PHYSICS 1 SUMMER PACKET Table of Contents 1.What is Physics? 2.Scientific Method 3.Mathematics and Physics 4.Standards of Measurement 5.Metric System.
Introduction to MATLAB
(Mohammed Sami) Ashhab
Kinematics Vectors and Motion
Curve fit metrics When we fit a curve to data we ask:
Curve fit metrics When we fit a curve to data we ask:
Coordinate Transformation in 3D Final Project Presentation
Introduction to MATLAB
Presentation transcript:

Lab session on week 13 (9th/last meeting) After this, good bye… IT1005

Agenda Review of Lab 8 Full review of IT1005 syllabus A very very quick review of fmincon. Mind mapping, in 10 minutes Past year paper discussion

Lab 8 - Review Q1. A. fzero to find roots. You are looking for positive root, then do not start fzero using negative guess, e.g. -1000? Q1. B. fzero with parameter c. Plot c and roots. Loop through various value of c, call fzero for each different c! Q1. C. Use polyfit to fit the resulting plot of Q1. B. 4th or 5th order polynomial is already sufficient. This is a bit subjective though. Q2. A. function that counts least square error of the y data and the y model. Geek version can be used here. Q2. B. using fminsearch to find k1, k2, k3 that minimize the function value created in Q2. A. k1 = 5, k2 = -0.2, k3 = 7 Your plot of y data and y model should more or less fit with each other!

Application 7: Optimization How to use fmincon: Create a dedicated function to compute the objective value as usual. [x f] = fmincon(@(x) function_handle(x), IGs, A, B, C, D, LB, UB); IGs = a column vector of Initial Guesses for x. A, B = the inequality constraints, written like Linear Algebra standard format. C, D = the equality constraints LB, UB = the lower bound and upper bound for each variable x. This technique is not tested anywhere else so probably appear in the final exam…

Full Review of Our IT1005 (1) This is the “linear version”, the “first part” of the semester: Top Down Design: Big Steps (at least input/process/output), Small Steps. This is called “programming methodology” (method to do programming). Introduction to Matlab environment, a powerful software! Data structure: simple variables (1x1 matrix); matrix/array/vector (+ manipulation!). Remember that Matlab (and computer) is imprecise (floating point). Basic commands: input, disp, sprintf, maths (BODMAS, logical/relational), %, etc. Debugging tool: breakpoint, workspace, etc. Control Structure: Sequence, Decision (if-elseif-else/switch-case/try-catch), Repetition (for/while). Function: M-files, Modularize your program The art of coding: Indentation, white spacing, no trivial comments, modular. Mathematical modeling: Spidey fall, car up in a slope, etc.

Full Review of Our IT1005 (2) This is the “linear version”, the “second part” of the semester: Applications (solvers): Roots Finding (roots, fzero, fsolve, solve), Linear Algebra (A-1*b, \), Symbolic Maths (syms, diff, int, expand, factor, solve, etc), plotting tools (plot, title, xlabel, ylabel, legend, subplot), Ordinary Differential Equations: IVP (ode45, ode15s, etc), Math (sin, quad, abs, etc), Curve Fitting (polyfit, polyval), Optimization (fminsearch, fmincon), etc To use solvers like fsolve, ode45, ode15s, fminsearch, fmincon, you need to write a dedicated function M-file that has peculiar syntax but standard. function retVal = fun_name(x) retVal(1) = do something with x(1); … retVal(numel(x)) = do something with x(numel(x)); retVal = retVal’; % always return a column vector. To use fzero, fsolve, fminsearch, fmincon, etc, you need to supply “initial guess”, wrong guess will lead to non solution (fzero, fsolve) or local optima (fminsearch, fmincon).

Full Review of Our IT1005 (3) This is the “linear version”, link to the “future”: Those that you have just learned in IT1005 are still ‘on surface’, just ‘tip of the iceberg’. We spare you from gory details until level 2 or level 3 :D. Actually, we have looked at some details already  mean/var  ah, more or less the same with our my_mean/my_var sort  a much better version than our bubble sort my_sort2 ode45  eulerODE, just that more precise and faster. quad  a better version than traprule2. polyfit  we have simulate this using fminsearch to get least square fit. etc In the future, (perhaps) you will learn the following stuffs: Newton-Raphson, Runge-Kutta, etc, in module CNXXXX, CNYYYY, bla bla… A better way to explain this is via mind map (do you know this?) http://www.comp.nus.edu.sg/~stevenha/myteaching/IT1005_mindmap.png

Past Paper Discussion We only have one sample, Apr/May 2007. But note that last year, the lecturers were the same! So, similar style is expected. I give 15 minutes for you all to read the past papers for those who have not do so. Go to my website/NUS digital library to download the past paper. For those who have done past paper, do the question in the next slide! We will then discuss the answers until time is up.

Extra Question Robin hood is standing on a rock with height H. Assuming his hand is about 1 m above that rock, that means the arrow has initial height H+1. Then Robin shots his arrow at angle A radian with initial velocity IV… Create a Matlab program to simulate this physical model, and tell us what is the distance x? (assume g = 9.8 m/s2) If H = 10m, A = 30 degrees (convert to radian), IV = 30m/s. If H = 10m, A = 60 degrees (convert to radian), IV = 30m/s.

Combining Motion Vy = V*sin(A)  vertical component Vx = V*cos(A)  horizontal component Remember that A must be in radians! H = h0 + Vy*t – 1/2*g*t^2 Find t, the time for the arrow to hit the ground, starting from h+1… Use roots to get the root t of this simple 2nd order polynomial. Take the positive root t. x = Vx*t; Multiple the positive root t with Vx to get the horizontal displacement x.

What is the style of past paper? It starts with some MCQ… MCQ tends to confuse us, many answers seems ok? Trick to do better for MCQ questions: remove the impossible options first (options that you are 100% sure that they are wrong). If you are left with one option, quickly select it. But if you still have more than one options, do the next questions first, at the end of the test, re-do it again or do roulette wheel selection or coin flip, this is better than using your (often misleading) assumptions! With 3 essays that do not look like programming test at the beginning. Math/Physics/Chemical Engineering questions in computer model. So, it is best to revisit some of your A-level knowledge! You need to be able to write Matlab code “OFFLINE”! So, improve your ability to write/understand Matlab code WITHOUT using Matlab itself!

Good Bye Okay guys/gals, this is our last meeting for this semester. If we happen to bump into each other (perhaps at engineering canteen), do not forget to say hi . If I have said wrong things… please accept my apology… I hope that you have learned a lot from this course. Not just the technical stuffs, but also the other moral values like: Do not plagiarize. Submit on time, punctual during classes. Buy ORIGINAL Matlab!, etc. All the best for your future endeavor as a chemical engineer. Use Matlab for your programming/mathematical related tasks.