#                              Ren-Cang Li, June 1, 1996
#                              na.rcli@na-net.ornl.gov

read('s19odr6Eq'): 
readlib(write):
read('cx1fixedf3out');
read('iterndcx4');
read('ToCheck');

Digits:=100: DumpDigits:=20:

# Compute s19odr6a
# ======= ========

# Initial guesses

x0U:=vector([                  0.74466097102521,
             0.87155554956551, 0.02846630083721, 
	     0.09478327658934, 0.46711376210195, 
	     0.80810826029536, 0.45001092520136]):
cx10U:=0.18956655317868:
x0L:=vector([                  0.74392120291336,
             0.87157333716497, 0.02846405458494, 
	     0.09436486571794, 0.46632546717462,
	     0.80774727003916, 0.45001869587495]):
cx10L:=0.18872973143588:
xM:=vector(7): 
cx1M:=Iterndcx4(x0L,cx10L,x0U,cx10U,xM):
#
#  It is intended to compute the point on the first curve where
#   
#     Max(StepSize) = 1- 2 cx[4] = minimum.
#
#  Check Accuracy

ResiErr(cx1M,xM);

#  Print Out the solution

cx0:=vector([0,cx1M,xM[1],xM[2],xM[3]]):
cy0:=vector([xM[4],xM[5],xM[6],xM[7],1/2]):
appendto(s19odr6abcd);
writeln();
write(`s19odr6a:`); writeln();
write(`========`); writeln();
read('WriteItOut');
close();

# Compute s19odr6b
# ======= ========

read('iterndcx34dcy34');

# Initial guesses

x0U:=vector([                  0.74098442314703,
	     0.87177341108662, 0.02829591658166, 
	     0.09259945276944, 0.46309166434295, 
	     0.80637891711682, 0.45003466383414]):
cx10U:=0.18519890553887:
x0L:=vector([                  0.73689948476029, 
	     0.87249025347308, 0.02752196089502, 
	     0.08979154693271, 0.45824128931286, 
	     0.80469486911669, 0.45000610718405]):
cx10L:=0.17958309386543:
cx1M:=Iterndcx34dcy34(x0L,cx10L,x0U,cx10U,xM):
#
#  It is intended to compute the point on the first curve where
#   
#     Sum(StepSize) = 2( cx1+(cx2-cx1)+(cx3-cx2)+(cx3-cx4) )+ 1-2*2cm4
#                     +2( cy1+(cy2-cy1)+(cy3-cy2)+(cy3-cy4)+1/2-cy4)
#                   =4(cx3-cx4+cy3-cy4)+2

#  Check Accuracy

ResiErr(cx1M,xM);

#  Print Out the solution

cx0:=vector([0,cx1M,xM[1],xM[2],xM[3]]):
cy0:=vector([xM[4],xM[5],xM[6],xM[7],1/2]):
appendto(s19odr6abcd);
writeln();
write(`s19odr6b:`); writeln();
write(`========`); writeln();
read('WriteItOut');
close();

# Compute s19odr6c
# ======= ========

# Initial guesses

x0U:=vector([                  0.72469081440953, 
	     0.01843447121721, 0.10072741285811,
	     0.19621748961566, 0.55856289682042,
	     0.37156264281337, 0.05958094203766]):
cx10U:=0.39243497923132:
x0L:=vector([                  0.72485759121015,
	     0.01862171930033, 0.10072691811225,
	     0.19589590717006, 0.55832470277513,
	     0.37173965525524, 0.05967431870629]):
cx10L:=0.39179181434012:
xM:=vector(7): 
cx1M:=Iterndcx4(x0L,cx10L,x0U,cx10U,xM):
#
#  It is intended to compute the point on the second curve where
#   
#     Max(StepSize) = 1- 2 cx[4] = minimum.
#
#  Check Accuracy

ResiErr(cx1M,xM);

#  Print Out the solution

cx0:=vector([0,cx1M,xM[1],xM[2],xM[3]]):
cy0:=vector([xM[4],xM[5],xM[6],xM[7],1/2]):
appendto(s19odr6abcd);
writeln();
write(`s19odr6c:`); writeln();
write(`========`); writeln();
read('WriteItOut');
close();

# Compute s19odr6c
# ======= ========

read('iterndcx23dcy24');

# Initial guesses

x0U:=vector([                  0.72823330548224,
             0.02093243682815, 0.09998221079284,
	     0.19142453992287, 0.55554119266399, 
	     0.37458287115520, 0.06045732381050]):
cx10U:=0.38284907984573:
x0L:=vector([                  0.72838998139700,
             0.02100201325004, 0.09992895511679,
	     0.19126785623240, 0.55546284693090,
	     0.37469599732352, 0.06046548418341]):
cx10L:=0.38253571246480:
cx1M:=Iterndcx23dcy24(x0L,cx10L,x0U,cx10U,xM):
#
#  It is intended to compute the point on the second curve where
#   
#     Max(StepSize) = 2[ cx1+(cx2-cx1)+(cx2-cx3)+(cx4-cx3) ]+1-2*cx4
#                     +2[ cy1+(cy2-cy1)+(cy2-cy3)+(cy3-cy4)+1/2-cy4 ]
#                   =4(cx2-cx3+cy2-cy4) + 1.
#
#  Check Accuracy

ResiErr(cx1M,xM);

#  Print Out the solution

cx0:=vector([0,cx1M,xM[1],xM[2],xM[3]]):
cy0:=vector([xM[4],xM[5],xM[6],xM[7],1/2]):
appendto(s19odr6abcd);
writeln();
write(`s19odr6d:`); writeln();
write(`========`); writeln();
read('WriteItOut');
close();
