Lab session on week 12 (8th meeting) 1 more week to go…

Slides:



Advertisements
Similar presentations
Survey/Preview Question Read Recite Review
Advertisements

MATLAB EXAMPLES Initial-value problems
EXAMPLE 1 Standardized Test Practice SOLUTION Substitute several values of h into the equation C = h and solve for C.Then identify the table that.
Scientific Method.
Warm-Up  Welcome Back!  Please get out your Raven Book.  Silently copy down the week’s schedule (blue) AND homework (red)!
Agenda Week 3 9/10 – 9/14 By PresenterMedia.comPresenterMedia.com.
Welcome to 8 th Grade Math at Lanier Middle School! My name is Ms Cooper.
Lecture 1: Basics of Math and Economics AGEC 352 Spring 2011 – January 12 R. Keeney.
COS/PSA 413 Day 26. Agenda Assignment 4 Corrected –Wide disparity –Expected 3-4 pages Some only gave me a page or a paragraph –3 A’s, 2 B’s, 2 C’s, 2.
Determine whether each curve below is the graph of a function of x. Select all answers that are graphs of functions of x:
Group project: Hypothesis testing. Rules of the project 1- Groups of four points for the written report 3- 7 points for the oral presentation 4-
Question What to do if there are two drivers for a signal occuring in various moments of time?
Please open your laptops, log in to the MyMathLab course web site, and open Quiz 3.6B. IMPORTANT NOTE: If you have time left after you finish the problems.
First-Year Engineering Program Performance Test 1: Design Concept Comparisons Objective and Goals Lab Procedure Analysis Test Readiness Review.
Area of a single trapezoid = h
21: Simpson’s Rule © Christine Crisp “Teach A Level Maths” Vol. 1: AS Core Modules.
B.1.6 – DERIVATIVES OF EXPONENTIAL FUNCTIONS
How Do I Round Numbers to the Nearest 10, 100, 1000?
CS 123 Computational Lab IIl Spring 2008 Department of Computer Science Drexel University Copyright by the authors. Permission is given for students and.
Welcome to 8 th Grade Math at Lanier Middle School! My name is Ms Cooper.
1 Introduction to Engineering Second Semester Overview Agenda Team Assignments and Information Exchange Course Overview.
LEISURE AND TOURISM. TODAYS QUESTIONS.. 1.What are the differences between leisure and tourism? 2.How much leisure time do you have?
If the integral cannot be evaluated, we can use an approximate method.
Welcome to Physics 2015! ( General Physics Lab 1 - Fall 2012)
Synthesis ENGR 1181 MATLAB 11. Topics  No new material  Covers topics that will be on the Midterm 2 Exam MATLAB 01 – Program Design MATLAB 02 – Introduction.
Normal Distributions and Standard Deviation IMP4 Ms. Sia
TEST INFORMATION & REVIEW September 28, Camera checkout Requirements –Pass Part 1 with a 70% or better 35 points out of 50 –Pass Part 2 with a 80%
Line of Best Fit 4.2 A. Goal Understand a scatter plot, and what makes a line a good fit to data.
Honors Physics 13 Oct 2009 Review of motion in one dimension – please have your review sheet and questions (in compositionn books) Preview motion in 2-D.
Lab # 3: The Programmable Robot General Engineering Polytechnic University.
Math 11 Mr. Jean March 1 st, The plan: Video clip of the day Finding the transformations Re-arranging trigonometric equations from general to standard.
SESSION 5. 17/11/15. EndNote Answer the following questions:
PART I: LET’S CHECK OUT SOME CELLS LEARNING TARGETS: 1. I can observe a variety of different types of cells. 2. I collect data about my observations by.
Introduction to Statistics for the Social Sciences SBS200, COMM200, GEOG200, PA200, POL200, or SOC200 Lecture Section 001, Fall 2015 Room 150 Harvill.
Homework Sec. 1.3 # 16, 29, 40, 48, I like to get rid of the fractions by multiplying both sides by the LCD. Then I get all the variables on one.
Introduction to Statistics for the Social Sciences SBS200, COMM200, GEOG200, PA200, POL200, or SOC200 Lecture Section 001, Fall 2015 Room 150 Harvill.
Welcome Back! Today: – Test Corrections (Unit 4) All test corrections will be extra credit for this quarter in the “Test/Quiz” Category You have until.
Physics 102: Lecture 6, Slide 1 Important Announcements Makeup lecture #5 –Video of lecture available online (see course website) –Homework #3 now due.
Work, power, energy review Exam tomorrow over work, power, and energy. Study for the test. This ppt will be posted on my website at the end of the day.
Today’s Agenda Quick Quiz(zes) Your TA Course/Section Administration –Resources for Students –Homework and Grading Questions? (HW 0?) Syntax vs. Semantic.
Stoichiometry Consolidation Agenda Check homework – Various Stoich I Check homework – Various Stoich I –Turn into box today! Work on Various Stoich II.
Data Structures and Algorithms in Java AlaaEddin 2012.
Elimination Method Day 2 Today’s Objective: I can solve a system using elimination.
“How to Think Like a Scientist” Vocabulary. automatically John automatically does his homework as soon as he gets home from school.
CS 2750: Machine Learning The Bias-Variance Tradeoff Prof. Adriana Kovashka University of Pittsburgh January 13, 2016.
Thursday, August 14, 2014 Day 2 Science Starters Sheet 1. Please have these Items on your desk. I.A Notebook 2- Science Starter: Two vocabulary words:
TA Meetings ECE 445: Senior Design - 09/15/15. Overview  Meeting expectations  How to prepare  Evaluation.
Introduction A probability distribution is obtained when probability values are assigned to all possible numerical values of a random variable. It may.
Energy Unit Wednesday, August 21 st Agenda: Continue Rituals and Routines Take Energy Unit/Chemical Interactions Diagnostic. Discuss reasons.
Warm-Up Exercises Warm-up: Countdown to Mastery Week #4 Homework- Page 44 #3-9 all #14-21 all.
Agenda 12/7/15 kleinisd.net/Campuses/Doerre/Teachers/Science/pgreen  WRITE HW IN AGENDA:  None  1. Warm-up in JOURNAL:  Study Silently for Benchmark.
Public Policy analysis VAC CLASSES 2017
Additional Homework Assignment due next week in class.
Cube and its properties
NOTEBOOK ENTRY: Do you think volcanoes and earthquakes are related
Problem Solving Lab – Part C
(This is the slope of our tangent line…)
Boise State University
Bellwork Directions: 1) Copy the sentence. 2) Correct the errors in the sentence. 3) Underline the words or phrases that provide clues to the meaning.
“Teach A Level Maths” Vol. 1: AS Core Modules
Evaluate the limit: {image} Choose the correct answer from the following:
Introduction to Statistics for the Social Sciences SBS200 - Lecture Section 001, Fall 2018 Room 150 Harvill Building 10: :50 Mondays, Wednesdays.
“Teach A Level Maths” Vol. 1: AS Core Modules
Figure 11-1.
Figure Overview.
“Teach A Level Maths” Vol. 1: AS Core Modules
Figure Overview.
“Teach A Level Maths” Vol. 1: AS Core Modules
ME 123 Computer Applications I Lecture 25: MATLAB Overview 4/28/03
Week of February 11, 2019: Monday, February 11:.
Presentation transcript:

