西南交通大学数学实验参考答案

更新时间:2023-05-29 16:13:01 阅读量: 实用文档 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

薛长虹,于凯

%sy1ljy20111514

%第一大题

%1

x=[3,2*pi];

y1=sin(x)+exp(x)

%y1 = 20.2267 535.4917

%2

x=2:2:10

y2=x.^2+sqrt(2*x)

% x =2 4 6 8 10

%y2 =

6.0000 18.8284 39.4641

%3

a=2*pi;b=35*pi/180;c=exp(2)

y31=sin(a/5)+cos(b)*c

%c =

7.3891

%y2 =

6.0000 18.8284 39.4641

%4

Formal rational

%6

a=-6.28;a2=7.46;a3=5.37;

a11=fix(a1),a21=fix(a2),a31=fix(a3)

%7

y71=abs(a1*a2+a3)

y72=a1^2*sqrt(a2*a3/2)

Formal short

%8

save sy2

clear

%9

load sy1

%10

A=[2 -5 6;8 3 1;-4 6 9]

A1=A’,A2=det(A),A3=5*A

save sy1 A1 A2 A3

%第二大题

%1

X=0:pi/10:2*pi;

Y=cos(X);S=*X’,Y’+ 68.0000 104.4721 68.0000 104.4721

薛长虹,于凯

%2

a22=input(‘a22=’);

b22=input(‘b22=’);

c22=input(‘c22=’);

s=(a22+b22+c22)/2;

A2=sqrt(s*(s-a22)*(s-b22)*(s-c22))

%3

sumjs=0;sumos=0;

for i=1:2:99

sumjs=sumjs+i;

sumos=sumos+i+1;

end

sumjs

sumos

%4

n=1000;i=1;k=1;

while k<=n

if rem(k,3)==2&rem(k,5)==3&rem(k,7)==2

a4(i)=k;

i=i+1;

end

k=k+1;

end

a4

a4 =

23 128 233 338 443 548

%sy2ljy20111514

%第一大题

%1.1

x1=[3,5,-1,2,8,12]

y1=3*x1.^2+exp(x1)-x1+2

y1

%1.2

x2=[-2,-1,0,1,2,3,4]

y2=(sin(x2+2)-1)/(x2^3+6)

y2

%第二大题

%2.1

x=input('x=')

if x>=0

y1=2*x-sin(4*x) 653 758 863 968

薛长虹,于凯

else

y1=exp(x)+x.^3

end

%y1=12.5664 y1=-1.7280e+003

%2.2

x=input('x=')

if x>0

y2=5*x+3

elseif x<0

y2=3*x.^2

else

y2=4

end

%y2=228 y2=3072

%第三大题

function y3=f3(x)

if x>0

y3=log(2*x)

else

y3=2*x.^3-x+5

end

%f3(4)=2.0794 f3(0)=5 f3(-2)=-9

%第四大题

%4.1

for i=1:6

for j=1:6

if i==j

A4(i,j)=5;

elseif abs(i-j)==1

A4(i,j)=2;

else

A4(i,j)=1;

end

end

end

%4.2

A4

A(1,1)=3

A(1,2)=2

A(1,3)=5

A(1,4)=4

A(1,5)=-2

A(1,6)=-3

薛长虹,于凯

for i=2:6

for j=1:6

A(i,j)=A((i-1),j)*A(1,j)

end

end

A

%4.3

n=input('n=')

sum=0;k=1;

while k<=n

sum=sum+1/k

k=k+1

end

sum

%sum =3.3182 sum =3.5977

%4.4

a=[1,1];

for i=3:40;

a=[a,a(i-2)+a(i-1)];

end

F=reshape(a,10,4)

%4.5

a=input('a=')

n=input('n=')

for i=2:n

a=[a,a(i-1)+a(1)*(10^(i-1))]

end

Sn=sum(a)

%5

score=input('成绩');

n=score/10

switch fix(n)

case {10,9}

disp('优秀');

case {8,7}

disp('良');

case 6

disp('及格');

otherwise

disp('不及格');

end

薛长虹,于凯

%6

n=0;

for m=1:200;

flag=1;j=m-1;

i=2;

while i<=j&flag

if rem(m,i)==0

flag=0;

end

i=i+1;

end

if flag

n=n+1;

prime(n)=m;

end

end

prime

%7

s=input('距离km')

p=input('每吨基本运费')

