chapter 13: solving equations
DESCRIPTION
Chapter 13: Solving Equations. MATLAB for Scientist and Engineers Using Symbolic Toolbox. You are going to. See that MuPAD solves algebraic equations and differential equations Plot the solution curve of the differential equations - PowerPoint PPT PresentationTRANSCRIPT
Chapter 13:
Solving Equations
MATLAB for Scientist and Engineers
Using Symbolic Toolbox
2
You are going to See that MuPAD solves algebraic equations
and differential equations Plot the solution curve of the differential
equations Experience some chaotic systems described
by a set of nonlinear differential equations.
3
Polynomial Equations
solve does it all Solution Target
=0 is the default
Not a simple closed form solution
Numerical values
4
Set of Linear Equations
Under-determined equations
Verifying the solutions
evalAt operator
5
Set of Nonlinear Equations
6
Solving with Assumptions
Give some constraints on solutions
7
Exercise 1
Compute the general solution of the system of linear equations
How many free parameters does the solution have?
8
Infinite Number of Solutions
General Solutions
No Symbolic Solution? Try Numerical Solution.
9
Inequalities
Some Region is the Solution
Checking the Region
10
Differential Equations
ode and solve 1st Order
2nd Order
11
ODE with Initial Conditions
Initial Conditions
with different Initial Values
12
Exercise 2
Solve the following ODE for different values of a=-2, 0,+2 and plot the solutions.
13
Set of Differential Equations
14
Numerical ODE Solver
Original ODE Matrix Form
Matrix form ODE function
Numeric solution at t=1 initial value
time duration
15
Plotting Numerical ODE Solution
plot::Ode2d
with Mapping function
16
Ode3d with 3D Mapping
plot::Ode3d
17
Chaotic System
Lorenz attractor
Parameters of Lorenz attractor
Initial Condition
Plot Generator
18
Ode2d - Plot
Lorenz attractor (cont.)
Initial points are nearly the same.
19
Ode3d
Lorenz attractor (cont.)
20
Numerical Solution at a Point
Lorenz attractor (cont.)
1t
10t
100t
Chaotic System
21
Exercise 3
Compute the general solution y(x) of the differen-tial equation y′ = y2/x .
Determine the solution y(x) for each of the follow-ing initial value problems:
22
Exercise 4
Draw the 3-D trajectory of the solution of the fol-lowing system of ordinary differential equations in x(t), y(t), z(t) assuming the initial conditions of x(0)=1, y(0)=0.1, z(0)=-1.
23
Difference Equations
Arithmetic Sequence
24
Difference Equation - Geometric
25
Difference Equations
General Solution
With Initial Conditions
26
Exercise 5
The Fibonacci numbers are defined by the recurrence Fn = Fn−1 + Fn−2 with the initial val-ues F0 = 0, F1 = 1. Use solve to find an ex-plicit representation for Fn.
27
Key Takeaways
Now, you are able to solve a set of linear and non-linear algebraic
equations, solve a set of ordinary differential equations, solve a set of nonlinear differential equations nu-
merically and plot them in 2D as well as in 3D space
and to solve difference equations.
28
Notes
solve(x^2+x=y/4,x) solve({x+y+z=3,x+y=2,x-y-z=1},{x,y,z})
solve(sin(x)=1/2)
ode({y'(x)=y(x),y(0)=1}, y(x))
solve( x^2 < 1, x )
plot::Ode2d(..)solve(ode(y''(t)=-3*y'(t)-2*y(t)+2*t^2, y(t)))
numeric::odesolve(f, 0..1,Y0)
plot::Ode3d(..) eqn := rec(y(n+2)=y(n+1)+2*y(n), y(n))
plot::Curve2d(..)