freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

matlab183第四章數(shù)值計(jì)算-文庫(kù)吧

2025-07-18 13:36 本頁(yè)面


【正文】 sinA = A_sinM = 奇異值分解 奇異值分解和矩陣結(jié)構(gòu) 奇異值分解定義 矩陣結(jié)構(gòu)的奇異值分解描述 線性二乘問(wèn)題的解 矩陣除運(yùn)算的廣義化 線性模型的最小二乘解 【例 】對(duì)于超定方程 Axy? ,進(jìn)行三種解法比較。其中 A 取 MATLAB庫(kù)中的特殊函數(shù)生成。 ( 1) A=gallery(5)。A(:,1)=[]。y=[ ]39。 7 x=inv(A39。*A)*A39。*y,xx=pinv(A)*y,xxx=A\y Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = . x = +000 +000 xx = +000 +000 Warning: Rank deficient, rank = 3 tol = . xxx = +000 +000 0 ( 2) nx=norm(x),nxx=norm(xx),nxxx=norm(xxx) nx = +000 nxx = +000 nxxx = +000 ( 3) e=norm(yA*x),ee=norm(yA*xx),eee=norm(yA*xxx) e = ee = eee = 函數(shù)的數(shù)值導(dǎo)數(shù)和切平面 法線 【例 】曲面法線演示。 y=1::1。x=2*cos(asin(y))。 [X,Y,Z]=cylinder(x,20)。 surfnorm(X(:,11:21),Y(:,11:21),Z(:,11:21))。 view([120,18]) 8 5053210101 圖 偏導(dǎo)數(shù)和梯度 理論定義 數(shù)值計(jì)算指令 【例 】用一個(gè)簡(jiǎn)單矩陣表現(xiàn) diff和 gradient指令計(jì)算方式。 F=[1,2,3。4,5,6。7,8,9] Dx=diff(F) Dx_2=diff(F,1,2) [FX,FY]=gradient(F) [FX_2,FY_2]=gradient(F,) F = 1 2 3 4 5 6 7 8 9 Dx = 3 3 3 3 3 3 Dx_2 = 1 1 1 1 1 1 FX = 1 1 1 1 1 1 1 1 1 FY = 3 3 3 3 3 3 3 3 3 FX_2 = 2 2 2 2 2 2 2 2 2 FY_2 = 6 6 6 6 6 6 6 6 6 【例 】研究偶極子 (Dipole)的電勢(shì)( Electric potential)和電場(chǎng)強(qiáng)度( Electric field 9 density)。設(shè)在 ),( ba 處有電荷 q? ,在 ),( ba?? 處有電荷 q? 。那么在電荷所在平面上任何 一 點(diǎn) 的 電 勢(shì) 和 場(chǎng) 強(qiáng) 分 別 為 )11(4),( 0 ?? ?? rrqyxV ??, VE ???? 。其 中2222 )()(,)()( byaxrbyaxr ???????? ?? 。 90 10941 ???? 。又設(shè)電荷6102 ???q , ?a , ??b 。 clear。clf。q=2e6。k=9e9。a=。b=。x=6::6。y=x。 [X,Y]=meshgrid(x,y)。 rp=sqrt((Xa).^2+(Yb).^2)。rm=sqrt((X+a).^2+(Y+b).^2)。 V=q*k*(1./rp1./rm)。 [Ex,Ey]=gradient(V)。 AE=sqrt(Ex.^2+Ey.^2)。Ex=Ex./AE。Ey=Ey./AE。 cv=linspace(min(min(V)),max(max(V)),49)。 contourf(X,Y,V,cv,39。k39。) %axis(39。square39。) title(39。\fontname{隸書(shū) }\fontsize{22}偶極子的場(chǎng) 39。),hold on quiver(X,Y,Ex,Ey,) plot(a,b,39。wo39。,a,b,39。w+39。) plot(a,b,39。wo39。,a,b,39。w39。) xlabel(39。x39。)。ylabel(39。y39。),hold off 6 4 2 0 2 4 66420246偶極子的場(chǎng)xy 圖 函數(shù)的零點(diǎn) 多項(xiàng)式的根 一元函數(shù)的零點(diǎn) 利用 MATLAB 作圖指令獲取初步近似解 任意一元函數(shù)零點(diǎn)的精確解 【例 】通過(guò)求 tbettf at ?? ?)( s in)( 2 的零點(diǎn),綜合敘述相關(guān)指令的用法。 ( 1) y=inline(39。sin(t)^2*exp(a*t)b*abs(t)39。,39。t39。,39。a39。,39。b39。)。 %1 ( 2) 10 a=。b=。t=10::10。 y_char=vectorize(y)。 % 3 Y=feval(y_char,t,a,b)。 clf,plot(t,Y,39。r39。)。hold on,plot(t,zeros(size(t)),39。k39。)。 xlabel(39。t39。)。ylabel(39。y(t)39。),hold off 10 5 0 5 105432101ty(t) 圖 ( 3) 由于 Notebook中無(wú)法實(shí)現(xiàn) zoom、 ginput 指令涉及的圖形和鼠標(biāo)交互操作,因此下面指令必須在 MATLAB指令窗中運(yùn) 行,并得到如圖 。 zoom on [tt,yy]=ginput(5)。zoom off 圖 tt tt = ( 4) [t4,y4,exitflag]=fzero(y,tt(4),[],a,b) %11 t4 = y4 = 0 exitflag = 1 ( 5) [t3,y3,exitflag]=fzero(y,tt(3),[],a,b) 11 t3 = y3 = exitflag = 1 ( 6) op=optimset(39。fzero39。) op = ActiveConstrTol: [] ...... Display: 39。notify39。 ...... TolX: TypicalX: [] op=optimset(39。tolx39。,)。 ans = ( 7) [t4n,y4n,exitflag]=fzero(y,tt(4),op,a,b) t4n = y4n = exitflag = 1 多元函數(shù)的零點(diǎn) 【例 】求解二元函數(shù)方程組??? ?????? 0)c o s (),( 0)s in (),(21 yxyxf yxyxf 的零點(diǎn)。 ( 1) x=2::2。y=x。[X,Y]=meshgrid(x,y)。 F1=sin(XY)。F2=cos(X+Y)。 v=[, 0, ]。 contour(X,Y,F1,v) hold on,contour(X,Y,F2,v),hold off 2 1 0 1 221012 圖 12 ( 2) [x0,y0]=ginput(2)。 disp([x0,y0]) ( 3) fun=39。[sin(x(1)x(2)),cos(x(1)+x(2))]39。 %12 [xy,f,exit]=fsolve(fun,[x0(2),y0(2)]) %13 Optimization terminated successfully: Firstorder optimality less than , and no negative/zero curvature detected xy = f = * exit = 1 〖說(shuō)明〗 [] function ff=fun(x) ff(1)=sin(x(1)x(2))。 ff(2)=cos(x(1)+x(2))。 函數(shù)極值點(diǎn) 一元函數(shù)的極小值點(diǎn) 多元函數(shù)的極小值點(diǎn) 【例 】求 222 )1()(100),( xxyyxf ???? 的極小值點(diǎn)。它即是著名的 Rosenbrock39。s Banana 測(cè)試函數(shù)。該測(cè)試函數(shù)有一片淺谷,許多算法難以越過(guò)此谷。(演示本例搜索過(guò)程的文件名為 。) ( 1) ff=inline(39。100*(x(2)x(1)^2)^2+(1x(1))^239。,39。x39。)。 ( 2) x0=[,1]。[sx,sfval,sexit,soutput]=fminsearch(ff,x0) sx = sfval = sexit = 1 soutput = iterations: 85 funcCount: 159 algorithm: 39。NelderMead simplex direct search39。 13 ( 3) [ux,sfval,uexit,uoutput,grid,hess]=fminunc(ff,x0) Warning: Gradient must be provided for trustregion method。 using linesearch method instead. In D:\MATLAB6P1\toolbox\optim\ at line 211 Optimization terminated successfully: Current search direction is a descent direction, and magnitude of directional derivative in search direction less than 2* ux = sfval = uexit = 1 uoutput = iterations: 26 funcCount: 162 stepsize: firstorderopt: algorithm: 39。mediumscale: QuasiNewton line search39。 grid = * hess = 數(shù)值積分 一元函數(shù)的數(shù)值積分 閉型數(shù)值積分 【例 】求 dxeI x? ?? 10 2,其精確值為 ? 。 ( 1) syms x。IS=int(39。exp(x*x)39。,39。x39。,0,1) vpa(IS) IS = 1/2*erf(1)*pi^(1/2) ans = .74682413281242702539946743613185 ( 2) fun=inline(39。exp(x.*x)39。,39。x39。)。 Isim=quad(fun,0,1),IL=quadl(fun,0,1) Isim = IL = 14 ( 3) Ig=gauss10(fun,0,1) Ig =
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1