Math 210 Assignment 6
Due: Friday, February 15, 2013
The homework comes in two parts, A & B. Each part will be graded
out of ten points.
Part A answers are to be written by hand and submitted to the instructor during the Friday lecture.
Part B is to be
Math 210 Assignment 1
Due: Friday, January 11, 2013
The homework comes in two parts, A & B. Each part will be graded
out of ten points.
Part A answers are to be written by hand and submitted to the instructor during the Friday lecture.
Part B is to be
Lesson 8: Iteration: cycles and basins
restart;
@ and $
The @ that we used for iterating a function can also be used for higher derivatives in the D style.
Just as (g@3)(x) is g(g(g(x), (D@3)(f) is D(D(D(f), i.e. the third derivative of the
function f. Fo
Introduction to Maple
Maple is a very powerful Computer Algebra system that can do many of the calculations that you
might encounter in many branches of mathematics, science and engineering. We'll look at some of its
capabilities. Maple has two modes: "Do
Lesson 3: Solving Equations; Floating-point
Computation
restart;
A hard equation
Last time we were looking at this equation.
eq := x * sin(x) = Pi/2;
(1.1)
(1.1)
Maple didn't know the solutions.
solve(eq,x,AllSolutions);
(1.2)
Maple doesn't know the solut
More Maple Commands - I
O restart
Functions, Expressions and Polynomials
Recall that normal assignment defines an expression
O f d x2 K 3 x C 2;
f := x2 K 3 x C 2
(1.1)
(1.1)
Without the : in the := it would think that this was an equation, with f another
Lesson 4: Numerical Computations; Newton's
method
restart;
Catastrophic cancellation in the quadratic formula
One case where roundoff error can be severe is if you subtract two numbers that are very close
together: the relative error of the result can be
More Maple Commands - II
First, a few things from last time.
O f d x6 C 5;
f := x6 C 5
(1)
(1)
Notation for higher derivatives of expressions
O diff f, x$2 ;
30 x4
(2)
(2)
Taylor series
O taylor exp x , x = 1, 2 ;
eC e x K 1 C O
xK1
In the lecture, we wil
Maple Commands to Solve Differential Equations
Solving the logistic equation
O logistic d diff u t , t = u t $ 1 K u t ;
d
logistic :=
u t =u t
dt
1Ku t
(1)
O dsolve logistic, u t ;
ut =
1
t
1 C eK _C1
In the expression above, _C1 is an arbitrary constant
Lesson 6: Iteration
> restart;
Iteration
Newton's method is a particular case of an iteration method. In general, iteration deals with a
sequence defined by
for some function . The study of iterations, also called discrete
dynamical systems, is a very act
Lesson 5: Newton's method
restart;
Newton's method
Newton's method is a method of approximately solving an equation, say
. We start with
an initial guess , and Newton's method produces a sequence of numbers , , . that converges
very rapidly to a solution
Solving Differential Equations Numerically in Maple
O restart;
Let's remind ourselves of how to solve DEs analytically with Maple.
We are still remaining in the scalar, autonomous DE case.
O de1 d diff u t , t = u t
2
;
de1 :=
d
u t =u t
dt
2
(1)
(1)
O ic
Lesson 2: Variables, Assignment and Equations
Maple has extensive graphics capabilities. Here's a graph of a function.
plot(x^2 - 3*x - 4, x = -2 . 5);
6
4
2
0
1
2
3
x
A 3-dimensional graph:
plot3d(x^2 - y^2, x = -2 . 2, y = -2 . 2);
4
5
An animation:
plo
Finding Roots of Vector Systems
Doing one Vector Newton Step
Eigenanalysis
O restart
Let's consider roots of the following system
O f d x2 $y5 K x5 $y2 C exp x$y K 1 ;
f := x2 y5 K x5 y2 C ex y K 1
(1)
(1)
O g d x$y3 C x2 $y2 C x3 $y K 3;
g := x y3 C x2 y
Investigating Iterative Maps in Maple
and an introduction to Maple procedures
O restart;
Simple example of an iterative map, considered on [0,1]
O g d x/x2 ;
g := x/x2
(1)
Graph it along with the line y=x
O with plots :
O Curves d plot x, g x , x = 0 .1,
Math 210 Computer Lab #4
Tuesday, February 5, 2013
This is a test environment. Do not send e-mail while doing the lab.
You may consult any internet sites, your notes and books and access
any online help les.
Do all four questions below in a maple works
Roots of Functions, Differentiation and Plotting: Part II
Bisection Method, first look
Bisection method to find the square root of 2, with a=1 and b=2 bracketing the root
O a d 1;
a := 1
(1)
O b d 2;
b := 2
(2)
3
2
(3)
(3)
Compute the midpoint of the inte
Math 210 Computer Lab #10
Tuesday, March 26, 2013
This is a test environment. Do not send e-mail while doing the lab.
You may consult any internet sites, your notes and books and access
any online help les.
Submit the MATLAB .m les requested in the thr
Math 210, Spring 2013
Lab Quiz #3 solutions
O restart;
Q#1
Enter the function below, then the answers are just one line Maple commands
O fd
cos x2
;
x4 C 1
f :=
cos x2
(1)
(1)
x4 C 1
(a)
O plot f, x = 3 .5
0.006
0.004
0.002
0
K
0.002
3.5
4
x
4.5
5
K
0.004
Math 210, Spring 2013
Lab Quiz #2 Solutions
Remember that 2 marks for lab quizzes are given for presentation. Some text discussion of the commands
you use is needed to get full marks.
Q#1
O f d exp cos x ;
f := ecos
x
(1)
O taylor f, x = 1, 3
ecos
1
K eco
Math 210 Computer Lab #5
Tuesday, February 12, 2013
This is a test environment. Do not send e-mail while doing the lab.
You may consult any internet sites, your notes and books and access
any online help les.
Do all four questions below in a maple work
Math 210, Spring 2013
Lab #4 Solutions
O restart;
Q#1
Specify the function as an expression, proceed.
O f d sin exp x C 1 ;
f := sin ex C 1
(1)
(1)
Remember T3 has 4 terms
O taylor f, x = 2, 4 ;
2
1
1
sin e2 C 1 e2 C
cos e2 C 1 e2
2
2
2
3
12
1
e2 C cos e2
Maple and Math Courses
Here are examples of some typical problems from some 200 and 300 level Math courses
at UBC, and how Maple might be used to help solve them.
Math 200
Let D be the region inside the polar curve
following integral:
and above the x axis
Math 210, Spring 2010
Computer Lab #5 Solutions
O restart
Q #1
Standard dsolve using the numeric option
O de d diff u t , t = exp sin u t ;
de :=
d
u t = esin
dt
ut
(1)
O ic d u 0 = 1;
ic := u 0 = 1
(2)
(2)
Save the result for use in #3
O numsol d dsolve
Math 210 Computer Lab #6
Tuesday, February 26, 2013
This is a test environment. Do not send e-mail while doing the lab.
You may consult any internet sites, your notes and books and access
any online help les.
Do all four questions below in a maple work
Math 210 Computer Lab #7
Tuesday, March 5, 2013
This is a test environment. Do not send e-mail while doing the lab.
You may consult any internet sites, your notes and books and access
any online help les.
Do all four questions below in a maple workshee
Math 210 Computer Lab #8
Tuesday, March 12, 2013
This is a test environment. Do not send e-mail while doing the lab.
You may consult any internet sites, your notes and books and access
any online help les.
Submit the MATLAB .m les requested in the two
Math 210 Computer Lab #9
Tuesday, March 19, 2013
This is a test environment. Do not send e-mail while doing the lab.
You may consult any internet sites, your notes and books and access
any online help les.
Submit the MATLAB .m les requested in the thre
Math 210 Computer Lab #11
Tuesday, April 2, 2013
This is a test environment. Do not send e-mail while doing the lab.
You may consult any internet sites, your notes and books and access
any online help les.
Submit the MATLAB .m les requested in the two
Math 210, Spring 2013
Computer Lab Quiz #6 Solutions
Q#1
Enter the equations and then solve.
Note that a matrix vector specification of the problem can also be done
O eq1 d s C t C u C v = 1;
eq1 := s C t C u C v = 1
(1)
(1)
O eq2 d s C 2$ t C 3$ u C v =