w=input('货物重')

switch s

case (s<250)

d=0;

case (s<500&s>=250)

d=0.02;

case (s<1000&s>=500)

d=0.05;

case (s<2000&s>=1000)

d=0.08;

case (s<3000&s>=2000)

d=0.1;

case (s>=3000)

d=0.15;

end

f=(1-d)*s*p*w

%sy3ljy20111514

%一大题

x11=[2 -5 8 -1 7 1 -8 3 2 5 9]

薛长虹,于凯

x12=(2:2:22)

%1.3

x13=linspace(0,2*pi,20)

%1.4

x14=rand(1,8)

%1.5

x15=rand(6,1)

%1.6

x16=x11(abs(x11)>3)

%1.7

m1=[5 4 9];

m2=[8 6 3];

m=m1-m2;

a=norm(m)

%1.8

x18=4+x11+7*x12

%1.9

x19=x11*x12'

%1.10

x10=cross(x11([1,2,3]),x12([1,2,3]))

%2大题

%2.1

figure

axis([0 8 0 8]);

x=[2 4 4 2 2 4 6 6 4 2 2 4 4 6 6 4];

y=[5 5 3 3 5 5 5 3 3 3 1 1 3 3 1 1];

line(x,y)

%2.2

figure

y=[4 5 5 3 2 3 5 6 7 8];

plot(y)

%2.3

薛长虹,于凯

x23=(0.1:0.01:10);

y23=30./x23;

plot(y23)

%2.4

figure

x24=linspace(-5,5,30);

y24=5*x24.*cos(x24);

plot(y24)

%2.5

figure

x25=linspace(-2*pi,2*pi,50);

y25=sin(x25);

plot(y25)

hold on

z25=cos(x25);4;

plot(z25,'r--');

hold off

%2.6

subplot(2,3,1);

fplot('3*x^2',[-8,8]);

title('f1=3x^2');

subplot(2,3,2);

fplot('exp(x+1)',[-8,8]);

title('f2=e^(x+1)')

%3.1

t=linspace(-2,2,50)*pi;

a=input('a=');

b=input('b=');

x=a*cos(t);y=b*sin(t);

plot(x,y,'r');

axis equal

text(-0.5,0,'x^2/a^2+y^2/b^2=1');

%3.2

t=linspace(0,4*pi,50)

r=cos(t/3);

subplot(1,3,1)

plot(t,r);

薛长虹,于凯

t=linspace(0,5*pi,50)

r=exp(0.3*t);

subplot(1,3,2)

plot(t,r);

hold on

t=linspace(0.6*pi,6*pi,50)

r=4./t;

subplot(1,3,3)

plot(t,r);

hold off

%3.3

t=0:pi/12.5:8*pi;

plot3(sin(t),cos(t),t);

label('x'),ylabel('y')

%sy4wangchao20121652

%1.1

t=1:0.5:10;

r=2+cos(t)+sin(t);

cylinder(r,30)

title('旋转抛物面图');

%1.2

[x,y]=meshgrid(-3:0.5:3);

z2=x.*y;

mesh(x,y,z2);

title('双曲抛物面');

%1.3

[x,y]=meshgrid(-5:0.5:5);

z3=sqrt(abs(x.^2-2.*y));

surf(x,y,z3);

title('曲面表面图');

%1.4

function [xx,yy,zz]=sphere(n);

if nargin==0,n=20;end;

theta=(-n:2:n)/n*pi;

phi=(-n:2:n)'/n*pi/2;

cosphi=cos(phi);cosphi(1)=0;cosphi(n+1)=0;

sintheta=sin(theta);sintheta(1)=0;sintheta(n+1)=0;

薛长虹,于凯

x=cosphi*cos(theta);

y=cosphi*sintheta;

z4=cos(phi).^2*ones(1,n+1).^2;

surf(x,y,z4)

shading interp

%1.5

ezsurf(@(x,y)(x^2+y^2+6*sin(2*x)),[-2*pi 2*pi -2*pi 2*pi])

shading interp

%2.1

x21=1:1:10;

y21=fix(rand(1,10)*30);

bar(x21,y21)

%2.2

y221=[2.5 3 4.5 5 2.8];

y222=[2 2.2 3 2.5 1.8];

x=1:5;

area(x,y221,'facecolor',[0.75 0.6 0.9],'edgecolor','b');

hold on;

