06.08.2013 Views

内容简介作者简介 - 科学与工程计算系

内容简介作者简介 - 科学与工程计算系

内容简介作者简介 - 科学与工程计算系

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

0.0017<br />

exitflag =<br />

1<br />

4.6.3 多元函数的零点<br />

⎧ f1(<br />

x,<br />

y)<br />

= sin( x − y)<br />

= 0<br />

【例 4.6.3-1】求解二元函数方程组 ⎨<br />

的零点。<br />

⎩ f 2 ( x,<br />

y)<br />

= cos( x + y)<br />

= 0<br />

(1)<br />

x=-2:0.5:2;y=x;[X,Y]=meshgrid(x,y);<br />

F1=sin(X-Y);F2=cos(X+Y);<br />

v=[-0.2, 0, 0.2];<br />

contour(X,Y,F1,v)<br />

hold on,contour(X,Y,F2,v),hold off<br />

1.5<br />

0.5<br />

0<br />

-0.5<br />

-1<br />

-1.5<br />

(2)<br />

[x0,y0]=ginput(2);<br />

disp([x0,y0])<br />

-0.7926 -0.7843<br />

0.7926 0.7843<br />

2<br />

1<br />

-2<br />

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2<br />

图 4.6-3<br />

(3)<br />

fun='[sin(x(1)-x(2)),cos(x(1)+x(2))]'; %<br />

[xy,f,exit]=fsolve(fun,[x0(2),y0(2)]) %<br />

Optimization terminated successfully:<br />

First-order optimality less than OPTIONS.TolFun, and no negative/zero<br />

curvature detected<br />

xy =<br />

0.7854 0.7854<br />

f =<br />

1.0e-006 *<br />

-0.0984 0.2011<br />

exit =<br />

1<br />

〖说明〗<br />

[fun.m]<br />

function ff=fun(x)<br />

ff(1)=sin(x(1)-x(2));<br />

ff(2)=cos(x(1)+x(2));<br />

11

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!