Lab session on week 12 (8th meeting) 1 more week to go… IT1005 We will take class photo today! At the end of the 1st hour of this session…

This Week’s Agenda Discussion of my Term assignment answers. Review on I believe that most of you have seen the same tables (for q1), and the same plots (for q2-3), but do you curious to know what are my (Lab TA) answers compared with yours?  Note, my answers are not 100% correct. This is not official answer! Review on Various ODE IVP solvers, Curve Fitting using Matlab, and The initial part of Optimization using Matlab Overview of Lab 8, our last lab Preview of what is in store for the last week… Class photo :D

Term Assignment – Q1.A Q1. A. Naïve trapezium rule, definitely inaccurate. (b-a)*(f(a)+f(b))/2, f(a) is (f(0)), f(b) is f(1000), the result is very imprecise. Let’s observe the plot of f(t) from 0 <= t <= 1000  Parameter c controls the ‘curvature’ of f(t). Only if c = 0.001 then naïve trapezium rule still give a good approximation. When c is larger, the ‘error’ around this area is bigger Wrong if you draw a triangle here! Note that the y axis start from 0.5! We should draw a trapezium 

Term Assignment – Q1.B Q1. B. More precise trapezium rule, larger n should be ‘more precise’. But why all n produces similar values between Matlab ‘quad’ (likely correct) and my traprule2 (likely not ok)? You get no error because the tested integral range is from -10 to 10 and the graph is ‘special’ (symmetrical) (positive-negative errors cancel each other). That is how you should explain why there is no error. If you change the range of your integral, you will see differences! If you do this, you can show that n = 2 is definitely imprecise. The error from larger/slower n (where it should logically be more precise) is likely because of floating point error around t = 0. Larger n is still better (and slower) for most cases. You can also mention that there is no major effect of increasing n when t is far from 0 for this f(t) with high c.

Term Assignment – Q2.A-B Q2. A. IVP, IVs = [0.1; 0.1] Q2. B. Interpretation of the plot: the population change periodically (roughly every 5 years), population curve of the predator (lion) is steeper and trails the curve of prey (zebra) by a bit. Bla bla (tell some nice story)… Tricky question: which ODE solver should I use for this case? No major difference between ode45 and ode15s for 10 years… Pick the faster solver then… ode15s? Note: I initially thought ode45 is faster… Some students from Friday groups mentioned that ode15s is actually faster…

Term Assignment – Q2.C-D Q2. C. To find steady state solutions, use fsolve or solve (symbolic math), Steady state means both dx/dt = 0 and dy/dt = 0 We have two possible steady states: [x = 0.5, y = 1/3] or [x = 0, y = 0] (both extinct) Q2. D. If you supply any of the two steady state IVs, lion/zebra population will be unchanged over time. The [x = 0, y = 0] can be ignored since it is very trivial. NOTE: for [x = 0.5, y = 1/3], if you write 0.33, the graph may looks curvy (this is imprecise)!