area(x,y222,'facecolor',[0.5 0.9 0.7],'edgecolor','r');

hold off;

gtext('五年某地区住房修建统计')

gtext('入住率')

%2.3

y22=fix(rand(1,50)*30);

hist(y22,5)

%2.4

y23=[46 75 148 214 98 35];

pie3(y23,[0 0 0 1 0 0])

%2.5

[x,y,z]=peaks(30);

subplot(2,2,1)

surf(x,y,z)

subplot(2,2,2)

contour(x,y,z,15)

%3(1)

sc1=[56 21 31 27 21 26 56 24 32]

薛长虹,于凯

sc2=[36 19 31 40 51 29 10 13 10]

sc3=[4 51 23 14 24 9 5 31 14]

sc4=[4 9 15 19 4 26 29 32 44]

subplot(2,2,1)

pie3(sc1)

subplot(2,2,2)

pie3(sc2)

subplot(2,2,3)

pie3(sc3)

subplot(2,2,4)

pie3(sc4)

%(2)

x=1:9;

sc1=[56 21 31 27 21 26 56 24 32]

sc2=[36 19 31 40 51 29 10 13 10]

sc3=[4 51 23 14 24 9 5 31 14]

sc4=[4 9 15 19 4 26 29 32 44]

subplot(2,2,1)

bar(x,sc1)

subplot(2,2,2)

bar(x,sc2)

subplot(2,2,3)

bar(x,sc3)

subplot(2,2,4)

bar(x,sc4)

%4.1

t=-5*pi:pi/200:5*pi;

comet(sin(t),t.*cos(t))

%4.2

t=0:0.01:100;

x=2*t.^2;

y=2*sin(t);

z=5*cos(3*t);

comet3(x,y,z)

%sy5wmy20111510

%1.1

a1=[1 3 5 7; 2 4 6 8;9 8 6 3;-6 0 4 3]

%1.2

a2=[3 5 -2 3;4 8 3 0;6 7 4 -1;2 5 6 9]

%1.3

a3=sym('[x*1 x*2 x*3 x*4 x*5;y*1 y*2 y*3 y*4 y*5]')

薛长虹,于凯

a4=sym('[sin(x) x^2;1+x cos(x)]')

b=fix(rand(4,4)*20)

%1.4

t=[2 3 4 2 5 3]

f1=vander(t)

f=rot90(f1)

%1.5

c=magic(4)

%1.6

q=zeros(4,4)

e=eye(4)

n=ones(4,4)

%1.7

a6=[b e q;n c a1]

%2.1.1

a1=[1 3 5 7; 2 4 6 8;9 8 6 3;-6 0 4 3]

a21=max(a1)

[x y]=find(a1==max(max(a1)))

%2.1.2

a1=[1 3 5 7; 2 4 6 8;9 8 6 3;-6 0 4 3]

a22=min(a1)

[x y]=find(a1==min(min(a1)))

%2.1.3

a1=[1 3 5 7; 2 4 6 8;9 8 6 3;-6 0 4 3]

a23=mean(a1)

a24=median(a1)

%2.1.4

a1=[1 3 5 7; 2 4 6 8;9 8 6 3;-6 0 4 3]

a25=std(a1)

a26=sum(a1)

%2.2

a1=[1 3 5 7; 2 4 6 8;9 8 6 3;-6 0 4 3]

a2=[3 5 -2 3;4 8 3 0;6 7 4 -1;2 5 6 9]

a27=a1+a2

a28=a1*a2

%2.3

a2=[3 5 -2 3;4 8 3 0;6 7 4 -1;2 5 6 9]

a29=a2([1,3],[2,3])

%3.1

a=fix(rand(6,6)*20)

%3.2

a31=a'

a34=det(a)

薛长虹,于凯

a33=rank(a)

%3.3

a=fix(rand(6,6)*20)

a34=inv(a)

%3.4

a=fix(rand(6,6)*20)

[d,x]=eig(a)

%4.1

a=[1 -5 2 -3;5 3 6 -1 ;2 4 2 1]

b=[11;-1 -6]

a1=[a b]

ifrank(a1)==rank(a)

rr=rref(a1)

%5

m=[1 1 0;1 1 -1;0 -1 4]

[d,x]=eig(m)

p=orth(d)

y=p^(-1)*x

%f=-0.1284*y1^2+1.7984*y2^2+4.3301*y3^2

%6.1

