mathematica 5 - wolfram researchmedia.wolfram.com/notebooks/newin5_jp.pdfmathematica 5 sun solaris...
TRANSCRIPT
Mathematica 5����������������
��
Wolfram Research�Mathematica 5����1����� ��������������������� !"#$!%&�'()*�+,��-./012�34���56��789:;</=>2?2
@AMathematica 5�-.�BC�DE���FG/HI�+8J�KL�DM�N�D��"OPQR�'S�TUVWX.YZ�[D\)]^U_8�`��?2@AJ�DM�N�DE���D��"OPQR
����Mathematica 5�abYZU�cd�e2@fg�hij.34kDQl�m��?+A
Mathematica 5��Mathematica ��no�p$D/qrm@K��+8Q\s ��/tu�v2L=wxG@�y8��z{2@|}Q\s ��/�~L�`�N�$D���P�l�PP�D�%�?+AvYy
8����xG@�������P�l����$����Mathematica 5�~L�������������"��"P���L���y8���G��K�L��/]^+8J�)U_?+A?@�Mathematica 5���v2�����S�������~��z{2@���P�l/t�U�?+A
Mathematica 5����n�����������/01+8J���78�P����2��WolframResearch� ¡K¢£2��?+AMathematica 5���Java��¤C/C++�Mathematica ����¥¦§��Uy8J/Link™�MathLink®����¨�����©$�ª��v2L .NET/Link™)t?G��?+AJG�Microsoft .NET Framework/«m@��P��k©$�Mathematica /k�l¬D���+8J�)U_8K�U��®�¯°±��²³´�~±m@-./012?+A
������������������������• � µ�¶�·e¸xG@��¹º»�����78�¼½DM�N
• ¾^¿�À�ÁÂ�Ã+8�¶Ä��
• Å��S����¤Æ��S���Ã+8�·e¸xG@v5»������
• Ç8ÈÉ�S����¤ÊË�/��½�ÌL@Í�v2�|}���P�l
• ��»�S���@Í�����xG@���
• ÎTÏ/tuÀÐ.·e¸��¤¹º�ÑÏ
• ,\����¤gÒ�Ó¿;�/Ô8�gÒ¸xG@�������)Õª
• Ö×S���Ã+8Ñؽ���
• ������78Ù0ÚÛ�BC�¶Ä��
• Microsoft .NET Framework�����[email protected]/Link
• DICOM�PNG�SVG�¾^¿º��ÜÝ�$Ä���ÞßDÄ��
• 64O��à�N�����¤áâ¬�QR$!kDQl��·e¸xG@���©$
• gvxG@�$["\QR��ã��P��
What's New in Mathematica 5 1
��������
������������������������ ����������������ä��¹º»���^¿ÁÂ�¨�[Ìå±�����S������!"nR�\D�æ8?U�Mathe-matica �ç��F���Ìå-.��m�è}éê½}ëU+AMathematica 5��78�no�p$D�z{��éì½�Mathematica �y�í8î�ïð/ñò2?+A·v�p�\ � µ�¶U��Mathematica5�Fortran�MATLABE�N��Ë�-.2�{���`ÁÂ����J�\"DU·À��no�p$D/]ó2?+A
ôõ�Mathematica 4.2�Mathematica 5�ÁÂDM�N�ö÷U+A
Á Mathematica 4.2 Mathematica 5 DM�N���
Îø
H1000 × 1000L
3.953ù 0.625ù 6.37
äS��ú/ÌL
H1000 × 1000L
3.235ù 0.375ù 8.62
û^¿
H1000 × 1000L14.218ù 1.093ù 13.01
üÇ�
H500 × 500L
3.859 ù 0.594 ù 6.49
?@�Mathematica 5�Linux�Windows�HP-UXË�p��D¬�N-./¶Ä��+8áâ¬�QR$!kDQl{U�Îø��`��ÁÂUý��� µ�¶/þ�2?+A
�������������������� ����������������]56����~L���¾^¿�^¿�ç��F�}ë)� Uy8K��)��m��?+A¾^¿/t
uÁÂ���Å�� Æ��S���·e¸����YZk#ã¬�k©$Ë)y�?+AMathematica 5��78¾¹º»��]��y�í8��?@�����Ó¿) ����Mathematica kDQl�����2��8��`TU��\K�U+Aéê½¾¹º»�ÁÂU�Mathematica ��no�p$D�������kDQl��Ë�y8���Gô{U+A
����������������������������������������������������������������
SparseArray��`��/ª�8��¾Ó¿á���\�)h�½�V�xG?+A
SparseArray@ 88i_, j_< ê; Abs@i − jD ≤ 1 � Random@D <, 85, 5<D
SparseArray@<13>, 85, 5<D
¾Ó¿á���\��Normal/e�+8��Ã�+8äÓ¿)U_?+A
2 What's New in Mathematica 5
Normal@ % D êê MatrixForm
i
k
jjjjjjjjjjjjjjjj
0.404605 0.805376 0 0 00.805876 0.660605 0.325499 0 0
0 0.572932 0.617828 0.325452 00 0 0.14707 0.0208155 0.4456990 0 0 0.598547 0.321822
y
{
zzzzzzzzzzzzzzzz
������������������������
¾Ó¿�¨�[���ü¸xG@¾���P�l�����Å��YZ^¿�ÁÂ)X.��?2@Aôõ�^¿��1012��}ë)y�?+A
n = 106;
A = SparseArray@ 88i_, j_< ê; Abs@i − jD ≤ 1 � Random@D<, 8n, n<D
SparseArray@<2999998>, 81000000, 1000000<D
b = Table@ Random@D, 8n<D;
¾^¿�ó�ä^¿�ó���_x��/²�L�x�Aä�ó�����8Q"����}U+)�¾Ó¿á���\���40� ���y?�2±�}y�?!�A
sparseMemory = N@ ByteCount@ A D D Byte
4.00004× 107 Byte
denseMemory = N@ 106 106 8 D Byte
8.× 1012 Byte
¾Ó¿�ÁÂ��Å�À�U+ALinearSolve�¾Ó¿á���\�)"��G@J�/#:�$%2��8T�²&'L�x�A
Timing@ LinearSolve@ A, b D; D
89.29 Second, Null<
(j�S���(j��;�/*�S��ú/Ì_?2@A�YZ¾^¿�û^¿K�Å��LÂ�xG?
+A
Timing@ A.A; D
81.125 Second, Null<
Clear@n, A, bD
��������������������������������Mathematica ��YZ¹º�Ñ���·e¸xG����)*���ÎTÏ/«�2?+AJG?U�J��`-.�À+ü,'½��n����U2±«�U_?!�U2@A
What's New in Mathematica 5 3
���������������������������������������� ����
ôõ�ImportEp$NU�Mathematica 5�-.���½¹º�ÑÏ�QD���/ �N2?+A
<< "Optimization`MPSData`"
p = Import@ "80bau3b.mps", "MPSData"D;
8c, A, b, d< = ToLinearProgrammingData@pD;
80bau3b�������2000��/ÚÛ�1j��;�)t?G��?+A
Dimensions@ A D
82262, 9799<
ôõU¹º�Ñ��/Ì_�·e¸xG@0�/12?+A
xo = LinearProgramming@ c, A, b, d, Method → "InteriorPoint"D; êê Timing
85.188 Second, Null<
ôõ)·e�U+A
c.xo
987224.
Clear@c, A, b, d, pD
J����Mathematica 4.2U��¨�[�äº�)«�G8@Í�ÌLJ�)U_?!�AÁÂ��}�2P�3456�@Í�J���/ÌLJ��ÊX.�m@�U+A
�������������������������������������������� ����
J�7U��23j8��;��1j�ÊË�/*�¹º�Ñ��/Ì_?+A
8c, A, b, d< = ToLinearProgrammingData@Import@"osa−60.mps", "MPSData"DD;
Dimensions@AD
810280, 232966<
AbsoluteTiming@Timing@xo = LinearProgramming@c, A, b, d, Method −> "InteriorPoint"D; DD
8113.9120820 Second, 8102.75 Second, Null<<
9:�7��°�ôõ)·e�U+A
4 What's New in Mathematica 5
c . xo
4.04407× 106
Clear@c, A, b, dD
������������ ����Mathematica U�JG?UK;(j<��`�/ `J��U_?2@)�J����©$U���)*½]��������P�l����1000<=>���3?�no�p$D)z{2?2@A�(j<��U��@A½���)*½���P�l/«`��JGô{��no�p$D�z{)B�G?+A
�_���Ã+8Mathematica 5��no�p$D��ü,�C�"��"P��no�p$D��Ë�y8���G��KÀ�U�D���kDQlU�öEy�?!�A
Á Mathematica 4.2 Mathematica 5 DM�N���
1000 <�2��]�/1jFG7�!8 0.797ù 0.406ù 1.96
1000 <�2��H�/1jFG7�!8 1.0ù 0.407ù 2.46
1 j<�100<�H��·�I/�/��+8 0.407ù 0.047ù 8.66
1000 <�]��JSK/��+8 0.359ù 0.062ù 5.79
64���������������������������������������������������������������������YZ������P��k©$/]^2��8Mathematica �®��m��ó^�Intel IA-32O����ßQ\�LË�32O��kDQl��784M �����N¬DN6�»��100jQ"����1Q"���=1,024M ������N¬DO6��\µDU_8�`�m@���_PiU+A
Wolfram Research�gigaNumerics��k����g�Uy8�64O���N¬DO6�À���34�a�!����Mathematica �®��Å��YZ��KÌLJ�)U_?+A
Mathematica 5�Sun Solaris�UltraSPARC�HP-UX�PA-RISC�IBM AIX�Power��ßQ\�L�HP Tru64�Alpha�Linux�Alpha/tu�~��64O��CPU��¤áâ¬�QR$!kDQl��·e¸xG��?+A64O����_þT���32O���"��no�l��KQR��YZ��)Ì78��`T��64O���&S�����_���T�DM�N)���+8��`T�2T)UV�G?+A
64O��·e¸����Mathematica �®�{��64O��� µ�¶�WX����©$U���z{2@�no�p$D)ØYU_?+A
������������������������������������MathLinkMathLink �gridMathematica \"D[Ë�ý��Mathematica Z�[�6�|}\]^R�@Í�7U�L�n $�Þ$N�Z�[���`Mathematica ���6U�\]�@Í�KTCP/IP¨��D/«�2��?+A
v2�TCP/IP� �E�����Mathematica 5�Î_+8[��`�\�DM�NU\]/^`J�)U_?+A���100Base-T[��`�\U���$NB)10?�¬�Q$k)200?z{2?+A·va�E$Mã�[µ$[�U«�G��8�`Gigabit[��`�\�\ D��Ë���À��[��`�\U��J
What's New in Mathematica 5 5
Gô{�z{)B�G?+AJ���K�Windows�"��no�l��v2� SharedMemory� �E���`��T�����gpk${�Mathematica ���6�\])x��10?z{2?+A
+,��MathLink ��$¨R$!�J/Link�.NET/Link�ç��F+,��Import / Exportº���MathLink�b�2��8�U�JG�K+,�MathLink �z{��m�z{2��?+A
����
NDSolve��NDSolve)��c_d��G��no�p$D�ÜÝÐ)z{2?2@A~L�z{T�ef½U�+,���®)þ�U_8K�U+AJG�ª��v2�NDSolve�{g�®�ÌÏ�hi�j+á�k©$�kl�����m^no�2�[�Ã+8�~L�á�k©$��®pq�ZD[l���/
NDSolve�]+8SÏ?UK012?+A
·Kè}��T�2��ôõ��`K�)y�?+A
• r½�$s\�[Ï�tu��v½�$s\�[Ï�tu��Deuflhard�wxÏ�BDFy�D�v½Xz���Ï����DQ��Ï/tuv@ÌÏ
• ��)*½]��8�~L�{E���S����BDM�N���
• ,\��;���¤Ó¿;��¶Ä��
• g����»�S��/ÌLJ�)X.�
• v2�EvaluationMonitorá�k©$�StepMonitorá�k©$��8�m^no�2�[�^|��}H
• Mathematica %&Ul~xG@���P�l/]+8@Í�n¬�l`�\/01
������������������������������������
J�7U��y\��;�/«m�12����S��ú/�l2?+A
ôõ�����S�����/��¸2@�����Ì/3D!"nR�\DUB8��þU+A
6 What's New in Mathematica 5
IntrinsicCurve3D@ 8κ_, τ_<, 8s_, smin_, smax_<,8s0_?NumericQ, x0_?VectorQ, t0_?VectorQ, n0_?VectorQ<, opts___?OptionQD :=
Module@ 8x, t, n, b, s, c<,c = x ê. First @
NDSolve@8x'@sD � t@sD, x@s0D � x0,
t'@sD � κ n@sD, t@s0D � t0,
n'@sD � τ b@sD − κ t@sD, n@s0D � n0,
b'@sD � −τ n@sD, b@s0D � Cross@ t0, n0D<,8x, t, n, b<,8s, smin, smax<
D;ParametricPlot3D@c@sD, 8s, smin, smax<, opts D
D;
IntrinsicCurve3D@ 8κ_, τ_<, 8s_, smin_, smax_<, opts___?OptionQ D :=
IntrinsicCurve3D@8κ, τ<, 8s, smin, smax<, 80, 80, 0, 0<, 81, 0, 0<, 80, 1, 0<<,opts D;
ôõ���*��*Ul~xG@O6�¹�7U+A
IntrinsicCurve3D@ 8Abs@sD, 0.3<, 8s, −10, 10<, PlotPoints → 500 D;
What's New in Mathematica 5 7
������������ ������������������������
J�7U��A = -
i
k
jjjjjjj
1 2 3
4 5 6
7 8 9
y
{
zzzzzzz U�ØÚÛ)X H0L ã
i
k
jjjjjjj
1 0 0
0 1 0
0 0 1
y
{
zzzzzzzUy8^¿��S��X £HtL ã A.X HtL/Ì_?+A
A = −881, 2, 3<, 84, 5, 6<, 87, 8, 9<<;
matrixExpA =
X ê. First@ NDSolve@ X'@tD � A . X@tD fl X@0D � IdentityMatrix@3D, X, 8t, 0, 5< DD
InterpolatingFunction@880., 5.<<, <>D
ü,^¿s�l/l~2����/B8J�)U_?+A
<< "Graphics`Graphics`"
LogListPlot@ Table@ Norm@ MatrixExp@ A, tD − matrixExpA@ t D D, 8t, .2, 5, .2<D,PlotJoined → TrueD;
����������������������������������������
JJ���S��x '@tD ã x@tD + 2 y@tD�9�½»�S��0 ã x@tD + y@tD)y�?+AJ����Nm��1���Ø�S��x@0D ã 1/F��`�"�8±�²&'L�x�A y@0D��Ø�S����»�S����m���½��lxG?+A
NDSolve@ x'@tD � x@tD + 2 y@tD fl 0 � x@tD + y@tD fl x@0D � 1, 8x, y<, 8t, 0, 1<D
88x → InterpolatingFunction@880., 1.<<, <>D,y → InterpolatingFunction@880., 1.<<, <>D<<
8 What's New in Mathematica 5
Plot@ Evaluate@ 8x@tD, y@tD< ê. First@ % D D, 8t, 0, 1<D;
��������������������������������������������������������
ôõ�w�¸���2¨�U+AJ���Çи�1� µDU��w����F���m��)Ô��±G?+AJJU������)c�����)T�����)R�2?+Ax���������)c0�������)T0���F����)Tc�l�)k1, …, k4�2?+A
<< "Graphics`Colors`"
results = Block@ 8k1 = 1, k2 = 1, k3 = 10, k4 = 10, c0 = 1, T0 = 30, Tc = 10<,NDSolve@8c'@tD � k1 Hc0 − c@tDL − r@tD,T'@tD � k1 HT0 − T@tDL + k2 r@tD − k3 HT@tD − TcL,0 � r@tD − k3 Exp@−k4 ê T@tDD c@tD,c@0D � c0,
T@0D � T0
<,8c, T, r<,8t, 0, 5<
DD
88c → InterpolatingFunction@880., 5.<<, <>D, T → InterpolatingFunction@880., 5.<<, <>D,r → InterpolatingFunction@880., 5.<<, <>D<<
What's New in Mathematica 5 9
Plot@ Evaluate@ 8c@tD, T@tD, r@tD< ê. First@resultsDD, 8t, 0, 5<,PlotStyle → 8Red, Green, Blue<, Frame → True, FrameLabel → 8"Time", "c,T, and r"<D;
������������������������������������
�P�$���r��g{U��r���)� 2�K¡G�K��J�/�2?+A�P�$�7�2
��¢��)y�?+A�P�$/�£2@·����S����Korteweg-de Vries(KdV)S��U2@A�P�$/34½���2@K���� $!¤���¥n¦��§¨S�)y�?+A
JG��1O6��KdVS��U+A
KdV@8α_<, t_, x_ D := D@ψ@t, xD, tD + α ψ@t, xD D@ψ@t, xD, xD + D@ψ@t, xD, 8x, 3<D � 0;
{��KdVS����r�ÌU+A
S@8α_, c0_, x0_<, t_, x_ D :=3 c0
α
i
kjjjjjSechA
è!!!!!!!c0
2
Hx − x0 − c0 tLEy
{zzzzz
2
;
JJU�©Ø½�6ÚÛ/«`�U�+,��©Ø�ª/ª��ôõ��ØÚÛ/«?+A
Φ = S@81, 3, 5<, 0, xD + S@81, 3ê 2, 15<, 0, xD +
S@81, 3, 5 + 40<, 0, xD + S@81, 3 ê 2, 15 + 40<, 0, xD +
S@81, 3, 5 − 40<, 0, xD + S@81, 3 ê 2, 15 − 40<, 0, xD;
HΦ ê. x → 0.L � HΦ ê. x → 40.L
True
JG���r��¬Â�/B8J�)U_?+A
s = NDSolve@ KdV@81<, t, xD && ψ@0, xD � Φ && ψ@t, 0D � ψ@t, 40D, ψ, 8t, 0, 10<,8x, 0, 40<, Method → StiffnessSwitchingD; êê Timing
812.484 Second, Null<
10 What's New in Mathematica 5
Plot3D@ Evaluate@ ψ@t, xD ê. First@ s DD, 8x, 0, 40<, 8t, 0, 10<,PlotRange → 80, 10<, PlotPoints → 100, Mesh → FalseD;
��\f2�`�����¹½¬Â��8T�²&'L�x�A
Show@ %, ViewPoint −> 8−1.855, −1.725, 4.000<D;
What's New in Mathematica 5 11
FindRoot��FindRoot)gÒ½Ó¿;�/¶Ä��2��2P)N�G��8E$Mã�[U��YZ���DM�N����34�z{/]ó+8v �����P�l/tu�`��?2@A
���������������������������� ����������������
JG��^¿S��/ÌL7U+AJJU�®¦56»�P�Z�S��Q + AT P + P A - P B R-1 BT
P ã 0/Ì��¯?+A
y8ú�7°2èø��y8{�-±kDQl���/ÚÛ)y8�²l2?+A
A = 880, 1<, 80, 0<<; B = 880<, 81<<;
Q = 881, 0<, 80, 1<<; R = 881<<;
S��Q + AT P + P A - P B R-1 BT
P ã 0�^¿�K/B-7?+A
FindRoot@ Transpose@AD . P + P . A − P . B . Inverse@RD . [email protected] � − Q,
8P, 8810, 2<, 82, 10<<<D
8P → 881.73205, 1.<, 81., 1.73205<<<
FindFitv���FindFit���Fit�NonlinearFit�»8K�U�JG�����-./¢£+8K�U+AFind�Fit�Ó¿;�/¶Ä��2�W?Uô{����P�l/012�34��¼�StepMonitor�Evalua-tionMonitor�'��/«`J�)U_?+A
��������������������������������
FindFit�³�½®¦��/«m�¨�[�nR��+8J�KU_?+A
data = Table@8t, Which@t < 0, 0, True, �−0.04 t [email protected] tDD<, 8t, −10, 50<D;
model = Which@t < 0, 0, True, �−a t Sin@b tDD;
sol = FindFit@data, model, 88a, 0.02<, 8b, 0.3<<, 8t<D
8a → 0.04, b → 0.1<
¨�[�ôõ�nR����U��U_?+A
12 What's New in Mathematica 5
Show@ListPlot@data, PlotJoined → False, PlotStyle → [email protected], [email protected]<,DisplayFunction → IdentityD,Plot@model ê. sol, 8t, −10, 50<, DisplayFunction → IdentityD,DisplayFunction → $DisplayFunctionD;
������������������������
´�µm�¶l2��8�²l2?+A
data = Table@ 8Cos@tD + 5, Sin@tD + 15, 0.< + Random@Real, 8−.05, 0.05<D,8t, 0., 2 Pi, 0.01<D;
<< "Graphics`Colors`"
What's New in Mathematica 5 13
dg = ListPlot@ Take@ data, All, 2D, Frame → True, PlotStyle → Red ,
AspectRatio → AutomaticD;
ôõ�·¸R U¹º)8x0, y0<�´/¨�[�nR��2?+A
Clear@RD
s = FindFit@ data, Hx − x0L2 + Hy − y0L2 − R2, 8x0, y0, R<, 8x, y< D
8x0 → 5.00117, y0 → 14.9998, R → 1.00146<
fg = Show@Graphics@8RGBColor@0, 0, 1D, Circle@8x0 ê. s, y0 ê. s<, R ê. sD<D,DisplayFunction → IdentityD;
ôõ�¨�[�nR��2@´/g»���2@K�U+A
14 What's New in Mathematica 5
Show@ 8dg, fg<, AspectRatio → AutomaticD;
FindMinimum����FindMaximum���FindMaximum)v@�ª��G��þ��?2@A��FindMinimum�FindMaximum�gÒ½Ó¿;�/¶Ä��2�v �����P�l/01+8�`��?2@ANlxG@�2PnoUK¼Â)
z{2?2@A
����������������������������������������
J����y\��;�/«m��?+A
A = 881, 2<, 83, 4<<;
FindMaximum@ [email protected], 4D ê Norm@x, 4D, 8x, 81, 1<<D
85.95734, 8x → 80.949799, 1.04995<<<
What's New in Mathematica 5 15
����
DSolve��DSolve)�½4¾�/*�¹ºS��ú�½4Ì/+,�¿Í�G8�`��?2@A?@�l¾�/*m@��S��ú�¹ºúKÌ78�`��?2@A
�������� ������������������������������������
JG�½4Ì/*�½4��¾��¹ºúU+A
DSolveA9
u′@tD ==H6 + 2 t − 3 t3 − t5L u@tD
t H−3 − 2 t + t2L H−1 + t3L
+H5 + tL v@tD
H−3 − 2 t + t2L H−1 + t3L
,
v′@tD == −4 t H−3 − 2 t + t2L u@tD
H5 + tL H−1 + t3L+
H1 + 20 t2 + 3 t3L v@tD
H5 + tL H−1 + t3L=,8u, v<,t
E
99u → FunctionA8t<, t C@1D�������������������������������
−3 − 2 t + t2+
t2 C@2D�������������������������������
−3 − 2 t + t2E, v → FunctionA8t<, C@1D
�������������
5 + t+
t4 C@2D��������������������
5 + tE==
DSolve��üÇS��y8����»�S��)Ì78��Ky�?+AÀÁ½�%`��õ��º��¹ºS��ú)Ì7?+AJJU^¿A�üÇ^¿U+A
A . x'@tD + B.x@tD � g@tD
ôõ���»�S���gÒÌ)2�úUy8�K���Â�1��gÒ�"��[2±*@�T�²&'L�x�AJJUK�;�6�»�S��)y8J�U�pÃ�)1õ)�?+A
DSolve@ x'@tD � x@tD + 2 y@tD fl 0 � x@tD + y@tD , 8x, y<, tD
99x → FunctionA8t<, 1�����
4�−t C@1DE, y → FunctionA8t<, −
1�����
4�−t C@1DE==
J�����Ø�/1��7pÃ�hÄJ�)U_?+A
DSolve@ x'@tD � x@tD + 2 y@tD fl 0 � x@tD + y@tD fl x@0D � 1, 8x, y<, tD
88x → Function@8t<, �−tD, y → Function@8t<, −�
−tD<<
ôõ)·X�;����xG@�Ø�U+A
16 What's New in Mathematica 5
y@0D ê. First@ % D
−1
RSolve��RSolve�¹º��¤�¹º���S��ú���»�S��ú�Æ��S��ú/ÌLJ�)U_?+A?@�q��S����Å�ÆÏKÌLJ�)U_?+A
��S����`��LÇ\�B�8��S��)�Å�ýÈÌ/V�2�+,��Ì/É�@º�U�
+J�)U_8çF�gÒ½��)���`��Ky�?+A2±2�~L����ôõ�7��`�É
�@º��Ì/¿Í8J�)X.U+A
������������������������������������
RSolve���L$N�?�����S��/ÊË2?+A
RSolve@u@xD − HH3 + 2 ∗ xL ∗ Hd + c ∗zL ∗ u@1 + xDL ê H1 + xL +
HH2 + xL ∗ u@2 + xDL ê H1 + xL == 0, u, xD
88u → Function@8x<, C@1D LegendreP@x, d + c zD + C@2D LegendreQ@x, d + c zDD<<
��������yk+1 ä Hk +1L yk�������� ��������������������
tu�l�C@1D/tuyk+1 ã Hk + 1L yk�gÒÌ/¿Í?+A
RSolve@ y@k + 1D � Hk + 1L y@kD, y, k D
88y → Function@8k<, C@1D Gamma@1 + kDD<<
��S��yk+1 ã Hk + 1L yk��Ø�S��y0 ã 1/Ì_?+A
RSolve@ y@k + 1D � Hk + 1L y@kD && y@0D � 1, y, k D
88y → Function@8k<, Gamma@1 + kDD<<
Ì)���S����Ø�S���'S/>Ì2�8J�/�2��?+A
y@k + 1D � Hk + 1L y@kD && y@0D � 1 ê. % êê FullSimplify
8True<
������������������������������������2������������������������
2���6ÚÛ/*�2���S��/Ì_?+A
What's New in Mathematica 5 17
s = RSolve@ y@k + 2D + 2 y@k + 1D + y@kD � 0 && y@0D � 1 && y@1D � 2, y, k D
88y → Function@8k<, −H−1Lk H−1 + 3 kLD<<
gÒ½DQl� ��/«m�����¿/��¸+8J�)U_?+A
<< Graphics`MultipleListPlot`
MultipleListPlot@ Table@ Evaluate@ 8k, y@kD ê. First@ s D<D, 8k, 0, 10< D,
SymbolShape → Stem D;
���������������� ����!!!!""""####$$$$%%%%&&&&''''2((((������������
J�7U��x?Í?¾�/*�¹º�2S��yHnL n2+ Hn2
+ 1L yHn + 1L+ yHn + 2L = 0/Ì_?+A
RSolve@ y@n + 2D + Hn^2 + 1L y@n + 1D + n^2 y@nD � 0, y, n D
88y → Function@8n<, −H−1Ln C@1D − H−1Ln C@2D HHypergeometricPFQ@81, 1, 1<, 8<, 1D −
Gamma@nD2 HypergeometricPFQ@81, n, n<, 8<, 1DLD<<
����������������))))������������****
õ����»�S���¹ºú/�2��?+AJ�2S��ú�Ì�gÒl�)1�2±�T�²&'L�x�AJG��»�S����m�pÃ�)1õ)m��8J�)ÎÏ�m��?+A
RSolve@ x@k + 1D � x@kD + 2 y@kD fl 0 � x@kD + y@kD, 8x, y<, kD
99x → FunctionA8k<, 1�����
4H−1Lk C@1DE, y → FunctionA8k<, −
1�����
4H−1Lk C@1DE==
JG��+8����U���)1��7"��G��?+A
RSolve@ x@k + 1D � x@kD + 2 y@kD fl 0 � x@kD + y@kD fl x@0D � 1, 8x, y<, kD
88x → Function@8k<, H−1LkD, y → Function@8k<, −H−1LkD<<
18 What's New in Mathematica 5
JG�����2�"��G8y ���U+A
y@0D ê. First@% D
−1
��������++++��������������������
Æ��S�����L�±�Ðr;�)t?G?+AJ��`���gÒÌ�gÒ����m��"��[
¸xG?+A
ôõ��tu�gÒ��C@1D@l - kD/*�¹ºÆ��S��U+A
RSolve@ u@k + 1, l + 1D � a u@k, lD, u, 8k, l<D
88u → Function@8k, l<, a−1+k C@1D@−k + lDD<<
������������,,,,----....////
RSolve���í8q ��S��Ѥ��Å�ÆÏ/ÌLJ�KU_?+AJG��F@k, y@kD, y@q kD, …, y@qn kD D � 0��`º��S��U+A
JG��S���\Å���S��F@k, y@kD, y@k + 1D, …, y@k + nDD � 0/ö,8��Ò.�� y �0�)��S����4�¿��¤q ��S���Ó;�¿/º�2��8J�)�±�?+AJ�@Í�JG���GÔG�4��S���Ó;��S���KÕÖG8J�)y�?+AÓ;��S�������P�
l�å�a�!×�H�×UØÙ�óG?+A
JG����ÚP$Û/^m��8�_��ö÷��/"�81�¹ºq ��S��U+A
RSolve@b@nD � b@n ê 2D + 1 && b@1D � 1, b, nD
99b → FunctionA8n<, Log@2D + Log@nD�������������������������������������������
Log@2DE==
À�n�PÞ;dÁÂ��4½ýÈÐ/"�?+A
RSolve@f@nD � 2 f@n ê 2D + H3 ê 2L n, f, nD
99f → FunctionA8n<, 2 n C@1D +
3 n Log@nD����������������������������
2 Log@2D E==
Reduce��Reduce)¢£xG��Ë��ÊË���_���Ü���ÈÉ�l�F�a�!/tuS��KÌ78�`��?2@A
What's New in Mathematica 5 19
��������������������������������x2- 2 y2
= 1��������
J�7U��Ç8ÈÉ{US��x2- 2 y2
= 1/Ì_?+A+,������ÝN��Ì)y�?+A
?Â�ýë�ÈÉ{UJ���S��/Ì_?+A
Reduce@ x2 − 2 y2 � 1, 8x, y<, Complexes D
y � −
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2»» y �
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2
�]�ÈÉ{U��S��/Ì_?+AJ����Ì/�£+8@Í�ÊË�/«`�})y�?+A
Reduce@ x2 − 2 y2 � 1, 8x, y<, Reals D
x ≤ −1 &&ikjjjjy � −
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2»» y �
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2y{zzzz »» x ≥ 1 &&
ikjjjjy � −
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2»» y �
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2y{zzzz
��S��/H�ÈÉ{UÌL��Ì/�£+8@Í�Þ��"��[)�}��?+AJ��"��[�¨Rán¦$�DS���ÕÖG?+Aôõ�7�¨Rán¦$�DS���ü,º�Uâ�S����`K
�U+A
Reduce@ x2 − 2 y2 � 1, 8x, y<, Integers D
C@1D ∈ Integers && C@1D ≥ 0 && x �1�����2
J−I3 − 2è!!!!2 MC@1D − I3 + 2
è!!!!2 MC@1DN &&
y � −I3 − 2
è!!!!2 MC@1D − I3 + 2
è!!!!2 MC@1D
������������������������������������������������������������������������������
2è!!!!2
»» C@1D ∈ Integers && C@1D ≥ 0 &&
x �1�����2
J−I3 − 2 è!!!!2 MC@1D − I3 + 2 è!!!!2 MC@1DN && y �I3 − 2
è!!!!2 MC@1D − I3 + 2
è!!!!2 MC@1D
������������������������������������������������������������������������������
2 è!!!!2»»
C@1D ∈ Integers && C@1D ≥ 0 && x �1�����2
JI3 − 2è!!!!2 MC@1D + I3 + 2
è!!!!2 MC@1DN &&
y � −I3 − 2è!!!!2 MC@1D − I3 + 2 è!!!!2 MC@1D������������������������������������������������������������������������������
2è!!!!2
»» C@1D ∈ Integers && C@1D ≥ 0 &&
x �1�����2
JI3 − 2è!!!!2 MC@1D + I3 + 2
è!!!!2 MC@1DN && y �
I3 − 2è!!!!2 MC@1D − I3 + 2
è!!!!2 MC@1D
������������������������������������������������������������������������������
2 è!!!!2
12/Ï�+8H�ÈÉUS��/Ì_?+A
Reduce@ x2 − 2 y2 � 1, 8x, y<, Modulus → 12 D
x � 1 && y � 0 »» x � 1 && y � 6 »» x � 3 && y � 2 »» x � 3 && y � 4 »»x � 3 && y � 8 »» x � 3 && y � 10 »» x � 5 && y � 0 »» x � 5 && y � 6 »»x � 7 && y � 0 »» x � 7 && y � 6 »» x � 9 && y � 2 »» x � 9 && y � 4 »»x � 9 && y � 8 »» x � 9 && y � 10 »» x � 11 && y � 0 »» x � 11 && y � 6
]�x �ýë�y �ÈÉ{U��S��/Ì_?+A
20 What's New in Mathematica 5
Reduce@ x2 − 2 y2 � 1 && x ∈ Reals && y ∈ Complexes, 8x, y< D
x < −1 &&ikjjjjy � −
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2
»» y �
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2
y{zzzz »»
x � −1 && y � 0 »» −1 < x < 1 &&ikjjjjy � −
è!!!!!!!!!!!!!!1 − x2
�������������������������è!!!!2
»» y �è!!!!!!!!!!!!!!1 − x2
�������������������������è!!!!2
y{zzzz »»
x � 1 && y � 0 »» x > 1 &&ikjjjjy � −
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2
»» y �
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2
y{zzzz
����������������������������������������
Reduce��Ì/V�2?+AJG�ÝN��]�KK�_+8��`7U+A
Reduce@ Tan@2 xD2 + Cot@2 xD2 + 2 Tan@2 xD + 2 Cot@2 xD � 6 && x ∈ Reals, x D
C@1D ∈ Integers && Jx �1�����8
Hπ + 4 π C@1DL »» x �1�������24
H−5 π + 12 π C@1DL »» x �1�������24
H−π + 12 π C@1DLN
��������������������������������������������
{���Þ�[���S���2���_��($ )�Ü��(" )Ë/tuK�)y�?+AJG�����Mathematica U��GÔGExists ($)�ForAll (")�2�l~xG��?+A
ôõU��2S��/+,��]�x ����#�8�`�a ���¤b �/�/2?+A
Reduce@ ForAll@ x, x ∈ Reals, x2 + a x + b ≥ 0 D, 8a, b<, Reals D
b ≥a2�������4
ResolveResolve�Reduce���SÏ/«m��ýë;�y8��];��tu�~ß�ú±�àNlá/â�+8J�)U_?+A9�½Ì/��+8��K�ú�àNlá��º�/��½�«8S)����� Re-solve���½º�/12?+AResolve����;�/tuàNlá/â�+8J�KU_?+A
����������������������������
ôõU��]�;�x �����2S��)#�8�`�]�¾�a� b� c )>Ì27GÖ��ÚÛ/"�?+A
Resolve@ ForAll@x, 8x, a, b, c< ∈ Reals, c x2 + b x + a > 0D D
b < 0 && c > 0 && a >b2���������4 c
»» b � 0 && c ≥ 0 && a > 0 »» b > 0 && c > 0 && a >b2���������4 c
What's New in Mathematica 5 21
��������x2+ y2
< 1����y > x4- 2����������������������������
JG�x2+ y2
< 1)y > x4- 2/�+±F`±/QD�2?+A
Resolve@ ∀8x,y< Implies@x2+ y2 < 1, y > x4 − 2D D
True
ôõ��`���½����\+8J�KU_?+A
<< "Graphics`InequalityGraphics`"
A = InequalityPlot@ x2 + y2 < 1, 8x<, 8y<,
PlotRange → 88−2, 2<, 8−2, 2<<,
Fills → 8881, 2<, RGBColor@1, 0, 0D<<,
DisplayFunction → IdentityD;
B = InequalityPlot@ y > x4 − 2, 8x, −2, 2<, 8y, −2, 2<,
PlotRange → 88−2, 2<, 8−2, 2<<,
DisplayFunction → Identity D;
Show@ 8B, A<, DisplayFunction → $DisplayFunction D;
22 What's New in Mathematica 5
FindInstanceFindInstance�Reduce���di/Ô8v��U+)�Ç8Ì/·ÀU}¿xG@��7"�?+A Re-duce)��Ì78����+,�FindInstance)«�?+A2±2��Ì)�}U����U��+,��Ìã�/¿Í�`�+8��K�Ì�ä7/B-78ç`)Âm�å���Ky�?+A Find-Instance��ReduceU�Ì7���UÌ�ä7/¿Í8J�)U_8J�Ky�?+A
��������x2- 2 y2
ä 1��������������������������������
J�7U�Reduce/«m�x2- 2 y2
= 1�]�Ì+,��Ã+8gÒI�/¿Í?+A
Reduce@ x2 − 2 y2 � 1, 8x, y<, Reals D
x ≤ −1 &&ikjjjjy � −
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2
»» y �
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2
y{zzzz »» x ≥ 1 &&
ikjjjjy � −
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2
»» y �
è!!!!!!!!!!!!!!!!!−1 + x2
������������������������è!!!!2
y{zzzz
FindInstance�{��S��/ÌL]��ä7/"�?+A
FindInstance@ x2 − 2 y2 � 1, 8x, y<, Reals, 3D
99x → −239, y → −4è!!!!!!!!!!!!1785 =, 9x → −148, y → −7$%%%%%%%%%%%%447
����������
2=, 9x → 223, y → 4
è!!!!!!!!!!!!1554 ==
Maximize/MinimizeMaximize�Minimize��GÔG�ÈÉ{U���æä·����¤·ç�/¿Í?+AJ�æä·e¸���gÒ�~ß�/di�2�Ô�?+)�èéS��) �8��Ky�?+A
�������� !!!!""""####$$$$%%%%""""&&&&''''
JJU�Maximize���lxG@w©�Ã+8·�îø/*�êëº)#SºUy8J�/�2��?+A
Maximize@ 8x y, 2 x + 2 y � 1<, 8x, y<D
9 1�������
16, 9x →
1�����
4, y →
1�����
4==
�îø)24 pUy8´ì�·�Áø/"�?+A
Maximize@ 8 π r2 h, 2 π r2 + 2 π r h � 24 π && r ≥ 0 && h ≥ 0 <, 8r, h<D
816 π, 8r → 2, h → 4<<
What's New in Mathematica 5 23
��������(((())))****++++����####����,,,,----
Minimize�Maximize�·ç�y8��·��U«�G8�/�+PD����¤·ç�y8��·����í/ül+8Yî�-�@PD�/V�2?+A
2���·ç�/¿Í?+A
Minimize[x^2 - 3x + 6, x]
9 15�������
4, 9x →
3�����
2==
x�Yî/e�+8��·ç�U��)¿Í�G?+A
x^2 - 3x + 6 /. Last[%]
15�������
4
ôõ�x�y����·�¸xG��?+A
Maximize[5 x y - x^4 - y^4, {x, y}]
9 25�������
8, 9x → −
è!!!!5
����������
2, y → −
è!!!!5
����������
2==
��������(((())))****++++����....����////,,,,----
Minimize[expr, x]��-¶ ±�+¶?U�X.ïð+,���x ����expr )·ç�8�`�2?+AMinimize[8expr, cons<, x]��/ÚÛcons )>ÌxG8��`ÚÛUexpr /·ç¸2?+A�/ÚÛ��Ë��ÊË��tu�a�!U��+8J�)U_?+A
�/ÚÛx ¥ 3�õU·ç�/¿Í?+A
Minimize[{x^2 - 3x + 6, x >= 3}, x]
86, 8x → 3<<�¡´ÎU�·��/¿Í?+A
Maximize[{5 x y - x^4 - y^4, x^2 + y^2 <= 1}, {x, y}]
92, 9x → −
1����������è!!!!2, y → −
1����������è!!!!2
==ñ´ÎU�·��/¿Í?+A���±�ýÈK���?+A
Maximize[{5 x y - x^4 - y^4, x^2 + 2y^2 <= 1}, {x, y}]
8−Root@−811219 + 320160 #1 + 274624 #12 − 170240 #13 + 25600 #14 &, 1D,8x → Root@25 − 102 #12 + 122 #14 − 70 #16 + 50 #18 &, 2D,y → Root@25 − 264 #12 + 848 #14 − 1040 #16 + 800 #18 &, 1D<<
24 What's New in Mathematica 5
ò¹�µm@·��/¿Í?+A
Maximize[{5 x y - x^4 - y^4, x + y == 1}, {x, y}]
9 9�����
8, 9x →
1�����
2, y →
1�����
2==
Minimize�Maximize��'½��expr ��/ÚÛcons );�xi /¹º½��¯tu¹º�Ñ��/ÌLJ�)U_?+A
JG��óô½¹º�Ñ��U+A
Minimize[{x + 3 y, x - 3 y <= 7 && x + 2y >= 10}, {x, y}]
9 53�������
5, 9x →
44�������
5, y →
3�����
5==
Îî�2�Minimize�Maximize��'½����/ÚÛ�2�;��~ß���/tu~ß��Ñ��/ÌLJ�KU_?+A~L�è}Ó;½��Ë��J��`�2�I�¸xG?+A
ôõU�©�Sx)õlxG@êëº�îø/·��+8��`���Ó;½��/Ì_?+A
Maximize[{x y, x + y == 1}, {x, y}]
9 1�����
4, 9x →
1�����
2, y →
1�����
2==
JG���¡öÎ�nR��+8rSÁ�·�Áø/¿Í?+A
Maximize[{8 x y z, x^2 + y^2 + z^2 <= 1}, {x, y, z}]
9 8��������������
3 è!!!!3 , 9x → −
1����������è!!!!3 , y → −
1����������è!!!!3 , z →
1����������è!!!!3 ==
Minimize�Maximize�è}ü÷�2��JG�)Å��ɽ·ç���¤·��/¿Í8��`K�)y�?+A����c��)� �8x?Í?øç���¤ø��/*�J�)�Ly�?+A2±
2�Minimize�Maximize��ɽ���N/«��ø��7ULù÷ç� ·��/¿Í?+A
ôõ������~��ø����¤øç�)y�?+A
What's New in Mathematica 5 25
Plot[x + 2 Sin[x], {x, -10, 10}]
Graphics
Maximize�·��/¿Í?+A
Maximize[{x + 2 Sin[x], -10 <= x <= 10}, x]
9è!!!!3 +
8 π
���������
3, 9x →
8 π
���������
3==
½6U����/"�8��Minimize�Maximize�·ç��·���2��GÔG-¶�+¶/12?
+A>Ì+8J��U_��/ÚÛ/"�8��Minimize�Maximize�·ç��·���2��GÔG+¶�-¶/12�;����2�Indeterminate/12?+A
�ú���2��Minimize�Maximize)x § v ��`º��æäU�ÊË�UK�x < v ��`º��æäÊË�UKÔG8��`T)y�?+AæäU�ÊË�U��·ç��·��)�6 x → v {�æä��_2�K���y�?!�)�æäÊË�U�Îî½�·ç�y8��·����ûL�K�6Î�7
GÖ�?!�A
æäÊË�U��Mathematica �üý/��2�±���6{�T/12?+A
Minimize[{x^2 - 3x + 6, x > 3}, x]
Minimize::wksol :
���������� ��������������������� !"�#$%&��'� þ�
86, 8x → 3<<Minimize�Maximize�\Å�"��G8;��+,�]�Uy8�²l2?+A2±2� x œ Integers��`�/ÚÛ/"�8J�����;��H�U7GÖ����`J�/�l+8J�)U_?+A
H��x�y{U�¯·�¸/^�?+A
Maximize[{x y, x^2 + y^2 < 120 && (x | y) ∈ Integers}, {x, y}]
856, 8x → −8, y → −7<<
26 What's New in Mathematica 5
Assuming/Refinev���Refine[expr, assum]����¹�k$��)Ù0ÚÛassum />Ì+89�½�����m��dxG@���«�G8Uy�`expr �º�/"�?+A
��������������������������������
e =è!!!!!!!!!!!!!!!!x y2 z4
è!!!!!!!!!!!!!!!!x y2 z4
ôõ��x )#Uy8���e �º�/"�?+A
Refine@e, x > 0Dè!!!!x
è!!!!!!!!!!!!y2 z4
y K#����è!!!!!!
y2 �y ��/xG?+A
Refine@e, x > 0 && y > 0Dè!!!!x y
è!!!!!!z4
Clear@eD
��������Mathematica �� �������� �������� �������� ������
Limit�IntegrateË~L�Mathematica ����Ù0ÚÛ)«�?+A
xa�øN��a �x �ÈÉ��m�Ç�?+A
Limit@ xα, x → ∞, Assumptions → α > 0 D∞
Limit@ xα, x → ∞, Assumptions → α < 0 D0
Ù0ÚÛ�ý�����K§�2?+A
AssumingA σ > 0,
F = ‡−∞
y 1è!!!!!!!!2 π σ
ExpA−Hx − µL22 σ2
E �x;
Limit@ F, y → ∞DE1
What's New in Mathematica 5 27
�������������
��������������������������������
.NET/Link ����������������������������������������
Mathematica 5��.NET/Link Q\s ����¬Oã��)t?G����Microsoft .NET Framework�����/012?+AMathematica �®�y�í8.NETá���\�/Mathematica � �N2��G/¢£+8J�)U_?+A?@�JG���Mathematica α�+,��DLLy8��COMá���\�/���Õ¤:+J�KU_?+A
�������� �������������������� Mathematica 5���!"nR�\D�Web�^¿�n¦��º�)~�ª���¶Ä��xG8º�)40/è�?2@A
���� XHTML����CSS
CSS�XHTML����Mathematica s����\/Web�ÞßDÄ��2�K�����\�$NnR��/�*+8J�)U_?+Aôõ�s����\�����s����\/ClassroomD[��k��UÂ�2?+A
28 What's New in Mathematica 5
nb = Notebook@8Cell@"Heading", "Title"D, Cell@"Section 1", "Section"D,Cell@"Some text in the middle.", "Text"D, Cell@"Section 2", "Section"D<,
StyleDefinitions → "Classroom.nb"D;J�s����\�Mathematica U�J��`�B�?+A
NotebookPut@nbD;
ôõ��`�2��{�s����\/XHTMLn¦���2���2?+A
Export@"document.htm", nbD;J�n¦��/Web�"�®UB8��Mathematica UB@�����`�B�?+A
What's New in Mathematica 5 29
���� SVG
Mathematica 5��2�y\����¤,\�� "D[���_2@!"nR�\D/XMLU�£+8@Í���Web%&Uy8SVG (Scalable Vector Graphics)�ÞßDÄ��/¶Ä��+8�`��?2@ASVG�SVGOã����¤SVG�"!�$�y8Web�"�®UB8J�)U_?+A
ôõ��Mathematica !"nR�\DU�´/l~2��?+A
30 What's New in Mathematica 5
g = Show@ Graphics@ 8 RGBColor@1, 0, 0D, Disk@ 80, 0<, 1 D <, AspectRatio → Automatic D D;
ôõ��`�2��SVGOã����¤�"!�$�y8Web�"�®UB8J��U_8n¦���SVG/ÞßDÄ��2?+A
Export@ "g.svg", g D;!! g.svg
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'><svg xmlns='http://www.w3.org/2000/svg' width='288.0pt' height='288.0pt' viewBox='-1.05 -1.05 2.1 2.1' preserveAspectRatio='xMidYMid meet'> <g transform='scale(1, -1) translate(0,0)' style='fill:black; font-family:'Courier New', Courier, Symbol, monospace; font-size:0.0729167pt; stroke:black; stroke-width:0.00182292pt'> <ellipse fill='#f00' cx='0' cy='0' rx='1.0' ry='1.0' stroke='none'/> </g></svg>
What's New in Mathematica 5 31
���� PNG
Mathematica 5����À�Web�O��p��º�Uy8PNG (Portable Network Graphics)º�/¶Ä��2��?+A
owl = Import@"OwlAlpha.png"D;Show@owl, ImageSize → 350D;
���� DICOM
Mathematica 5�DICOM (Digital Imaging and Communications in Medicine)��/¶Ä��2��?+ADICOM���� �Ñ�-��¬��Ð/���+8K�U���¹�UCL«�G��?+A
ôõ��MRIDßL$�Ñ�/�$Ä��2?+A
g = Import@ "MR−MONO2−16−knee", "DICOM"D;
32 What's New in Mathematica 5
Show@ g D;
���� ������������
Mathematica 5��MatrixMarket�Harwell-BoeingË�~L���½¾^¿º�U��$Ä���ÞßDÄ��/¶Ä��2��?+A
s = Import@ "young1c.mtx", "MatrixMarket" DSparseArray@<4089>, 8841, 841<D
v���MatrixPlot��¾Ó¿���}ë���/��+8J�)U_?+A
<< "LinearAlgebra`MatrixManipulation`"
What's New in Mathematica 5 33
MatrixPlot@ s D;
���� ��������������������������������������������������������������������
�YZ¨�[/34+8Mathematica �®)���Õª2��8��`ä]/��2���¨�[��$Ä����¤ÞßDÄ���±±856)�n¦�����K��?+)�10?±�100?K��xG?2@A
data1 = Table@Random@D, 85000<, 810<D;Export@ "data.dat", data1, "Table" D;AbsoluteTiming@ data2 = Import@ "data.dat", "Table" D;D81.7500112 Second, Null<
data1 === data2
True
Mathematica 4.2U����E$Mã�[{UJ����12ù±±m��?2@A
34 What's New in Mathematica 5
������
������������������������ v��������StatisticsPlot������V���¬����QQ� ���â��� !�Ë���½"¶±�¨�[�#$/«8@Í�gÒ½�«�G8x?Í?� ����)Â�U_?+A
���� ������������
StatisticsPlots/ �N2?+A
<< "Statistics`StatisticsPlots`"
��V����¨�[�ïð�#$/g'UB8��½�K�U+A��V���¹%�/Ô�ðu2���¡��\Å&1ê�¡T±�&3ê�¡T��6�'8��º�/Ô�?+AgÒ���¨�[Áy8��wG�/��@¨�[Á��(�V)�ÕÖG8¹)ª��G?+AwG����*±�ê�¡ïð�
3/2/è�@T�l~xG?+A+�wG���ê�¡ïð/3?è�@TU+A
� ��+8��/V�2?+A
dat = Table@Random@D, 850<D;anotherdat = Table@Random@D, 850<, 83<D;
·Ké콺��2��ôõ�����,y\��º�/Ô�?+A
What's New in Mathematica 5 35
BoxWhiskerPlot@datD;
¨�[)~;à�����-¿�����)V�xG?+A
BoxWhiskerPlot@anotherdatD;
���� !!!!��������
�¬������¨�[¹�-ZQ�P���µ$�/�+.!"n��ZQ�P�/ø��µ$�/�+¹
� ��/a¯�!@��04� ��U+A
·Ké콺�U��ParetoPlot�Þ��ZQ�P±��8�1lxG8¨�[�PD�/Ô�?+AJG�PD�Î�-ZQ�P�Ø�/2Þ2���Ø�/��µ$��;d2�� ��/Â�2?+A
36 What's New in Mathematica 5
ParetoPlot@8a, b, c, d, d, d, e, d, e, e, f, a, b, c<D;
Ø�)ÙKm���xG��8¨�[U��ParetoPlot�V¨�[U�L8category, frequency<�â�/"�8J���m�ò¥¨�[/� ��+8J�)U_?+A
ôõ��¬���U�¨�[à)Ù��xG��?+A
ParetoPlot@88"����������������", 34.3<, 8"��������", 72.1<, 8"������������", 10.2<, 8"����", 68.2<<D;
���� QQ��������""""����
QQ� ���2��¨�[)���!/*�3ã4�K�±F`±/2Þ+8@Í�«�G?+A¨�[��¡T±�º�xG8� ���T)�5Ó1�ò¹{�����¡�+GÖ��!������?+A
2��¨�[/ö÷2�¯?+AJ�2���!����U�� ���ç��Fé�¹�µm��?+A
What's New in Mathematica 5 37
QuantilePlot@Table@Random@D, 8300<D, Table@Random@D, 8300<D, SymbolShape → None,
PlotJoined → True, ReferenceLineStyle → 8Hue@0D, [email protected]<D<D;
���� ####$$$$%%%%����&&&&''''
â��� !�y8��^¿ !�U��~;à¨�[�-¿)���Ã2�� ��xG?+AJ��
����;�6��¾/},8��«`J�)U_?+A���� ���¶�!"n�^¿��?+A
ôõU��¨�[/Â�2��L�±�á�k©$/�7�� ��2�¯?+A
dat = Table@8x, Sin@xD, Cos@xD<, 8x, 0, 2 π, 0.1<D;PairwiseScatterPlot@dat, DataSpacing → 0.1,
PlotStyle → 88GrayLevel@0D, [email protected]<, [email protected], [email protected]<<,DataRanges → 8All, All, 8−0.75, 1<<, DataLabels → 8"Line", "Sin", "Cos"<,AspectRatio → 0.5D;
Sow����Reapj+¹�¹6���PD�//ø+8@Í�����Sow�Reap/g»�«`J�)U_?+A
38 What's New in Mathematica 5
���� Mathematica ()()()()DigitCount
J�7U���lxG@H��é610��óU�7�9);FóG8±/¿Í8@Í�� Sow�Reap/«�?+AMathematica ���DigitCountK�°�¼Â2?+A
dcount@n_Integer, digit_Integer, base_IntegerD :=
First@
First@Reap@Apply@Plus, Last@Reap@Sow@1, IntegerDigits@n, baseDD, digit, #2 &DD,81, −1<DDD
dcount@28093440230911048, 9, 10D2
���� StepMonitor����EvaluationMonitor
�Ø���UNDSolve)8uDQ��//ø2?+A
8yl, tl< =
Reap@ NDSolve@ y''@tD � −y@tD && y@0D � 0 && y'@0D � 1, y, 8t, 0, 3 π<,StepMonitor � Sow@tDD D
888y → InterpolatingFunction@880., 9.42478<<, <>D<<,880.000102076, 0.000204151, 0.00378919, 0.00737423, 0.0109593, 0.0109844, 0.0110096,0.0110347, 0.0110598, 0.011085, 0.0111353, 0.0111856, 0.0112358, 0.0117387,0.0122415, 0.0127444, 0.0132472, 0.0182757, 0.0233042, 0.0283326, 0.0333611,0.0383896, 0.0886742, 0.138959, 0.189244, 0.239528, 0.289813, 0.340097,0.443103, 0.546108, 0.649114, 0.752119, 0.855124, 0.95813, 1.06113, 1.18519,1.30924, 1.43329, 1.55734, 1.6814, 1.80545, 1.9295, 2.05355, 2.1776, 2.30166,2.4383, 2.57495, 2.7116, 2.84824, 2.98489, 3.12154, 3.25819, 3.39483, 3.53148,3.66813, 3.80477, 3.93185, 4.05893, 4.18601, 4.3131, 4.44018, 4.56726, 4.69434,4.82142, 4.9485, 5.07558, 5.20266, 5.31387, 5.42508, 5.53629, 5.64751, 5.75872,5.86993, 5.98114, 6.09235, 6.2251, 6.35786, 6.49061, 6.62336, 6.75611, 6.88886,7.02162, 7.15437, 7.28712, 7.41987, 7.55263, 7.71329, 7.87396, 8.03463, 8.19529,8.35596, 8.51663, 8.6773, 8.83796, 8.99863, 9.1593, 9.29204, 9.42478<<<
yf = y ê. First@ylD;s = Map@ 8#, yf@#D< &, First@ tl DD;
ôõ�NDSolve)«`DQ��/��¸2?+A
<< Graphics`MultipleListPlot`
What's New in Mathematica 5 39
g1 = MultipleListPlot@ s, SymbolShape → Stem D;
ôõU��EvaluationMonitor/«m��NIntegrate��m�«�G8¶$�P$!/��¸2?+A
8yl, tl< = Reap@ NIntegrate@ Sin@tD, 8t, 0, 3 π<, EvaluationMonitor � Sow@tDD D82.,884.71239, 9.34978, 0.074996, 8.98266, 0.442117, 8.26632, 1.15846, 7.24987, 2.17491,6.03012, 3.39466, 2.35619, 4.67489, 0.037498, 4.49133, 0.221059, 4.13316, 0.579231,3.62493, 1.08746, 3.01506, 1.69733, 7.06858, 4.74989, 9.38728, 4.93345, 9.20372,5.29162, 8.84555, 5.79985, 8.33732, 6.40972, 7.72745, 8.24668, 7.08733,9.40603, 7.17911, 9.31425, 7.3582, 9.13516, 7.61231, 8.88105, 7.91725, 8.57611,5.89049, 7.04983, 4.73114, 6.95805, 4.82292, 6.77897, 5.002, 6.52486, 5.25612,6.21992, 5.56105, 1.1781, 2.33745, 0.018749, 2.24567, 0.110529, 2.06658,0.289616, 1.81247, 0.543728, 1.50753, 0.848665, 3.53429, 2.37494, 4.69364,2.46672, 4.60186, 2.64581, 4.42277, 2.89992, 4.16866, 3.20486, 3.86372<<<
MultipleListPlot@ Map@ 8#, Sin@#D< &, First@ tl D D, SymbolShape → Stem D;
40 What's New in Mathematica 5
������������������������Mathematica ���Timing�Z�[�)���9�2@CPU56/��2?+AJG�¬�Q$k�CPUU]^¹�����P��k©$�:;�dG?!�A��AbsoluteTiming���)��xG8?U�Ep$N)«m@��56/¶l+8(5�56)/¿Í?+A
���� ****++++,,,,������������������������������������
Timing�Mathematica Z�[�)«m@56�7/"�?+A
<< Optimization`MPSData`
krnltime = Timing@Import@"80bau3b.mps", "MPSData"D;D80.031 Second, Null<
Import�MathLink /«m�Z�[��w�E$��[/¥¦+8�U�J�¨�[�<=¯�±±m@��56��{�����KÂm�SL�?+A
walltime = AbsoluteTiming@Import@"80bau3b.mps", "MPSData"D;D80.9062558 Second, Null<
w�E$��[U«m@56�E$��[�Mathematica Z�[�6�¨�[>¨�«m@56�áâ¬�QR$!kDQl)��ÁÂ/+8��«m@56���)�Timing����AbsoluteTiming��������?+A
latency = First@walltime − First@krnltime
0.875256 Second
����������������������������Mathematica 5�gÒ¸xG@õ½��^¿s�l�E¬Dß��Ì�v2�üÇ�ÁÂ�õ½~ß��^¿��/tu¹º»���?�v2�-./cd2��?+A
���� Norm
v��Norm�-±��Ã2�À�Uy8�`·e¸xG��?+AJJU�Sx10j�y\���2s�l/��2?+A
tbl = Table@Random@D, 8100000<D;Norm@Table@Random@D, 8100000<D, 2D êê Timing
80.032 Second, 182.393<
Norm���y\���K«`J�)U_?+AJJU���y\���p s�l/�l2?+A
What's New in Mathematica 5 41
Norm@8a, b, c<, pDHAbs@aDp + Abs@bDp + Abs@cDpL 1
����p
{��7/¢£2@K�U+A����^¿�x?Í?p s�l)�lxG��?+A
Norm@88a, b<, 8c, d<<, 1DMax@Abs@aD + Abs@cD, Abs@bD + Abs@dDD
Norm@88a, b<, 8c, d<<, InfinityDMax@Abs@aD + Abs@bD, Abs@cD + Abs@dDD
Norm@88a, b<, 8c, d<<, FrobeniusD"#########################################################################################Abs@aD2 + Abs@bD2 + Abs@cD2 + Abs@dD2
JJU��Norm��Gpq�l~/x���/+8@Í�«�G��?+A^¿J 1 23 4
N�s�l/«8@Í��ôõ��`^¿s�l�l~)«�G��?+A
∞A¥ = maxx∫0
∞A ÿ x¥ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
∞x¥
A = 881, 2<, 83, 4<<;FindMaximum@[email protected], 2D ê Norm@x, 2D, 8x, 80.001, 0.001<<D
85.46499, 8x → 80.000832741, 0.00118166<<<
������������������������������������Mathematica 5����������� �������Mathematica 5������Root��������������Root������������� �!"�#$%&' (�)��� �!"��� Root������ #$%&'�*� ����+,-�.�/����
AlgebraicNumberFields0123��435����
<< "NumberTheory`AlgebraicNumberFields`"
6)��������� 783�9)���
a = Algebraic@#13 − #1 + 1 &, 81, 2, 3<, 1D
Algebraic@1 − #1 + #13 &, 81, 2, 3<, 1D
����������:�;��<=>�,6� �����
N@a, 20D
3.6151970842505862282
42 What's New in Mathematica 5
���������?@A���B6�<C���
a = Algebraic@#14 + 7 #1 − 21 &, 81, 2, 3, 4<, 1D;b = Algebraic@#14 + 7 #1 − 21 &, 89, 8, 7, 5<, 1D;2 a2 − 3 a b + 5 b5 − 3���������������������������������������������������
a8 − b4 +1����2
+ 9
AlgebraicA−21 + 7 #1 + #14 &, 9 41286695899369558776723710439212189982056327290172063���������������������������������������������������������������������������������������������������������������������������������������������������������������
4586375026009762651263976115838375027468985058462049,
6520802026300441952691134470541521717177617572114���������������������������������������������������������������������������������������������������������������������������������������������������������������
13759125078029287953791928347515125082406955175386147,
3688721281596550115065494536738395724701865336152���������������������������������������������������������������������������������������������������������������������������������������������������������������
13759125078029287953791928347515125082406955175386147,
2274021184276897634212701763901059483341282983762���������������������������������������������������������������������������������������������������������������������������������������������������������������
13759125078029287953791928347515125082406955175386147=, 1E
;�ToCommonField�=B��DE������(FGH��IJ�GKLMN�OP,6� �����
ToCommonFieldA9è!!!!2 ,
è!!!!3 =E
9AlgebraicA1 − 10 #12 + #14 &, 90, −
9�����
2, 0,
1�����
2=, 4E,
AlgebraicA1 − 10 #12 + #14 &, 90, 11�������
2, 0, −
1�����
2=, 4E=
GH��QE�GKLMNR������ST�����U��N�V����WXYZ�[\�����
��]^ E_���
8a, b, c< = 9�, è!!!!2 , Root@#13 − 2 #1 + 3 &, 1D=;
f =−2 y z H7 + x − y + z2L + H6 + x2 + 2 yL H−11 + x y + z2L�����������������������������������������������������������������������������������������������������������������������������������2 y z H−4 − x + 3 y zL − H6 + x2 + 2 yL H2 − 2 x + z3L
;
��NK �/�`��K ����/���-ab�`�cd�,�����ef����ai e K ���/��gX��U�����/�z e K /�h�ki �ijz = k1 a1 + … + kn an���kl���m,���8a1, …, an<���NK �/�`���
]^��533 + 429 #1 + 18 #12 + #13 &�1n �WXod9)p�N�/�`�qr���
IntegralBasis@533 + 429 #1 + 18 #12 + #13 &, 1D
91, Algebraic@533 + 429 #1 + 18 #12 + #13 &, 80, 1, 0<, 1D,AlgebraicA533 + 429 #1 + 18 #12 + #13 &, 9 742
����������
759,
94����������
759,
1����������
759=, 1E=
�NK �st'�K �/�`8a1, …, an<�st'�j�XuT NumberFieldTrace@ai a jD�g,�v�st
'���st'�w��/�`�w�xy��mz�
]^�QI2 -è!!!!
3 + 51ê4M�st'���
NumberFieldDiscriminantA2 −
è!!!!3 + 51ê4E
5184000000
What's New in Mathematica 5 43
��������������������Mathematica 4.2�{P�|}9)pAuthorTools L~9)��3��1���������� ��,�3� ��\(�)��p�
Mathematica 5 ��f��5��3>���+0�1����U��f����3�>���9)pf��5��3��<a���+���
44 What's New in Mathematica 5