MAT 4830 Mathematical Modeling Section 1.2 Simple Programming

Slides:



Advertisements
Similar presentations
Today’s Date: 3/25/ Applications of Logarithms.
Advertisements

Chapter 3 Mathematics of Finance
Annuities and Sinking Funds
Section 1.1, Slide 1 Copyright © 2014, 2010, 2007 Pearson Education, Inc. Section 8.4, Slide 1 Consumer Mathematics The Mathematics of Everyday Life 8.
Time Value of Money (CH 4)
2-1 CHAPTER 2 Time Value of Money Future value Present value Annuities Rates of return Amortization.
Section 1.1, Slide 1 Copyright © 2014, 2010, 2007 Pearson Education, Inc. Section 8.4, Slide 1 Consumer Mathematics The Mathematics of Everyday Life 8.
Mathematics of finance
Vahé Karamian Python Programming CS-110 CHAPTER 2 Writing Simple Programs.
Appendix – Compound Interest: Concepts and Applications
2-1 CHAPTER 2 Time Value of Money Future value Present value Annuities Rates of return Amortization.
Chapter 3 Mathematics of Finance Section 3 Future Value of an Annuity; Sinking Funds.
EXAMPLE 4 Choose a solution method Tell what method you would use to solve the quadratic equation. Explain your choice(s). a. 10x 2 – 7 = 0 SOLUTION a.
1 Learning Objectives for Section 3.2 After this lecture, you should be able to Compute compound interest. Compute the annual percentage yield of a compound.
Warm Up 1) Is (-3, 4) a solution to the system? 2)Solve the system by graphing y = -2x + 5 2y = x - 2.
Financial Literacy Banking, Financing, Investing, and Planning for your Future.
EXAMPLE 2 Finding a Base Marc received 273, or 35%, of the votes in the student council election. How many students voted in the election? Student Council.
The Time Value of Money Compounding and Discounting Single Sums.
Do Now 4/23/10 Take out HW from last night. Take out HW from last night. Practice worksheet 7.6 odds Practice worksheet 7.6 odds Copy HW in your planner.
Exploring Exponential Growth and Decay Models Sections 8.5 and 8.6.
Time Value of Money 2: Analyzing Annuity Cash Flows
OBJECTIVE AFTER STUDYING THIS SECTION, YOU WILL BE ABLE TO FIND THE VOLUMES OF RIGHT RECTANGULAR PRISMS AND OTHER PRISMS. YOU WILL BE ABLE TO FIND THE.
Munster Programming Training
 Rewriting literal equations  Rewrite and use common formulas.
Section 4.1 Logarithms and their Properties. Suppose you have $100 in an account paying 5% compounded annually. –Create an equation for the balance B.
Warm up. Solution Why do we care? Logarithms are functions that used to be very helpful, but most of their value has become obsolete now that we have.
Warm-up 1.Find f(12). 2.f(x)=140. Find x.. Answer 1.f(12) = 1 2. f(9) = 140.
CHAPTER 5 Time Value of Money (“TVOM”)
Write the equation of the line…. Write the equation of the line… Through (4, 5) and (6, 9)
Do Now 3/2/10  Take out HW from last night. Greatest Common Factor worksheet #34 Greatest Common Factor worksheet #34  Copy HW in your planner. Text.
Excel: Basic Math Functions Computer Information Technology Section 6-5 Some text and examples used with permission from: Note:
CTS130 Spreadsheet Lesson 19 Using What-If Analysis.
MAT 1234 Calculus I Maple Lab 0. Preview Look at how to use MS Word to type the lab reports Finish a simple lab in class.
Lesson 7.6 Concept: How to find simple interest Guidelines: When you compute simple interest for a time that is less than 1year, write the time as a fraction.
B1: I can calculate simple interest on a bank account.
Notes Over 7 – 7 Solve for the indicated variable.
MAT 4725 Numerical Analysis Section 1.4 Loops with “do” statements
Essential Question: How do you use the quadratic formula and the discriminant? Students will write a summary including the steps for using the quadratic.
MAT 1234 Calculus I Section 3.7 Part I Optimization Problems
Factor. 1)x² + 8x )y² – 4y – 21. Zero Product Property If two numbers multiply to zero, then either one or both numbers has to equal zero. If a.
7-7 Simple and Compound Interest. Definitions Left side Principal Interest Interest rate Simple interest Right side When you first deposit money Money.
© 2003 The McGraw-Hill Companies, Inc. All rights reserved. Discounted Cash Flow Valuation Chapter Six.
Solving Quadratic Equations – Quadratic Formula The following shows how to solve quadratic equations using the Quadratic Formula. A quadratic equation.
CSC 111. Solving Problems with Computers Java Programming: From Problem Analysis to Program Design, Third Edition3 Solving Problems Stages 1.Problem.
Notes Over 5.6 Quadratic Formula
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
Unit 7.4 Introduction to modelling & presenting numeric data Lesson 1 Setting up a basic spreadsheet.
Section 1.4 Day 1 – Quadratic Equations No Calculator After this section you should be able to: Solve quadratic equations by FACTORING.
Section )by graphing (using the calculator to identify the roots (x-intercepts)) 2)by factoring 3)by “completing the square” 4)by Quadratic Formula:
MAT 1235 Calculus II Maple Lab 1. Team... 2 persons per team One report per team No discussions between teams At least one person in each team knows Maple.
Do Now Solve using elimination: 3x + 2y = – 19 – 3x – 5y = 25.
10/23 More interest Compound interest formula A =.
Complex Numbers and Equation Solving 1. Simple Equations 2. Compound Equations 3. Systems of Equations 4. Quadratic Equations 5. Determining Quadratic.
Section 8.3 Compound Interest Math in Our World. Learning Objectives  Compute compound interest.  Compute the effective interest rate of an investment.
Time Value of Money Chapter 5  Future Value  Present Value  Annuities  Rates of Return  Amortization.
Learning to use a ‘For Loop’ and a ‘Variable’. Learning Objective To use a ‘For’ loop to build shapes within your program Use a variable to detect input.
Simple Interest.
Do Now Use the standard form of a quadratic equation to find the a, b and c of each equation. ax2 + bx + c = 0 x2 – 6x + 10 = 0 2x2 + 3x + 4 = 0 x2 –
Introduction to Programming
Chapter 3 Mathematics of Finance
IGCSE 6 Cambridge Effectiveness of algorithms Computer Science
Systems of Multivariable Equations
MAT 4725 Numerical Analysis
Basic operations in Matlab
Class Notes 11.2 The Quadratic Formula.
Introduction to Programming
Problem of the Day Factor the following: x2 – 16 x2 + 7x + 12
Introduction to Programming
Turn in homework MGSE8.G.9 Apply the formulas for the volume of cones, cylinders, and spheres and use them to solve real-world and mathematical problems.
Presentation transcript:

