Here is a transcript of a Maple session that demonstrates the use of the Maple program c05.mpl.
The program is run in cypress.csc.fi. It generates files for use with Matlab's Genmex extension, transfers them to dopey.hut.fi, where Matlab and Genmex are run to calculate the zeroes of nonlinear function using NAG routines. The results are written to a file which is transferred back to cypress and read into Maple.
First we define a few functions, plot their functions in the same graph using polimpplot, and solve them with Maple's solve function:
> helppof1:=x1*x2-x2^3-1; 3 helppof1 := x1 x2 - x2 - 1 > helppof2:=x1^2*x2+x2-5; 2 helppof2 := x1 x2 + x2 - 5 > read `polimpplot.mpl`; Warning, `tempdir` is implicitly declared local > plot1:=polimpplot(helppof1, x1=-3..3, x2=-3..3); > plot2:=polimpplot(helppof2, x1=-3..3, x2=-3..3); > with(plots): > display({plot1,plot2});> evalf(solve({helppof1=0, helppof2=0}, {x1,x2})); {x2 = 1., x1 = 2.}, {x1 = .420809921 + 2.062359942 I, x2 = - 1.232862814 - .6956229500 I}
> read `c05setup.mpl`; > c05setup(); C05 setup files copied to dopey.hut.fi into directory /usr/tmp/kenny/c05/. Matlab setup script c05setup.m run in dopey.hut.fi.
> read `c05.mpl`; > > c05([helppof1, helppof2], [x1,x2], [1,1]); ASP for c05 (function and jacobian) generated in file c05fj.m. ASP for c05 (function only) generated in file c05fun.m. Files c05fj.m,c05fun.m and c05.m copied to dopey.hut.fi. Matlab calculations done in dopey.hut.fi. Output files copied from dopey.hut.fi. -11 -10 [[[2., 1.]], [[.5377476200000000*10 ], [.1330047200000000*10 ]], -11 -10 [[2., 1.]], [[.5377920300000000*10 ], [.1330224800000000*10 ]]]
Then we do the the same with another set of functions:
> toinenesimf:=[z^2-x^2-y^2+2*a*x+2*a*z-a^2, y*z-a*y-a*x+a^2, -2*a+x+y]; toinenesimf := 2 2 2 2 2 [z - x - y + 2 a x + 2 a z - a , y z - a y - a x + a , - 2 a + x + y] > a:=1: > toinenesimf; 2 2 2 [z - x - y + 2 x + 2 z - 1, y z - y - x + 1, - 2 + x + y] > evalf(solve(convert(toinenesimf,set))); {z = - 1. I, y = 1. I, x = 2. - 1. I}, {z = -2.732050808, y = -.366025404, x = 2.366025404}
> c05(toinenesimf, [x, y, z], [-2.7,-.4,2.4]); ASP for c05 (function and jacobian) generated in file c05fj.m. ASP for c05 (function only) generated in file c05fun.m. Files c05fj.m,c05fun.m and c05.m copied to dopey.hut.fi. Matlab calculations done in dopey.hut.fi. Output files copied from dopey.hut.fi. [[[2.3660254000000, -.36602540000000, -2.7320508000000]], -11 -12 -15 [[.56621374000000*10 ], [-.39634962000000*10 ], [.11102230000000*10 ]], [[2.3660254000000, -.36602540000000, -2.7320508000000]], -11 -12 -16 [[.56648020000000*10 ], [-.39723780000000*10 ], [.55511151000000*10 ]]]
> c05(toinenesimf, [x, y, z], [0,0,0]); ASP for c05 (function and jacobian) generated in file c05fj.m. ASP for c05 (function only) generated in file c05fun.m. Files c05fj.m,c05fun.m and c05.m copied to dopey.hut.fi. Matlab calculations done in dopey.hut.fi. Output files copied from dopey.hut.fi. [[[.6339746000000001, 1.366025400000000, .7320508100000001]], -12 -13 [[.5753175700000000*10 ], [.2120526000000000*10 ], [0]], [[.6339746000000001, 1.366025400000000, .7320508100000001]], -12 -13 -15 [[.57553962000000*10 ], [.20983215000000*10 ], [-.22204460000000*10 ]]]
c05setup();must be executed when the program is run for the first time with a specific configuration.