8-5 Æ­È¿n

MATLAB ¦³¨â­Ó¤èªk¥i¥Î©ó­pºâ³æÅܨç¼Æªº©w¿n¤À¡G

¨Ò¦p¡A§Ú­Ì¥i­pºâ humps ¦b [0, 1] ªº©w¿n¤À¡G

Example 1: 08-¤@¯ë¼Æ¾Ç¨ç¼Æªº³B²z»P¤ÀªR/quad01.marea = quad(@humps, 0, 1) area = 29.8583

quad ¤Î quad8 ³£À³¥Î¤F»¼°jµ{§Ç¡A¦pªG¨ä»¼°j©I¥s¤§¦¸¼Æ¹F¨ì 10 ¦¸¡A¨âºØ¤èªk§¡·|¶Ç¦^ Inf¡A¦¹§Yªí¥Ü©Ò­pºâ¤§©w¿n¤À¥i¯à¤£¦s¦b¡A©ÎÃø¥H­pºâ¡Cquad ¤Î quad8 ªº²Ä¥|­Ó¤Þ¼Æ¥i¥Î¨Ó«ü©w¿n¤Àªº¬Û¹ï»~®t®e§Ô«×¡C

quad ¤Î quadl ¤]¥i¥Î¨Ó­pºâ¦±½uªºªø«×¡C°²³]¦³¤@¦±½u¬O¥Ñ¤U¦C°Ñ¼Æ¤Æªº¤èµ{¦¡¨Óªí¥Ü¡G

$$ \left\{ \begin{array}{l} x(t)=sin(2t)\\ y(t)=cos(t)\\ z(t)=t \end{array} \right. $$

¨ä¤¤ t ªº½d³ò¬° [0, 3$\pi$]¡C¦¹¦±½uªº¹Ï§Î¦p¤U¡G

Example 2: 08-¤@¯ë¼Æ¾Ç¨ç¼Æªº³B²z»P¤ÀªR/plotCurve.mt = 0:0.1:3*pi; plot3(sin(2*t), cos(t), t);

¥Ñ°ò¥»·L¿n¤À¥iª¾¡A¦¹¦±½uªºªø«×µ¥©ó

$$ \int_0^{3\pi} \sqrt{ \left(\frac{dx(t)}{dt}\right)^2 + \left(\frac{dy(t)}{dt}\right)^2 + \left(\frac{dz(t)}{dt}\right)^2} dt = \int_0^{3\pi} \sqrt{\left[ 4cos^2(2t)+sin^2(2t)+1 \right]} dt $$

§Ú­Ì¥i¥ý©w¸q¨ç¼Æ curveLength.m ¦p¤U¡G

function out = curveLength(t) out = sqrt(4*cos(2*t).^2+sin(t).^2+1);

«h¦±½uªø«×¥i­pºâ¦p¤U¡G

Example 3: 08-¤@¯ë¼Æ¾Ç¨ç¼Æªº³B²z»P¤ÀªR/quad02.mlen = quad(@curveLength, 0, 3*pi) len = 17.2220

MATLAB ªº dblquad «ü¥O¥i¥Î¨Ó­pºâÂù­«¿n¤À¡C°²³]§Ú­Ì­n­pºâ

$$ \int_{x_{min}}^{x_{max}} \int_{y_{min}}^{y_{max}} f(x, y) dx dy $$

¨ä¤¤ $ f(x, y) = y sin(x) + x sin(y)$¡C²Ä¤@­Ó¨BÆJ¡A´N¬O­n«Ø¥ß¤@­Ó³Q¿n¤Àªº¨ç¼Æ integrand.m¡A¨ä¤º®e¦p¤U¡G

function out = integrand(x, y) out = y*sin(x) + x*cos(y);

¥²¶·ª`·Nªº¬O¡A¤W­z¨ç¼Æªº¿é¤J¤Þ¼Æ x¡By ¥²¶·©M¿n¤À¦¸§Ç¡]dxdy¡^¤@­P¡C©w¸q¤F³Q¿n¤Àªº¨ç¼Æ¤§«á¡A§Ú­Ì§Y¥i­pºâÂù­«¿n¤À¦p¤U¡G

result = dblquad( 'integrand', xMin, xMax, yMin, yMax);

¨ä¤¤

¥H¤U¬°¥H¼Æ­È¥N¤Jªº½d¨Ò¡G

Example 4: 08-¤@¯ë¼Æ¾Ç¨ç¼Æªº³B²z»P¤ÀªR/dblquad01.mxMin = pi; xMax = 2*pi; yMin = 0; yMax = pi; result = dblquad(@integrand, xMin, xMax, yMin, yMax) result = -9.8696

¦b¤@¯ëªº±¡ªp¤U¡Adblquad ·|©I¥s quad ¥H­pºâ©w¿n¤À¡C­Y¶·©I¥s quadl¡A½Ðª½±µ«ü©w©ó dblquad ªº³Ì«á¤@­Ó¿é¤J°Ñ¼Æ§Y¥i¡A¨Ò¦p¡G

Example 5: 08-¤@¯ë¼Æ¾Ç¨ç¼Æªº³B²z»P¤ÀªR/dblquad02.mxMin = pi; xMax = 2*pi; yMin = 0; yMax = pi; result = dblquad(@integrand, xMin, xMax, yMin, yMax, 'quadl') result = -9.8696

­ì«h¤W¡A¥ô¦ó¨Ï¥ÎªÌ©w¸qªº¿n¤À¤èªk§¡¥i³Q dblquad ©I¥s¡A¥u­n¦¹¤èªkªº¿é¤J¤Î¿é¥X¤Þ¼Æ©M quad ©Î quadl ¤@­P§Y¥i¡C

Hint
  • ª`·N¡G¦³Ãö±`·L¤À¤èµ{¦¡ªº¨D¸Ñ¡A½Ð°Ñ¨£¥»®Ñ³Ì«á¤@³¹¡u±`·L¤À¤èµ{¦¡¡v¡C


MATLABµ{¦¡³]­p¡G¶i¶¥½g