Term Assignment – Q2.E Q2. E. If population of zebra versus lion is plotted, what will we see? A circle (oval/ellipse/egg-shape to be precise)… but which ODE solver that we should use this time? In predator prey relationship, predator depends on the prey to survive. If both has non zero population, their population count will always be on the border of this ellipse. This one looks growing perhaps because of the constants a, b, c, d used in the question. Intermezzo: If prey extinct, predator also extinct soon (no food), but if predator extinct first, prey can survive and even fill the earth (no predator :D), but this model is inaccurate as we omit the death factor of the prey (look at problem description again). Can use different color to show the ‘growth’ ode45 left (steady). ode15s right (growing). Is it because ode15s more precise or what? I think ode15s is better

Term Assignment – Q3.A Q3. A. IVP again, but now 4 ODEs, create a loop to compute the dx/dt. Looking at the differential equation, ri is the birth rate, α is interaction matrix, we know that: Species 1 has average birth (1), but is preyed by/interact with species 2 & 3 (total -2.61) Species 2 has least birth (0.72), but is preyed by/interact with species 3 & 4 (total -1.8), Species 3 has most birth (1.43), but is preyed by/interact with species 1 & 4 (total -2.8), Species 4 has 2nd most birth (1.27), but is preyed by/interact with species 1, 2 & 4 (total -2.07), Looking at the interaction matrix and the plot: Species 1 is likely predator of Species 3 and 4. Species 2 is likely predator of Species 1. Note that there are other ways to describe this plot, e.g. several species competing for the same resource, etc… If you forgot to change r(3) from 1.53 to 1.43, you will see straight lines around here

Term Assignment – Q3.B-C Q3. B. 3-D plot for 3 species, 3-D plot plus 4th axis is color if you want to show 4 species. If these 4 species are alive, their population count will fall on the surface of this mesh. Q3. C. Lotka-Volterra, a study of population dynamics! Open ended… Hard to grade this one…

Application 5: IVP Solvers Matlab has several ODE IVP solvers Which one to use? Generally, ode45, ok for normal cases But if the ODEs are stiff, use the more precise solver ode15s Intermezzo, what do you think the plot of “number of term assignment submitted by students over time” will looks like? A stiff plot :p, perhaps something like this.

Application 6: Curve Fitting This is a graph for my/our research paper (due Friday, 11 Apr 08, 6pm) http://www.cs.mu.oz.au/cp2008 Look at how I use polyfit/polyval.

Application 7: Optimization Hm…, fyi, my research is about optimization too. ‘A little bit’ more complex than what you see in your lecture notes, but the idea is the same: given so many options, choose one option that minimizes (or maximizes) some objective function. e.g. I deal with problems like TSP (Traveling Salesman Problem), n cities, n! possible tours, one of the tour is shortest. How to deal with simple optimization in Matlab Code the function that you want to optimize in a dedicated function, similar like what we have done with fsolve and ODE solver. Call [x, f] = fminsearch(@function_handle, initial_guess); Wrong initial guess will bring us to ‘local optima’ (good, but not the best). Next: fmincon Constraints ‘redefine’ the search space, the global optima may be different than the unconstrained one.

Lab 8 - Overview No ODE (already tested in term assignment), Lab 8 tests fzero (the leftover from Lab 6), polyfit (Curve fitting), and fminsearch (Optimization), in fact, fminsearch is used to do curve fitting. Q1. A-B. fzero, this is the former Lab 6 question 3. If you have not tried this before, do this now! PS: I have taken out my answers from my ppt slides 2 weeks ago. Q1. C. Use polyfit to the results in Q1.B above, and plot the graph. Q2. A. Create a function to compute sum of squared errors. Q2. B. Use fminsearch to find k1, k2, and k3 that minimizes the error in Q2. A and plot the fit. Should be straightforward, you do not need to wait until week 13 to finish this.

What is left for next week? Fiuh… 10% Labs almost done (we still have Lab 8, due on week 13, the last week) I am generous right?, so at least you get [8%..10%] 20% Midterm test done Compare with my modal answer, you should approximately know your score. Assuming you score [10%..15%], your total is now about [18%..25%] 30% Term assignment done Most likely your score will fall in the range of [20%..25%] as long as you submit proper stuffs! So your total is now about [38%..50%] So, ??% out of 60% of IT1005 grade is roughly in your hand Most probably your total is already > 40%, the minimum passing grade (D) If it is, 99% you will pass this module, you can skip exam and still pass (with D or C). So, what left is 40% Final exam to decide your final score… Next week, we will discuss PAST YEAR PAPER (you only have 1 sample). Come, if you want to fight for a good score (B/B+/A-/A/A+) .

Class Photo (1) I always do this every semester You can download our photos here: http://www.comp.nus.edu.sg/~stevenha/myteaching/record.html Photos from my Wednesday classes: 2B 3B 4B

Class Photo (2) Photos from my Friday classes: 5A 7A

Free and Easy Time Now, you are free to explore Matlab to: Do your Lab 8! Review the lessons that you have received during IT1005 course!