12. MATLAB Programming and Application Liu Weiguo (Third Edition) After-Class Experiment 12: Solving Series and Equation Symbols

Table of contents

 one,

 two,

 three,

 Four,

 five,


one,

Symbolic summation of series.

  ---------------------------------------Example example------------------------------------ ---------

syms n x;
s1=symsum(1/(2*n-1),n,1,10)
s2=symsum(n*2+x^(n-1),n,1,inf)
s3=symsum(n^2/5^n,n,1,inf)

---------------------------------------Run result------------------------------------ ---------

 two,

GenerallnxZaix=1处按< /span>Next multi-format expansion number. 5

 ---------------------------------------Example example------------------------------------ ---------

x=sym('x');
f=log(x);
taylor(f,x,1,'Order',6)

---------------------------------------Run result------------------------------------ ---------

 three,

Find symbolic solutions to the following equations.

  ---------------------------------------Example example------------------------------------ ---------

syms x y;
x1=solve(log(x+1)-5/(1+sin(x))==2)
x2=solve(x^2+9*sqrt(x+1)-1)
x3=vpasolve(3*x*exp(x)+5*sin(x)-78.5)
[x4,y4]=solve([sqrt(x^2+y^2)-100',3*x+5*y-8])

---------------------------------------Run result------------------------------------ ---------

 Four,

Find the symbolic solution to the initial value problem of the differential equation, and compare it with the numerical solution

---------------------------------------Example example------------------------------------ ---------

dsolve('D2y+4*Dy+29*y','y(0)=0','Dy(0)=15','x')

function yy=test12_4_2(x,y)
yy=[-4*y(2)-29*y(1);y(2)];

[x,y]=ode23(@test12_4_2,[1.0e-9,20],[0;15])

 five,

Find the general solution to the system of differential equations.

 ---------------------------------------Example example------------------------------------ ---------

[x,y,z]=dsolve('Dx-2*x+3*y-3*z','Dy-4*x+5*y-3*z','Dz-4*x+4*y-2*z','t')

---------------------------------------Run result------------------------------------ ---------

 

Guess you like

Origin blog.csdn.net/weixin_46698113/article/details/128293198