Download - Chapter 13: Solving Equations
![Page 1: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/1.jpg)
Chapter 13:
Solving Equations
MATLAB for Scientist and Engineers
Using Symbolic Toolbox
![Page 2: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/2.jpg)
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.
![Page 3: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/3.jpg)
3
Polynomial Equations
solve does it all Solution Target
=0 is the default
Not a simple closed form solution
Numerical values
![Page 4: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/4.jpg)
4
Set of Linear Equations
Under-determined equations
Verifying the solutions
evalAt operator
![Page 5: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/5.jpg)
5
Set of Nonlinear Equations
![Page 6: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/6.jpg)
6
Solving with Assumptions
Give some constraints on solutions
![Page 7: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/7.jpg)
7
Exercise 1
Compute the general solution of the system of linear equations
How many free parameters does the solution have?
![Page 8: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/8.jpg)
8
Infinite Number of Solutions
General Solutions
No Symbolic Solution? Try Numerical Solution.
![Page 9: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/9.jpg)
9
Inequalities
Some Region is the Solution
Checking the Region
![Page 10: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/10.jpg)
10
Differential Equations
ode and solve 1st Order
2nd Order
![Page 11: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/11.jpg)
11
ODE with Initial Conditions
Initial Conditions
with different Initial Values
![Page 12: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/12.jpg)
12
Exercise 2
Solve the following ODE for different values of a=-2, 0,+2 and plot the solutions.
![Page 13: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/13.jpg)
13
Set of Differential Equations
![Page 14: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/14.jpg)
14
Numerical ODE Solver
Original ODE Matrix Form
Matrix form ODE function
Numeric solution at t=1 initial value
time duration
![Page 15: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/15.jpg)
15
Plotting Numerical ODE Solution
plot::Ode2d
with Mapping function
![Page 16: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/16.jpg)
16
Ode3d with 3D Mapping
plot::Ode3d
![Page 17: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/17.jpg)
17
Chaotic System
Lorenz attractor
Parameters of Lorenz attractor
Initial Condition
Plot Generator
![Page 18: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/18.jpg)
18
Ode2d - Plot
Lorenz attractor (cont.)
Initial points are nearly the same.
![Page 19: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/19.jpg)
19
Ode3d
Lorenz attractor (cont.)
![Page 20: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/20.jpg)
20
Numerical Solution at a Point
Lorenz attractor (cont.)
1t
10t
100t
Chaotic System
![Page 21: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/21.jpg)
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:
![Page 22: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/22.jpg)
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.
![Page 23: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/23.jpg)
23
Difference Equations
Arithmetic Sequence
![Page 24: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/24.jpg)
24
Difference Equation - Geometric
![Page 25: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/25.jpg)
25
Difference Equations
General Solution
With Initial Conditions
![Page 26: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/26.jpg)
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.
![Page 27: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/27.jpg)
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.
![Page 28: Chapter 13: Solving Equations](https://reader035.vdocuments.us/reader035/viewer/2022081501/56812be0550346895d9051d5/html5/thumbnails/28.jpg)
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(..)