MAT 4830 Mathematical Modeling Section 1.2 Simple Programming

Maple Standards Always work in the worksheet mode.

Maple Standards Always work in the worksheet mode. Always use the Text mode to type your program (press the Text button).

Maple Standards Since your program is in text, it can be copy-and-paste to WORD as text. And your program is editable in WORD.

Maple Standards Make sure the font is not too small. Always print in color. Use separate boxes for program and output. Make sure you pay attention to the test cases and the exact format for the input data.

Questions 1. What are the 3 components of a computational task?

Questions 2. What is the function of “#” ?

Questions 3. Name the context of one example.

Today… Zeng 1.2 It may be really easy and fast for some of you. Be patient.

Zeng 1.2 Introduces the basic elements of Maple programming Open your Maple now (because it takes so long…)

Maple Use ONLY worksheet mode. In HW, you need to cut-and-paste your program/results from Maple. Sometimes, strange things happen…

Maple I will explain how things work. Understand how computer works help you a long way in programming. Do not type into Maple until I tell you to do so.

Example 0 Find the volume of a (circular) cylinder volume=(base area)(height) base area=  (radius 2 )

Computational Task 3 Components 1. Data 2. Computational Method 3. Results

Example 0

Program A program is an implementation of the computational method for the task.

Example 0 cylindervolume:=proc(radius,height) # program definition local basearea, volume; # local variables basearea:=Pi*radius^2; # compute the base area volume:=evalf(basearea*height); # compute the volume print(`The volume is`); # output result print(volume); end;

Example 0 > cylindervolume(5.5,8.2); The volume is cylindervolume:=proc(radius,height) # program definition local basearea, volume; # local variables basearea:=Pi*radius^2; # compute the base area volume:=evalf(basearea*height); # compute the volume print(`The volume is`); # output result print(volume); end;

Example 0 > r:=5.5: h:=8.2: > cylindervolume(r,h); The volume is cylindervolume:=proc(radius,height) # program definition local basearea, volume; # local variables basearea:=Pi*radius^2; # compute the base area volume:=evalf(basearea*height); # compute the volume print(`The volume is`); # output result print(volume); end;

Good Practices Be sure to use Indentations Empty lines A lot of meaningful comments

Example 1 The future value of an annuity: Suppose you make a periodic deposit $R to an account that pays interest rate i per period, for n periods, then the future value $S of the account after n periods will be

Example 1 Write a program to calculate the worth of a retirement plan at the end of the term if the plan pays an annual rate A, requires monthly deposit $R, for y years. Then use the program to calculate the future value if the monthly deposit is $300, the annual interest rate is 12%, for 30 years.

Example 1 Write a program to calculate the worth of a retirement plan at the end of the term if the plan pays an annual rate A, requires monthly deposit $R, for y years. R=300, A=0.12, y=30, S=? (i=A/12, n=y*12)

Example 1

A program that compute the two solutions of the general quadratic equation with the quadratic formula. Use the program to solve Example 2

A program that compute the two solutions of the general quadratic equation with the quadratic formula. Use the program to solve Example 2

Note: Comments are left out to save time and space. In your HW, you need to put in a lot of comments.

Example 2

What is not working in Zeng… Cannot use underscore as shown in Zeng e.g. cylinder_volume:=proc(radius,height)

Homework Download from the web (individual HW**) Read Zeng Section 1.3