부천대학 matlab project
TRANSCRIPT
-
8/8/2019 matlab project
1/22
MATLAB ProjectMATLAB Project
1
-
8/8/2019 matlab project
2/22
() .
, () , .
( ) , () .
(: ) ( , ) .
2
-
8/8/2019 matlab project
3/22
(ordinarydifferentialequation:ODE) () , (partialdifferentialequation:PDE) () .
f (dependent variable), x t (independent
variable) . , .
3
xtttxf !
xx ),(
txt
txf!
xx
x ),(2
-
8/8/2019 matlab project
4/22
(order) ,
(degree) .
(2) (1) (4) (2)
1 1
(2 1 ODE) (4 1
4
xfdxdf
dxfd sin
3
2
2
!
0
2
2
4
42 !
xx
xxx
y
u
x
u
-
8/8/2019 matlab project
5/22
- f(f(x,y)) () 1 (lineardifferentialequation) .
(a) f(f(x,y)) () 1, f(f(x,y))
1.
(b) (x,t,) . sinf( sinf(x,t)),
( ) .
(nonlineardifferential
equation) .
g(x)=0 (homogeneous equation) , g(x)0 (nonhomogeneous equation) .
5
dxdfe xfe xx
-
8/8/2019 matlab project
6/22
I( (a,b)) u(x)=f(x)
,
f(x) I (solution).
. c .
.
n n
, (general solution) ,
(particular solution) .
6
),,...,,,(
1' nnnuuuuxfu
!
!! cdxxgxuxgdtdu )()()(
? A !!! )()()( xgdxxgdxd
cdxxgdx
d
dx
du
)(xgdt
du! ! cdxxgxu )()(
-
8/8/2019 matlab project
7/22
Symbolic Objects
Symbolic objects area special MATLAB datatypeintroducedbytheSymbolic Math Toolbox software.Theyallowyoutoperformmathematicaloperations inthe MATLABworkspaceanalytically,withoutcalculatingnumeric values. You canuse symbolic objects toperformawidevarietyofanalytical computations:
Differentiation, includingpartialdifferentiation Definiteandindefiniteintegration Takinglimits, includingone-sidedlimits Summation, including Taylor series
Matrix operations Solvingalgebraic anddifferentialequations Variable-precisionarithmetic Integraltransforms
7
MatlabMatlab
-
8/8/2019 matlab project
8/22
Symbolic Variables
Todeclare variables x andyas symbolic objects usethe syms command:
>>syms xy
You canmanipulatethe symbolic objects accordingtotheusualrules of
mathematics. Forexample:
>>x + x +y
ans =2*x +y
8
MatlabMatlab
-
8/8/2019 matlab project
9/22
Symbolic Numbers
Symbolic Math Toolbox softwarealsoenables youto convertnumbers to symbolic objects.
To createa symbolic number, usethe sym command:
>>a= sym('2')
Thefollowingexampleillustrates thedifferencebetween a standarddouble-precision
MATLAB dataandthe corresponding symbolic number. The MATLAB command
>>sqrt(2)
returns adouble-precisionfloating-pointnumber:
ans =1.4142
Ontheotherhand, ifyou calculatea squarerootofa symbolic number2:
>>a= sqrt(sym(2))
yougettheprecise symbolic result:
a=2^(1/2) 9
MatlabMatlab
-
8/8/2019 matlab project
10/22
Toevaluatea symbolic numbernumerically, usethedouble command:
>>double(a)
ans =1.4142
Youalso can createarationalfractioninvolving symbolic numbers:
>>sym(2)/sym(5)
ans =2/5
ormoreefficiently:
>>sym(2/5)
ans =2/5
10
MatlabMatlab
-
8/8/2019 matlab project
11/22
MATLAB performs arithmetic on symbolic fractions differently
thanitdoes on standardnumeric fractions.Bydefault, MATLAB
Stores allnumeric values as double-precisionfloating-point
data. Forexample:
>>2/5 + 1/3
ans =0.7333
Ifyouaddthe samefractions as symbolic objects, MATLAB finds their
commondenominatorand combines themintheusualprocedureforaddingrationalnumbers:
>>sym(2/5) + sym(1/3)
ans =11/15
11
MatlabMatlab
-
8/8/2019 matlab project
12/22
dsolve
Symbolic solutionofordinarydifferentialequations
ex)dsolve('eq1','eq2',...,'cond1','cond2',...,'v')
symbolicallysolves theordinarydifferentialequations eq1, eq2,...using v as theindependent variable
symbolic
xu+u=1 (u)
12
MatlabMatlab
-
8/8/2019 matlab project
13/22
13
MatlabMatlab
-
8/8/2019 matlab project
14/22
dsolve help
ezplot help
subs help
double-precisionfloating-point
14
MatlabMatlab
-
8/8/2019 matlab project
15/22
15
PsimPsim
-
8/8/2019 matlab project
16/22
16
MatlabMatlab
-
8/8/2019 matlab project
17/22
17
MatlabMatlab
-
8/8/2019 matlab project
18/22
MatlabMatlab
-
8/8/2019 matlab project
19/22
19
MatlabMatlab
-
8/8/2019 matlab project
20/22
20
MatlabMatlab
dt
dvCi
c!
-
8/8/2019 matlab project
21/22
21
MatlabMatlab
dt
dvCi
c!
-
8/8/2019 matlab project
22/22
22
MatlabMatlab