Introduction
   InetCAS
     InetMaple
     InetReduce
   InetApplication
     InetMatlab
   Mathematics
     Combinatorics
       - numbpart
       - multipart
       - arithinva
       - rbf

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 와 관련된 다양한 자료를 접할 수 있음.

 
  Mail to Professor Sun Tae Soh Copyrights trinitas.mju.ac.kr All Rights Reserved.