[a21,x]=max(a21

c1=[4 2 6 2 7 5 8];

p1=poly2sym(c1)

%6.2

c2=[1,4,7]

c22=poly(c2)

p2=poly2sym(c22)

%6.3

c3=[1 -2 4 -6]

r=root(c3)

%6.4

c4=[1 -9 21 1 -30]

r=roots(c4)

%6.5

c51=[1 0 4 -3 0 9]

c52=[1 -6 4 8]

f1=poly2sym(c51)

f2=poly2sym(c52)

g1=f1+f2

gp2=conv(c51,c52)

g2=poly2sym(gp2)

[q,r]=deconv(c51,c52)

%6.6

c66=[3 5 -2 4 6 -7 1]

薛长虹,于凯

p66=polyder(c66)

f6=poly2sym(p66)

%6.7

c=[1 -7 8 -6 9]

x=[3,2,1]

y=polyval(c,x)

%6.8

x=1:2:15;

y=[1.9221 -1.8389 -0.3916 2.1648 -1.4101 -0.9911 2.2351 -0.8691]

c=polyfit(x,y,6)

z=polyval(c,x)

plot(x,y,'ro-',x,z,':')

%第一大题

%1

x=input('x=');

if x>0

f1=4*x^3+5*sqrt(x)-7;

else f1=x^2+sin(x);

end

f1

%f1(12)= 6.9223e+003

%f1(-32)= 1.0234e+003

%2

function y=f2(x)

if x<0

y=sin(5*x)+6*x^3;

else y=x^2+sin(x);

end

%f2(-6)=-1.2950e+003

%f2(11)=120.0000

%3

syms x

f3=(1+x)/(x-3)

g=finverse(f3)

%f3 =(1+x)/(x-3)

%g =(1+3*x)/(-1+x)

%4

syms x

f4=3*x^4+5*x^3-6*x^2+7;

g4=8*x^3+2*x^2+x-9;

u1=f4+g4

u2=f4-g4

薛长虹,于凯

u3=f4*g4

u4=f4/g4

u5=f4^g4

u6=compose(f4,g4)

%u1 =3*x^4+13*x^3-4*x^2-2+x

u2 =3*x^4-3*x^3-8*x^2+16-x

u3 =(3*x^4+5*x^3-6*x^2+7)*(8*x^3+2*x^2+x-9)

u4 = (3*x^4+5*x^3-6*x^2+7)/(8*x^3+2*x^2+x-9)

u5 =(3*x^4+5*x^3-6*x^2+7)^(8*x^3+2*x^2+x-9)

u6 =3*(8*x^3+2*x^2+x-9)^4+5*(8*x^3+2*x^2+x-9)^3-6*(8*x^3+2*x^2+x-9)^2+7

%5

syms x

f5=-452*x^2+224*x^3+60*x^4-296*x+320;

f51=factor(f5)

f52=horner(f5)

r5=solve(f5)

%f51 =4*(5*x-8)*(3*x-2)*(x+5)*(1+x)

%f52 =320+(-296+(-452+(224+60*x)*x)*x)*x

%r5 = -1 2/3 -5 8/5

%6

g6='x*exp(x)-2*x^2+5';

x=fzero(g6,[-2.2])

%x = -1.5278

%第二大题

%1

syms x

y1=(x^2)*(3^(1/x)+3^(-1/x)-2);

y11=limit(y1,inf)

%y11 =log(3)^2

%2

y21=limit(x*log(sin(x)),x,0,'right')

y22=limit((sin(sqrt(x^2+1))-sin(x))/x,inf)

%y21=0 y22=0

%3

f=sin(x);

y31=taylor(f,5,1)

%y31=sin(1)+cos(1)*(-1+x)-1/2*sin(1)*(-1+x)^2-1/6*cos(1)*(-1+x)^3+1/24*sin(1)*(

%-1+x)^4

%第三大题

syms x

f32=limit(exp(x)+x,x,0,'right');

f33=limit(x^2+1,x,0,'left');

if (f32==f33)&(f32==1)

a='函数在分界点连续'

薛长虹,于凯

else

a='函数在分界点不连续'

end

%a =函数在分界点连续

%第四大题

%1

f41=sin(x^3);

f410=diff(f41,x,1)

%f410 =3*cos(x^3)*x^2

%2

f42=x^(1/a)+a^(1/x)+x^(1/x);

f420=diff(f42,x,2)

%f420=x^(1/a)/a^2/x^2-x^(1/a)/a/x^2+a^(1/x)/x^4*log(a)^2+2*a^(1/x)/x^3*log(a)+x^(1/x)*(-1/x^2*log(x)+1/x^2)^2+x^(1/x)*(2/x^3*log(x)-3/x^3)

%3

f43=atan(log(x));

f430=diff(f43,x,2)

%f430 =-1/x^2/(1+log(x)^2)-2/x^2/(1+log(x)^2)^2*log(x)

%4

f44=x*asin(x)/sqrt(1-x^2)+log(1-x^2);

f440=diff(f44,x,2)

%f440 =3*asin(x)/(1-x^2)^(3/2)*x-x^2/(1-x^2)^2+3*x^3*asin(x)/(1-x^2)^(5/2)

% 第五大题

%1

syms x ;

f51='2*x^3-6*x^2-18*x+7';

[x,minf51]=fminbnd(f51,1,2)

%x = 1.9999 minf51 =-36.9988

%2

syms x;

[x,maxf52]=fminbnd('-x-sqrt(16-x)',-2,2);

maxf52=-maxf52

x

%maxf52 = 5.7416

x = 1.9999

%第六大题

%1

syms x ;

f='(x^5)*cos(x^3)';

y61=int(f)

%y61 =cos(x^3)/3 + (x^3*sin(x^3))/3

%2

syms x ;

f='(sin(x))^10';

薛长虹,于凯

y62=int(f)

%y62 =(63*x)/256 - (105*sin(2*x))/512 + (15*sin(4*x))/256 -

%(15*sin(6*x))/1024 + (5*sin(8*x))/2048 - sin(10*x)/5120

%3

syms x ;

f='1/(((x+1)^2)*((x+1)^4))^(1/3)';

y63=int(f)

%y63 =-(x + 1)/((x + 1)^6)^(1/3)

%第七大题

%1

syms x;

f='sin(x^(1/6))';

y71=int(f,0,1)

%y71=390*sin(1) - 606*cos(1)

%2

syms x;

f='1/((x+1)*sqrt(x^2-1))';

y72=int(f,1,2)

%y72=3^(1/2)/3

%第八大题

%1

function y=pmtxmj(y1,y2,a,b)

y=int((y2-y1),a,b);%m文件建立函数

syms x

y1=x^2;

y2=x^(1/2);

A=pmtxmj(y1,y2,0,1)

%A=1/3

%2

function y=pmqxhc(x,y,t,a,b)

y=int(sqrt(diff(x,t)^2+diff(y,t)^2),a,b);

%建立函数

syms t

x=cos(t)+t*sin(t);

y=sin(t)-t*cos(t);

s=pmqxhc(x,y,t,0,pi)

%s =pi^2/2

%3

function y=xzttj(f,a,b)

y=int(pi*f^2,a,b);

%建立函数

syms x

f=x^2+1;

v=xzttj(f,-1,1)

薛长虹,于凯

%v =(56*pi)/15

%sy7wmy20111510%第一大题

%1.1

syms x y z;

z=atan((x+y)/(1-x*y));

zx=diff(z,x)

zy=diff(z,y)

zxy=diff(diff(z,x),y)

%zx =-(1/(x*y - 1) - (y*(x + y))/(x*y - 1)^2)/((x + y)^2/(x*y - 1)^2 + 1)

%zy =-(1/(x*y - 1) - (x*(x + y))/(x*y - 1)^2)/((x + y)^2/(x*y - 1)^2 + 1)

%zxy =((x + y)/(x*y - 1)^2 + x/(x*y - 1)^2 + y/(x*y - 1)^2 - (2*x*y*(x + y))/(x*y - 1)^3)/((x + y)^2/(x*y - 1)^2 + 1) + (((2*x + 2*y)/(x*y - 1)^2 - (2*x*(x + y)^2)/(x*y - 1)^3)*(1/(x*y - 1) - (y*(x + y))/(x*y - 1)^2))/((x + y)^2/(x*y - 1)^2 + 1)^2

%1.2

syms x y z;

z=(x^2+2.*y)*exp(x*y);

dz=diff(z,x)*'dx'+diff(z,y)*'dy'

%dz =dx*(2*x*exp(x*y) + y*exp(x*y)*(x^2 + 2*y)) + dy*(2*exp(x*y) + x*exp(x*y)*(x^2 + 2*y))

%1.3

syms x y z;

u=sqrt(x^2+y^2+z^2);

uxx=diff(u,x,2);

uyy=diff(u,y,2);

uzz=diff(u,z,2);

x=1;y=2;z=3;

uxxM=eval(uxx)

uyyM=eval(uyy)

uzzM=eval(uzz)

%uxxM = 0.2482

%uyyM = 0.1909

%uzzM = 0.0955

%1.4

syms x y z;

u=x*(y^2)*(z^3)*sin((2.*x)/(5.*z*(y^2)));

uxyz=diff(diff(diff(u,x),y),z)

%uxyz =6*y*z^2*sin((2*x)/(5*y^2*z)) - (12*x*z*cos((2*x)/(5*y^2*z)))/(5*y) - (16*x^3*cos((2*x)/(5*y^2*z)))/(125*y^5*z)

%第二大题

%2.1

z='cos(x(1))+sin(x(2))-sin(2+x(1)+x(2))'

[x,minf]=fminunc(f,[0,pi])

%x = 2.4749 4.0457

薛长虹,于凯

minf =-2.3577

%2.2

z='-1*sin(x(1)).*sin(x(2)).*sin(x(1)+x(2))'

[x,minf]=fminunc(f,[0,0])

%x = 0 0

minf = 0

%2.3

function f=ff1(x)

f=exp(2*x)*(x+y.^2+2*y);

[x,y]=meshgrid(-10:0.5:10);

z=exp(2*x)*(x+y.^2+2*y);

surf(x,y,z)

>> x0=[0.5,-1]

%x0 = 0.5000 -1.0000

%第三大题

%3.1

f31='(x+1)*y^2';

s31=int(int(f31,y,x,x^2),x,2,4)

%s31 =357836/105

%3.2

f32='z*(x+y)';

s32=int(int(int(f32,z,x^2+y^2,2),y,-sqrt(1+x^2),sqrt(1+x^2)),x,-2,2) %s32 =0

%第四大题

%4.1

function s=sxjf(f,x,y,z,a,b)

syms t

s=int(f*sqrt(diff(x,t)^2+diff(y,t)^2+diff(z,t)^2),t,a,b);

syms t a

x=sqrt(2)/2*a*cos(t);

y=sqrt(2)/2*a*cos(t);

z=a*sin(t);

f=sqrt(x.^2+y.^2+z.^2);

s1=sxjf(f,x,y,z,0,2*pi)

%s1 =2*a^2*pi

%4.2

function s=zxjf(p,q,r,x,y,z,a,b)

syms t

s=int(p*diff(x,t)+q*diff(y,t)+r*diff(z,t),t,a,b);

syms t

x=t;y=t;z=0;

p=x.^2+y;

q=x-y.^2;

r=0;

薛长虹,于凯

s2=zxjf(p,q,r,x,y,z,0,1)

%s2 =1

%4.3

function s=sxjf(f,x,y,z,a,b)

syms t

s=int(f*sqrt(diff(x,t)^2+diff(y,t)^2+diff(z,t)^2),t,a,b); syms t a

x=a*cos(t);

y=a*sin(t);

z=0;

f=(x.^2+y.^2).^5;

s3=sxjf(f,x,y,z,0,2*pi)

%s3 =int((a^2*cos(t)^2+a^2*sin(t)^2)^(11/2),t = 0 .. 2*pi) %4.4

function s=sxjf(f,x,y,z,a,b)

syms t

s=int(f*sqrt(diff(x,t)^2+diff(y,t)^2+diff(z,t)^2),t,a,b); syms t

x=exp(t).*cos(t);

y=exp(t).*sin(t);

z=exp(t);

f=1/(x.^2+y.^2+z.^2);

s4=sxjf(f,x,y,z,0,2)

%s4 =-1/2*3^(1/2)*exp(-2)+1/2*3^(1/2)

%第五大题

%5.1

y51=dsolve('D2y=0.5*y-0.5*Dy+exp(x)')

%y51 =C2*exp(t/2) - 2*exp(x) + C3/exp(t)

%5.2

y52=dsolve('D2y=-y-sin(2*x)','y(pi)=1,Dy(pi)=1') %y52 =- sin(2*x) - sin(t) - cos(t)*(sin(2*x) + 1)

本文来源:https://www.bwwdw.com/article/o4g4.html

Top