傻大方


首页 > 知识库 > >

MATLAB|MATLAB数学实验第二版答案胡良剑( 三 )


按关键词阅读: 第二 数学 matlab 胡良剑 答案 实验


fzero(fun,-1),fzero(fun,1),fminbnd(fun,0.5,1.5) Page84 Exercise 4 fun=inline(x*sin(1/x),x);
fplot(fun, -0.1 0.1);
x=zeros(1,10);
for i=1:10, x(i)=fzero(fun,(i-0.5)*0.01);
end;
x=x,-x Page84 Exercise 5 fun=inline(9* 。

28、x(1)2+36*x(2)2+4*x(3)2-36;
x(1)2-2*x(2)2-20*x(3);
16*x(1)-x(1)3-2*x(2)2-16*x(3)2,x);
a,b,c=fsolve(fun,0 0 0) Page84 Exercise 6 fun=(x)x(1)-0.7*sin(x(1)-0.2*cos(x(2),x(2)-0.7*cos(x(1)+0.2*sin(x(2);
a,b,c=fsolve(fun,0.5 0.5) Page84 Exercise 7 clear;
close;
t=0:pi/100:2*pi;
x1=2+sqrt(5)*cos(t);
y1=3-2*x1 。

29、+sqrt(5)*sin(t);
x2=3+sqrt(2)*cos(t);
y2=6*sin(t);
plot(x1,y1,x2,y2);
grid on;
作图发现4个解的大致位置 , 然后分别求解 y1=fsolve(x(1)-2)2+(x(2)-3+2*x(1)2-5,2*(x(1)-3)2+(x(2)/3)2-4,1.5,2) y2=fsolve(x(1)-2)2+(x(2)-3+2*x(1)2-5,2*(x(1)-3)2+(x(2)/3)2-4,1.8,-2) y3=fsolve(x(1)-2)2+(x(2)-3+2*x(1)2-5,2*(x(1)-3)2+(x(2)/3)2-4,3.5 。

30、,-5) y4=fsolve(x(1)-2)2+(x(2)-3+2*x(1)2-5,2*(x(1)-3)2+(x(2)/3)2-4,4,-4) Page84 Exercise 8(1) clear;
fun=inline(x.2.*sin(x.2-x-2);
fplot(fun,-2 2);
grid on;
作图观察 x(1)=-2;
x(3)=fminbnd(fun,-1,-0.5);
x(5)=fminbnd(fun,1,2);
fun2=inline(-x.2.*sin(x.2-x-2);
x(2)=fminbnd(fun2,-2,-1);
x(4)=fminbnd(fun2,-0.5, 。

31、0.5);
x(6)=2 feval(fun,x) 答案: 以上x(1)(3)(5)是局部极小 , x(2)(4)(6)是局部极大 , 从最后一句知道x(1)全局最小 ,x(2)最大 。
(2) clear;
fun=inline(3*x.5-20*x.3+10);
fplot(fun,-3 3);
grid on;
作图观察 x(1)=-3;
x(3)=fminsearch(fun,2.5);
fun2=inline(-(3*x.5-20*x.3+10);
x(2)=fminsearch(fun2,-2.5);
x(4)=3;
feval(fun,x) (3) fun=inline(abs(x3-x2- 。

32、x-2);
fplot(fun,0 3);
grid on;
作图观察 fminbnd(fun,1.5,2.5) fun2=inline(-abs(x3-x2-x-2);
fminbnd(fun2,0.5,1.5) Page84 Exercise 9 close;
x=-2:0.1:1;
y=-7:0.1:1;
x,y=meshgrid(x,y);
z=y.3/9+3*x.2.*y+9*x.2+y.2+x.*y+9;
mesh(x,y,z);
grid on;
作图观察 fun=inline(x(2)3/9+3*x(1)2*x(2)+9*x(1)2+x(2)2+x(1)*x(2)+9);
x=fmi 。

33、nsearch(fun,0 0) 求极小值 fun2=inline(-(x(2)3/9+3*x(1)2*x(2)+9*x(1)2+x(2)2+x(1)*x(2)+9);
x=fminsearch(fun2,0 -5) 求极大值 Page84 Exercise 10 clear;
t=0:24;
c=15 14 14 14 14 15 16 18 20 22 23 25 28 . 31 32 31 29 27 25 24 22 20 18 17 16;
p2=polyfit(t,c,2) p3=polyfit(t,c,3) fun=inline(a(1)*exp(a(2)*(t-14).2),a, 。

34、t);
a=lsqcurvefit(fun,0 0,t,c) 初值可以试探 f=feval(fun, a,t) norm(f-c) 拟合效果 plot(t,c,t,f) 作图检验 fun2=inline(b(1)*sin(pi/12*t+b(2)+20,b,t);
原题修改f(x)+20 b=lsqcurvefit(fun2,0 0,t,c) figure f2=feval(fun2, b,t) norm(f2-c) 拟合效果 plot(t,c,t,f2) 作图检验 Page84 Exercise 11 fun=inline(1-x)*sqrt(10.52+x)-3.06*x*sqrt(1+x 。

35、)*sqrt(5);
x=fzero(fun, 0, 1) Page84 Exercise 12 r=5.04/12/100;
N=20*12;
x=7500*180 房屋总价格 y=x*0.3 首付款额 x0=x-y 贷款总额 a=(1+r)N*r*x0/(1+r)N-1) 月付还款额 r1=4.05/12/100;
x1=10*10000;
公积金贷款 a1=(1+r1)N*r1*x1/(1+r1)N-1) x2=x0-x1 商业贷款 a2=(1+r)N*r*x2/(1+r)N-1) a=a1+a2 Page84 Exercise 13 列方程th*R2+(pi-2*th)*r2-R*r*si 。

36、n(th)=pi*r2/2 化简得sin(2*th)-2*th*cos(2*th)=pi/2 以下Matlab计算 clear;
fun= inline(sin(2*th)-2*th*cos(2*th)-pi/2,th) th=fsolve(fun,pi/4) R=20*cos(th) Page84 Exercise 14 先在Editor窗口写M函数保存 function x=secant(fname,x0,x1,e) while abs(x0-x1)e, x=x1-(x1-x0)*feval(fname,x1)/(feval(fname,x1)-feval(fname,x0);
x0=x1;


37、x1=x;
end 再在指令窗口 fun=inline(x*log(sqrt(x2-1)+x)-sqrt(x2-1)-0.5*x);
secant(fun,1,2,1e-8) Page84 Exercise 15 作系数为a,初值为xo,从第m步到第n步迭代过程的M函数: function f=ex4_15fun(a,x0,m,n) x(1)=x0;
y(1)=a*x(1)+1;
x(2)=y(1);
if mm, plot(x(i),x(i),x(i+1),y(i-1),y(i),y(i);
end end hold off;
M脚本文件 subplot(2,2,1);
ex4_15fun(0. 。

38、9,1,1,20);
subplot(2,2,2);
ex4_15fun(-0.9,1,1,20);
subplot(2,2,3);
ex4_15fun(1.1,1,1,20);
subplot(2,2,4);
ex4_15fun(-1.1,1,1,20);
Page84 Exercise 16 设夹角t, 问题转化为 min f=5/sin(t)+10/cos(t) 取初始值pi/4, 计算如下 fun=(t)5/sin(t)+10/cos(t);
t,f=fminsearch(fun, pi/4) t = 0.6709 f = 20.8097 Page84 Exercise 17 提示:x(k+ 。

39、2)=f(x(k)=a2*x(k)*(1-x(k)*(1-a*x(k)*(1-x(k) 计算平衡点x |f(x)| ex4_18(0.9,1,20) ex4_18(-0.9,1,20) ex4_18(1.1,1,20) ex4_18(-1.1,1,20) Page84 Exercise 19 clear;
close;
x(1)=0;
y(1)=0;
for k=1:3000 x(k+1)=1+y(k)-1.4*x(k)2;
y(k+1)=0.3*x(k);
end plot(x(1000:1500),y(1000:1500),+g);
hold on plot(x(1501:2000),y(1 。

40、501:2000),.b);
plot(x(2001:2500),y(2001:2500),*y);
plot(x(2501:3001),y(2501:3001),.r);
Chapter 5Page101 Exercise 1 x=0 4 10 12 15 22 28 34 40;


来源:(未知)

【学习资料】网址:/a/2021/0121/0021123964.html

标题:MATLAB|MATLAB数学实验第二版答案胡良剑( 三 )


上一篇:安全避险主题班会教案|安全避险(地震灾害)主题班会教案

下一篇:云南省|云南省学年曲靖市民族中学高一年级下学年期末试卷物理