1. reduce@trinitas.mju.ac.kr
ÀÇ ¸ñÀû [ English
]
À§ ÁÖ¼Ò·Î µµÂøÇÑ ÀüÀÚ¸ÞÀÏ º»¹®ÀÇ
input:
°ú
end input:
»çÀÌ¿¡ ÀÖ´Â Reduce ¸í·É¾îµéÀ»
ÀÚµ¿ÀûÀ¸·Î ½ÇÇàÇÑ ÈÄ ±× °á°ú¸¦
ÀüÀÚ¸ÞÀÏ·Î º¸³» ÁÜ.
2. ¼Ò°³
InetCompu ¼ºñ½º¸¦ ÅëÇÏ¿© Computer Algebra
System (CAS) ÀÎ Reduce ¸¦ »ç¿ëÇÒ ¼ö
ÀÖ´Ù. ƯÈ÷, ¹ÌÀûºÐÇÐ,
¼±Çü´ë¼öÇÐ ¹× °øÇмöÇÐ µîÀÇ ¿©·¯
ºÐ¾ß¿¡ °ÉÃÄ ´Ù¾çÇÑ ¼öÄ¡Çؼ®Àû
°è»ê ¹× ¹ÌºÐ°ú ÀûºÐ µîÀÇ °è»ê¿¡
¾î·Á¿òÀ» °Þ°í ÀÖ´Â °íµîÇлý, ´ëÇлý
¹× ´ëÇпø»ýµé¿¡°Ô »ó´çÇÑ µµ¿òÀÌ µÉ
°ÍÀÌ´Ù.
3. Notes
3-1. ¿¹¸¦ µé¾î, ReduceÀÇ ±×·¡ÇȽº °ü·Ã ¸í·É¾îÀÇ °æ¿ì¿¡
ÀÖ¾î¼, ¾ÆÁ÷Àº ÇØ»ó·ÂÀÌ ¶Ù¾î³
°á°ú¸¦ º¼ ¼ö ¾øÀ½. (ÇâÈÄ ±â´Éº¸° ÇÒ
°èȹÀÓ).
3-2. Á¢¼öµÈ ÀüÀÚ¸ÞÀÏÀ» ¿¡·¯¾øÀÌ
ó¸®Çϱâ À§ÇÏ¿©, Microsoft »çÀÇ Outlook
Express¿¡¼ New mail > Alt+O > Alt+X (with
No Encryption) À» »ç¿ëÇÏ¿© reduce@trinitas.mju.ac.kr
·Î ´ÙÀ½ÀÇ Á¦ 4Ç×ÀÇ ¼³¸í¿¡ µû¶ó
ÀÛ¼ºÇÑ ÀüÀÚ¸ÞÀÏÀ» º¸³¾ °ÍÀ»
±ÇÀåÇÑ´Ù. ±×¸®°í, ´ÙÀ½ÀÇ Á¦ 3-3Àý ¹×
Á¦ 3-4ÀýÀ» Ãß°¡·Î ÀÐÀ» °ÍÀ» Àû±Ø
±ÇÀåÇÑ´Ù.
3-3. (Important)
¾Æ·¡ÀÇ ¿¹Á¦¿¡¼ º¸ÀÎ ¹Ù¿Í °°ÀÌ,
¿¹¸¦ µé¾î, Reduce ¸í·É¾î·Î½á §
ÇÁ·Î±×·¥¿¡ ÀÖ¾î "<<"
¿Í ">>" ÀÇ Æ¯¼ö ¹®ÀÚ
´ë½Å¿¡ °¢°¢ "begin" °ú "end"
À» »ç¿ëÇÒ °ÍÀ» °·ÂÇÏ°Ô ±ÇÀåÇÕ´Ï´Ù.
ÀÌ°ÍÀº ¿©·¯ºÐµéÀÌ »ç¿ëÇÏ´Â Web±â¹Ý
ÀüÀÚ¸ÞÀÏ ¼¹öÃø¿¡¼ ´ç½ÅÀÇ
ÀüÀÚ¸ÞÀÏÀÇ º»¹®¿¡ ´ëÇÏ¿© Áö³ªÄ£
¼öÁØÀ¸·Î ÇÊÅ͸µ ÀÛ¾÷À» ¼öÇàÇÏ´Â
°úÁ¤¿¡¼ ¹ß»ýÇÒ ¼ö ÀÖ´Â À̵é
Ư¼ö¹®ÀÚ¿¡ ´ëÇÑ À߸øµÈ ó¸®ÀÇ
¹®Á¦¸¦ ±Ùº»ÀûÀ¸·Î ÇÇÇϱâ
À§ÇÔÀÔ´Ï´Ù. ´ÙÀ½ÀÇ Æ¯¼ö ¹®Àڵ鿡
´ëÇÏ¿©¼µµ ÀûÀýÇÑ Á¶Ä¡¸¦ ÇÏ¿© ÁÙ
°ÍÀ» Àû±Ø ±Ç°íÇÕ´Ï´Ù: Áï, "<="
´ë½Å¿¡ "leq" À», ">="
´ë½Å¿¡ "geq" À», "="
´ë½Å¿¡ "eq" À», ">"
´ë½Å¿¡ "greaterp" À»,
±×¸®°í "<" ´ë½Å¿¡ "lessp"
À» »ç¿ëÇÒ °ÍÀ» ±Ç°íÇÕ´Ï´Ù.
3-4. (Warning) À§ÀÇ Æ¯¼ö ¹®ÀÚ¸¦ ÀüÇô
»ç¿ëÇÏÁö ¾Ê´Â °æ¿ì¿¡ À־µ,
°øÂ¥·Î Á¦°øµÇ´Â Web±â¹Ý ÀüÀÚ¸ÞÀÏ
¼¹öÃøÀÇ ¿î¿µÀÚ°¡ »ó¾÷Àû ±¤°í¹®À»
»ç¿ëÀÚ ÀüÀÚ¸ÞÀÏÀÇ Áß°£¿¡ °Á¦·Î
»ðÀÔÇÏ´Â °æ¿ì°¡ ÀÖÀ¸¸ç ÀÌ·¯ÇÑ garbage¸¦
Æ÷ÇÔÇÑ ÀüÀÚ¸ÞÀÏÀÌ Á¢¼öµÉ °æ¿ì´Â
InetCompu ¼ºñ½ºÀÇ Á¦°ø¿¡ ½É°¢ÇÑ
¾î·Á¿òÀÌ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù.
±×·¯¹Ç·Î, °¡´ÉÇÑ ÇÑ Microsoft »çÀÇ Outlook
Express¿¡¼ New mail > Alt+O > Alt+X (with
No Encryption) À» »ç¿ëÇÏ¿© reduce@trinitas.mju.ac.kr
·Î ÀüÀÚ¸ÞÀÏÀ» º¸³¾ °ÍÀ»
±ÇÀåÇÕ´Ï´Ù.
4. ÀüÀÚ¸ÞÀÏÀ»
º¸³»´Â ¹æ¹ý: ¿¹¸¦ µé¾î,
ÀüÀÚ¸ÞÀÏÀÇ º»¹®ÀÌ ¹ÌÀûºÐÇп¡¼
´Ù·ç´Â ¶ó±×¶ûÁÖÀÇ ½Â¼ö¹ý¿¡ µû¶ó
ÁÖ¾îÁø ´Ùº¯ ´ÙÇ×ÇÔ¼ö f ¿Í ´ÙÇ×½Ä
Á¦¾àÁ¶°Ç g =0 ÇÏ¿¡¼ f °¡ ÀÓ°èÁ¡¿¡¼
°®°Ô µÇ´Â ÃÖ´ë°ª ȤÀº ÃÖ¼Ò°ªÀ»
±¸ÇÏ´Â ¾Æ·¡ÀÇ ÇÁ·Î±×·¥À¸·Î ÀÌ·ç¾îÁø plain-text
¾ç½ÄÀÇ ÀüÀÚ¸ÞÀÏ (¿¹¸¦ µé¾î, Microsoft
Outlook Express ÀÏ °æ¿ì¿¡´Â New mail > Alt+o
> Alt+x (with No Encryption)) À» reduce@trinitas.mju.ac.kr
·Î º¸³½´Ù:
input:
off echo$
off nat$
write "comment The following program computes
minimum and
maximum of a polynomial function f in 3 variables under
a polynomial constraint g=0. It is a prototype example of
Lagrange's method of multipliers, lamda";
% inputs:
f:=x^3+2*x*y*z-z^2$
g:=x^2+y^2+z^2-1$
% If you choose inputs different from the above
ones,
% then you may have to modify the following lines.
f1:=df(f,x)-lamda*df(g,x)$
f2:=df(f,y)-lamda*df(g,y)$
f3:=df(f,z)-lamda*df(g,z)$
result:=solve({f1,f2,f3,g},{lamda,x,y,z})$
%% You don't have to modify the rest of lines.
write "critical points := ",result;
write "comment Now mimimum and maximum of f under the constraint
g=0 are determined as:";
minimum:=sub(part(result,1),f)$
ctps_min:=part(result,1)cons{}$
maximum:=sub(part(result,1),f)$
ctps_max:=part(result,1)cons{}$
j:=2$
while j leq length(result) do
begin a:=sub(part(result,j),f)$
if a geq maximum then
begin if a greaterp maximum then
begin maximum:=a$
ctps_max:=part(result,j)cons{}$
end
else if a leq minimum then
begin
ctps_min:=part(result,j).ctps_min$
end
else
begin
ctps_max:=part(result,j).ctps_max$
end$
end
else if a leq minimum then
begin if a lessp minimum then
begin minimum:=a$
ctps_min:=part(result,j)cons{}$
end
else
begin
ctps_min:=part(result,j).ctps_min$
end$
end
else begin end$
j:=j+1$
end$
write "The maximum value of f under g=0 is, ",maximum,", and it occurs at the critical points ",ctps_max;
write "The minimum value of f under g=0 is, ",minimum,", and it occurs at the critical points ",ctps_min;
write "comment Check: Here are the values of f at all the
computed critical points";
j:=1$
while j leq length(result) do
begin a:=sub(part(result,j),f)$
write "The value of f at the critical point ",part(result,j)," is: ", a;
j:=j+1$
end$
end input:
±×·¯¸é, ÀüÀÚ¸ÞÀÏÀÇ µµÂø
Áï½Ã input: °ú end input: »çÀÌÀÇ Reduce
¸í·É¾îµéÀ» ÀÚµ¿ÀûÀ¸·Î ¼öÇàÇÏ¿© ±×
°á°ú¿Í º» ¼¹ö¿¡¼ Àüü °è»ê¿¡ ¼Ò¿äµÈ ½Ã°£(timex
report)À» ´ãÀº ÀüÀÚ¸ÞÀÏÀ» ¼Û½ÅÀÚ¿¡°Ô Áï½Ã ¹ß¼ÛÇÔ.
[ÁÖÀÇ] º¹ÀâÇÏÁö
¾ÊÀº °è»êÀ» À§ ÀüÀÚ¸ÞÀÏ ÁÖ¼Ò·Î
ÀÇ·ÚÇÏ¿´À» °æ¿ì¿¡´Â ´ë°³ 3 - 4 ºÐ
À̳»¿¡ °á°ú¸¦ ¹Þ¾Æ º¼ ¼ö
ÀÖ½À´Ï´Ù. ±×·¯³ª, ÀÇ·ÚÇÑ °è»êÀ»
¼öÇàÇÑ ÈÄ ±× °è»ê°á°ú¸¦ ´ä½ÅÀ¸·Î¼
¼Û½ÅÀÚ¿¡°Ô º¸³» µå·ÈÀ¸³ª, (i)
¼Û½ÅÀÚÀÇ ÁÖ¼Ò°¡ Ʋ¸®°Å³ª (ii) ȤÀº
¼Û½ÅÀÚÀÇ ÀüÀÚ¸ÞÀÏ ÅëÀÌ ´Ù¸¥
ÀüÀÚ¸ÞÀÏ·Î °¡µæ Â÷ ÀÖ¾î, ¼Û½ÅÀÚ
Ãø¿¡ Á¦´ë·Î Á¢¼ö°¡ µÇÁö ¾Ê°í µÇµ¹¾Æ
¿À´Â °æ¿ì°¡ °£È¤ ÀÖÀ¸´Ï, À§ÀÇ Á¦ 4Ç×ÀÇ
ÀüÀÚ¸ÞÀÏ ÁÖ¼Ò·Î °è»êÀ» ÀÇ·ÚÇÑ ÈÄ
ÀÏÁ¤½Ã°£ ÀÌ»ó ±â´Ù·Áµµ ´ä½ÅÀÌ ¾øÀ»
°æ¿ì¿¡´Â, º»ÀÎÀÇ ¸ÞÀÏ°èÁ¤ÀÇ »óŸ¦
Á¡°ËÇÏ¿© (i) °ú (ii)ÀÇ ¹®Á¦¸¦
ÇØ°áÇÑ ÈÄ ´Ù½Ã ÇÑ ¹ø À§ÀÇ Á¦ 4Ç×°ú
°°ÀÌ ÀüÀÚ¸ÞÀÏÀ» º¸³» Áֽøé
µÇ°Ú½À´Ï´Ù.
5. ¿¹Á¦
º»¹®ÀÌ À§ÀÇ Á¦ 4Ç׿¡ ÀÖ´Â
ÇÁ·Î±×·¥À¸·Î ÀÌ·ç¾îÁø ÀüÀÚ¸ÞÀÏÀ» reduce@trinitas.mju.ac.kr
·Î º¸³»¸é ´ÙÀ½°ú °°Àº °è»ê °á°ú¸¦
¹Þ¾Æº¸°Ô µÉ °ÍÀÔ´Ï´Ù:
Comment The followings are the
requested inputs:
off echo$
off nat$
write "comment The following program computes
minimum and
maximum of a polynomial function f in 3 variables
under
a polynomial constraint g=0. It is a prototype
example of
Lagrange's method of multipliers, lamda";
% inputs:
f:=x^3+2*x*y*z-z^2$
g:=x^2+y^2+z^2-1$
% If you choose inputs different from the above
ones,
% then you may have to modify the following lines.
f1:=df(f,x)-lamda*df(g,x)$
f2:=df(f,y)-lamda*df(g,y)$
f3:=df(f,z)-lamda*df(g,z)$
result:=solve({f1,f2,f3,g},{lamda,x,y,z})$
%% You don't have to modify the rest of lines.
write "critical points := ",result;
write "comment Now mimimum and maximum of f
under the constraint
g=0 are determined as:";
minimum:=sub(part(result,1),f)$
ctps_min:=part(result,1)cons{}$
maximum:=sub(part(result,1),f)$
ctps_max:=part(result,1)cons{}$
j:=2$
while j leq length(result) do
begin a:=sub(part(result,j),f)$
if a geq maximum then
begin if a greaterp maximum then
begin maximum:=a$
ctps_max:=part(result,j)cons{}$
end
else if a leq minimum then
begin
ctps_min:=part(result,j).ctps_min$
end
else
begin
ctps_max:=part(result,j).ctps_max$
end$
end
else if a leq minimum then
begin if a lessp minimum then
begin minimum:=a$
ctps_min:=part(result,j)cons{}$
end
else
begin
ctps_min:=part(result,j).ctps_min$
end$
end
else begin end$
j:=j+1$
end$
write "The maximum value of f under g=0 is,
",maximum,", and it occurs at the
critical points ",ctps_max;
write "The minimum value of f under g=0 is,
",minimum,", and it occurs at the
critical points ",ctps_min;
write "comment Check: Here are the values of
f at all the computed critical points";
j:=1$
while j leq length(result) do
begin a:=sub(part(result,j),f)$
write "The value of f at the critical point
",part(result,j)," is: ", a;
j:=j+1$
end$
Comment Here are the results:$
comment The following program computes minimum and
maximum of a polynomial function f in 3 variables
under
a polynomial constraint g=0. It is a prototype
example of
Lagrange's method of multipliers, lamda$
critical points := {{x=( -
2)/3,z=2/3,y=1/3,lamda=( - 4)/3},
{x=( - 2)/3,z=( - 2)/3,y=( - 1)/3,lamda=( - 4)/3},
{x=( - 3)/8,
z=sqrt(11)/(8*sqrt(2)),
y=( - 3*sqrt(11))/(8*sqrt(2)),
lamda=1/8},
{x=( - 3)/8,
z=( - sqrt(11))/(8*sqrt(2)),
y=(3*sqrt(11))/(8*sqrt(2)),
lamda=1/8},
{x=1,z=0,y=0,lamda=3/2},
{x=0,z=1,y=0,lamda=-1},
{x=0,z=0,y=1,lamda=0},
{x=0,z=0,y=-1,lamda=0},
{x=0,z=-1,y=0,lamda=-1},
{x=-1,z=0,y=0,lamda=( - 3)/2}}$
comment Now mimimum and maximum of f under the
constraint
g=0 are determined as:$
The maximum value of f under g=0 is, 1, and it
occurs at the critical points {{x
=1,z=0,y=0,lamda=3/2}}$
The minimum value of f under g=0 is, ( - 28)/27
, and it occurs at the critical points {{x=( -
2)/3,z=( - 2)/3,y=( - 1)/3,lamda=
( - 4)/3},
{x=( - 2)/3,z=2/3,y=1/3,lamda=( - 4)/3}}$
comment Check: Here are the values of f at all the
computed critical points$
The value of f at the critical point {x=( -
2)/3,z=2/3,y=1/3,lamda=( - 4)/3}
is: ( - 28)/27$
The value of f at the critical point {x=( -
2)/3,z=( - 2)/3,y=( - 1)/3,lamda=( -
4)/3} is: ( - 28)/27$
The value of f at the critical point {x=( - 3)/8,
z=sqrt(11)/(8*sqrt(2)),
y=( - 3*sqrt(11))/(8*sqrt(2)),
lamda=1/8} is: 7/128$
The value of f at the critical point {x=( - 3)/8,
z=( - sqrt(11))/(8*sqrt(2)),
y=(3*sqrt(11))/(8*sqrt(2)),
lamda=1/8} is: 7/128$
The value of f at the critical point
{x=1,z=0,y=0,lamda=3/2} is: 1$
The value of f at the critical point
{x=0,z=1,y=0,lamda=-1} is: -1$
The value of f at the critical point
{x=0,z=0,y=1,lamda=0} is: 0$
The value of f at the critical point
{x=0,z=0,y=-1,lamda=0} is: 0$
The value of f at the critical point
{x=0,z=-1,y=0,lamda=-1} is: -1$
The value of f at the critical point
{x=-1,z=0,y=0,lamda=( - 3)/2} is: -1$
comment The following is the timex report of the
system in seconds:
real
1.70
user
0.40
sys
0.13
$
Remark. Maple ÀÇ
°æ¿ì¿Í´Â ´Þ¸® reduce@trinitas.mju.ac.kr
À¸·Î ºÎÅÍ Reduce ¸í·É¾î¿¡ ´ëÇÑ
¼³¸íÀ» ¾òÀ» ¼ö ¾øÀ¸³ª, intro2reduce.html
¿¡ Á¢¼ÓÇϸé user's help ¿Í °ü·ÃµÈ
´Ù¾çÇÑ ÀڷḦ Á¢ÇÒ ¼ö ÀÖÀ½.
|