Maple 2023 Questions and Posts

These are Posts and Questions associated with the product, Maple 2023

Hello,
I recently discovered the "Physics" package wich provides tools for manipulating abstract vectors (non-component).
In the "Physics:-Vectors", an orthonormal basis (i,j,k) is available and my main concern is how to generate arbitrary other 3D orthonormal bases to be able to calculate results in "vectorial form" without manipulating vectors' components.

To better explain my needs I have setup a kind of minimal example in the attached file where some questions are asked.

Thanks in advance for any feedback.

orthonormal-triads.mw

NULL

restart

with(Physics)

with(Physics[Vectors])

Creation of 2 rotation matrices

dir1 := `<,>`(0, 0, 1)

dir2 := `<,>`(0, 1, 0)

seq(assign(cat(R, i), Student:-LinearAlgebra:-RotationMatrix(theta[i], eval(cat(dir, i)))), i = 1 .. 2)

print(R1, R2)

Matrix(%id = 36893490614987576012), Matrix(%id = 36893490614987577572)

(1)

whattype(R1)

Creation of  orthogonal unit "Physics:-Vectors" from previous matrices

x1_ := _i*R1[1, 1]+_j*R1[2, 1]+_k*R1[3, 1]``

y1_ := _i*R1[1, 2]+_j*R1[2, 2]+_k*R1[3, 2]

z1_ := _i*R1[1, 3]+_j*R1[2, 3]+_k*R1[3, 3]NULL

NULL

x2_ := _i*R2[1, 1]+_j*R2[2, 1]+_k*R2[3, 1]NULL

y2_ := _i*R2[1, 2]+_j*R2[2, 2]+_k*R2[3, 2]

z2_ := _i*R2[1, 3]+_j*R2[2, 3]+_k*R2[3, 3]

Q1: Is there a more elegant way of creating "Physics:-Vectors" from matrices ?

Now, suppose that we want to compute `&x`(`#mover(mi("x1"),mo("&rarr;"))`, `#mover(mi("y2"),mo("&rarr;"))`) : since `#mover(mi("y2"),mo("&rarr;"))` = `#mover(mi("j"),mo("&and;"))` we have `&x`(`#mover(mi("x1"),mo("&rarr;"))`, `#mover(mi("y2"),mo("&rarr;"))`) = sin(`#mover(mi("x1"),mo("&rarr;"))`, `#mover(mi("j"),mo("&and;"))`)*`#mover(mi("z1"),mo("&rarr;"))` and sin(`#mover(mi("x1"),mo("&rarr;"))`, `#mover(mi("j"),mo("&and;"))`)*`#mover(mi("z1"),mo("&rarr;"))` = sin((1/2)*Pi-`&theta;__1`)*`#mover(mi("z1"),mo("&rarr;"))` and sin((1/2)*Pi-`&theta;__1`)*`#mover(mi("z1"),mo("&rarr;"))` = cos(theta[1])*`#mover(mi("z1"),mo("&rarr;"))`

The cross product operator  `&x`(x1_, y2_) yields

cos(theta[1])*_k

(2)

(which is a correct answer) instead of cos(theta[1])*`#mover(mi("z1"),mo("&rarr;"))` because vector `#mover(mi("z1"),mo("&rarr;"))` has is not known as a unit basis vector.

Similarly, `&x`(z1_, x1_) yields -sin(theta[1])*`#mover(mi("i"),mo("&and;"))`+cos(theta[1])*`#mover(mi("j"),mo("&and;"))` instead of  `#mover(mi("y1"),mo("&rarr;"))` as it would be the case when computing `&x`(_k, _i) ?

Q2: Is there a way to declare new triads of "Physics:-Vectors" with properties similar to the provided triad _i, _j, _k ?

Q3: Is the code defining the canonical basis i, _j, _kavailable for inspection and inspiration to setup orthonormal triads ?

Q4: Is it possible to get a (column) matrix of the vector components ? The function Physics:-Vectors:-Component(y1_, n) can only get 1 component at a time and only in the canonical basis i, _j, _k.

NULL

restart

with(Physics)

with(Physics[Vectors])NULL

After a proper definition of 2 new vector bases `#mover(mi("x1"),mo("&rarr;"))`, `#mover(mi("y1"),mo("&rarr;"))`, `#mover(mi("z1"),mo("&rarr;"))` and `#mover(mi("x2"),mo("&rarr;"))`, `#mover(mi("y2"),mo("&rarr;"))`, `#mover(mi("z2"),mo("&rarr;"))`, the position vector OM_ := l__1*x1_+l__2*x2_NULLNULL

l__1*x1_+l__2*x2_

(3)

NULL

projected on `#mover(mi("x2"),mo("&rarr;"))` would yield directly Typesetting[delayDotProduct](l__1, `#mover(mi("x2"),mo("&rarr;"))`.`#mover(mi("x1"),mo("&rarr;"))`, true)+l__2 instead of expand(OM_.x2_)

l__1*Physics:-Vectors:-`.`(x1_, x2_)+l__2*Physics:-Vectors:-Norm(x2_)^2

(4)

because of the unit vectors.

Download orthonormal-triads.mw

This used to work in Maple 2022.  Something is broken in 2023. 

 

restart;

kernelopts(version);

`Maple 2023.1, X86 64 LINUX, Jul 07 2023, Build ID 1723669`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1561 and is the same as the version installed in this computer, created 2023, October 20, 22:58 hours Pacific Time.`

U := Int(exp(-1/4*t - 1/4*x)*piecewise(x < -2, 1, x < -1, -x - 1, 0), x = -t .. 0);

Int(exp(-(1/4)*t-(1/4)*x)*piecewise(x < -2, 1, x < -1, -x-1, 0), x = -t .. 0)

Uval := simplify(value(U));

Uval := `simplify/piecewise/unfactor`(4*piecewise(t < 1, 0, t < 2, t-5+4*exp(`&ndash;`((1/4)*t)+1/4), 2 <= t, 1+4*exp(`&ndash;`((1/4)*t)+1/4)-4*exp(`&ndash;`((1/4)*t)+1/2)))

eval(Uval, {x=5, t=6});

`simplify/piecewise/unfactor`(4+16*exp(-5/4)-16*exp(-1))

 
 

Download simplify-piecewise-bug.mw

 

Maple thinks the inverse Laplace transform of 1/(s+a) is exp(a*t).  It should be exp(−a*t).

This used to work correctly in Maple 2022.  Something got messed up in 2023.

restart;

kernelopts(version);

`Maple 2023.1, X86 64 LINUX, Jul 07 2023, Build ID 1723669`

with(inttrans):

exp(-a*t);

exp(-a*t)

laplace(%, t, s);

1/(s+a)

invlaplace(%, s, t);

exp(a*t)

 

Download laplace-transform-bug.mw

This is not a critical situation. A solution was developed. However, I am interested in trying to understand and explain to a colleague why their function failed to plot. The colleague often works on problems involving large factorial values.

failed_plot.mw

Hi Everyone, 

I have a numeric integral which I hope to evaluate (ideally over a infinite domain) that for some reason is giving me difficulty and I cannot seem to find a work around. I want to use method = _d01amc in the integral as a means to speed up the process - I am motivating this by the answer i recieved from @acer in https://www.mapleprimes.com/questions/236772-Any-Ideas-On-How-To-Speed-Upimprove - however I keep recieving an error indicating overflow. 

This seems rather strange to me due to the fact that if I omit a method and just let Maple do its own thing it will eventually spit out an answer albeit slower then I would prefer for the procedure I am going to eventually impliment. 

My integrand and attempts/confusion can be seen in the attached worksheet. 

Any thoughts appreciated. 

OverflowError.mw

The sequence A161786 consists of “primes with at least one digit appearing exactly four times in the decimal expansion”. Below is the Maple program given in that OEIS page:

The code above picks out primes having exactly four identical digits (determined by ) from the first 10,000 prime numbers. However, it's easy to check that this program is rather slow (It takes about 2.6s to execute it!). 
Actually, I would like to select such primes from pn, pn+1, pn+2, …, pn+m-1 (typically, n=1,000,000 and m=1,000,000), where pk denotes the k-th prime number, yet the original program failes to do so in twenty minutes. Part of the reason is that for long sequences, the efficiency can be critical. Therefore I make a slight modification to the original code: 

A161786__0 := proc(m::nonnegint, n::posint := 1, ` $`)::'Vector'(prime):
	#(*
	    kernelopts(opaquemodules = false):
	# *)
	local p := ifelse(n = 1, 1, ithprime(n - 1)), vec := Vector('datatype' = prime);
	to m do
		if ormap(`=`, MultiSet(`convert/base`:-MakeSplit(length((p := nextprime(p))), 1, 10)(p)):-hash, 4) then
			vec ,= p
		fi
	od;
	vec
end:

Nevertheless, this version is still inefficient: 

time[real](A161786__0(10**6, 10**6));
 = 
                            182.414

Another choice is converting each of integers into a string: 

A161786__1 := proc(m::nonnegint, n::posint := 1, ` $`)::'Vector'(prime):
	options no_options:
	local p := ifelse(n = 1, 1, ithprime(n - 1)), vec := DEQueue();
	to m do
		if member(4, rhs~({StringTools['CharacterFrequencies'](nprintf("%d", (p := nextprime(p))), 'digit')})) then
			vec ,= p
		fi
	od;
	Vector([vec[]], 'datatype' = prime)
end:

This time the elapsed time is reduced to nearly two minutes: 

time[real](A161786__1(10**6, 10**6));
 = 
                            118.409

But can this task be accomplished within (a quarter of) a minute in modern Maple? In other words, is there a way to make further improvement on the performance? (Note that the reference time is mesured using a adjusted version (i.e., ) of the Mma code provided in that OEIS page.) 

When printing a Maple Worksheet  often I go in the PrintPrewiev of the Mac and then select some sides to print.

This is not working anymore since I have updated from Maple 2021 to Maple 2023.

Is this known ?

Any help for his ?

Can anyone assist with this error please?

#Clear memory and load package.
restart;  
with(LinearAlgebra):

#Initialise variables,matrices and vectors.
b:=<<18>,<-2>>:
c:=<<1>,<1>>:
i:=0:
P:=<1.08,1.37,1.56,1.61>;
t:=<5,10,15,20>;
tol:=1e-6:

#Initialise Gauss-Newton matrices.
n:=Dimension(t):
f:=Matrix(n,1):
J:=Matrix(n,2):

#Display initial parameter values.
printf("Gauss-Newton Method\n");
printf("-------------------\n");
printf("Before iterations,A = %f and B = %f\n",b(1),b(2));

#Perform the Gauss-Newton method.
while max(abs(evalf(c)))>tol do
  i:=i+1;
  for r from 1 to n do
     f(r,1):=evalf((In(b(1)+t[r])+b(2))-P[r]);
     J(r,1):=evalf(1/b(1)+t[r]);
     J(r,2):=evalf(1);
end do;
c:=Multiply(MatrixInverse(Multiply(Transpose(J),J)),Multiply(Transpose(J),f));
b:=b-c;
printf("After iterations %d, A = %f and B = %f\n",i,b(1),b(2));
end do:

Vector(4, {(1) = 1.08, (2) = 1.37, (3) = 1.56, (4) = 1.61})

 

Vector[column](%id = 36893488152076174028)

 

Gauss-Newton Method
-------------------
Before iterations,A = 18.000000 and B = -2.000000
After iterations 1, A =

 

Error, (in fprintf) number expected for floating point format

 

NULL

Download Asst_3_Q4b.mw

The x region is z<x<1 and y region is 0<y<pi//3, I think there is an error in the j values in the loop

Can anyone assist please?

#Clear memory.
restart;

#Initialise variables and arrays.
h:=0.1;
k:=Pi/30;
c:=1:
iter:=0:
tol:=1e-5;
w:=1.5;
u:=Array(0..10,0..10):
U:=Array(0..10,0..10):

#Calculate boundary u values.
for i from 0 to 10 do

   u[i,Pi/3]:=0;
   u[i,0]:=0;
end do:

for j from 0 to Pi/3 do
   u[0,j]:=0;   
   u[10,j]:=sin(3*j*k)/2;
end do:
#Perform the Gauss-Seidel method.
while c>tol do
   iter:=iter+1;
   if iter>99 then
      printf("\nGauss-Seidel method did not converge,change w.\n");
   break;
end if:
for i from 1 to 9 do
  for j from 0 to Pi/3 do
     U[i,j]:=u[i,j];
     u[i,j]:=(10*Pi^2*u[i-1,j]+9*u[i,j-1]+9*u[i,j+1]+2*Pi^2*u[i+1,j])/20;
     u[i,j]:=w*u[i,j]+(1-w)*U[i,j];
  end do:
end do:
c:=max(abs(u[1..9,1..9]-U[1..9,1..9]));
printf("After iteration %2d,the maximum change in u is %7.1e\n",iter,c);
end do:

#Display the final u values if method converged.
if iter<100 then
    printf("\nGauss-Seidel Method\n");
    printf("-------------------\n");
    for j from 10 by -1 to 0 do
      for i from 0 to 10 do
        printf("%6.4f",u[i,j]);
    end do:
    printf("\n");
end do:
end if:

.1

 

(1/30)*Pi

 

0.1e-4

 

1.5

 

Error, bad index into Array

 

Error, final value in for loop must be numeric or character

 

Error, final value in for loop must be numeric or character

 


Gauss-Seidel Method
-------------------
0.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000
0.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000
0.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000
0.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000
0.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000
0.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000
0.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000
0.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000
0.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000
0.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000
0.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000

 

NULL

Download Asst_3_Q3c.mw

Hello. I have a problem with the phaseportrait and I hope could help me with this:

I can import maple, but I get an error when importing namespace/symbols:

import maple.namespace as mpl

# ----------------------------------THE DESIGN OF THE MAPLET SCREEN---------------------
with(Maplets[Elements]):
HCC:=Maplet(Window('title'="HEAT CONDUCTIVITY CONTROL",["WITH THIS APPLICATION THE CONDUCTIVITY COEFFICIENT OF A ONE-DIMENSIONAL OBJECT, APPROXIMATING THE TEMPRATURE OF THE OBJECT TO A TARGET TEMPRETURE AT A CERTAIN FINAL TIME, IS CONTROLLED. ",[["l",TextField[l](3)],["T",TextField[T](3)],["f(x,t)",TextField[f](15)],["phi(x)",TextField[ph](5)]],[["k(0)",TextField[k0](3)],["g0(t)",TextField[g0](10)],["k(l)",TextField[kl](3)],["g1(t)",TextField[g1](10)],["mu(x)",TextField[mu](10)]],[["alpha",TextField[alpha](3)],["kaplus(x)",TextField[kaplus](5)],["N",TextField[N](3)],["kstart(x)",TextField[kstart](3)],["beta",TextField[beta](3)],["eps",TextField[eps](3)]] ,[Button("Calculate the Control",Evaluate('kutu'=ms(N,l,alpha,T,ph,f,g0,g1,mu,kaplus,k0,kl,kstart,beta,eps))),[TextBox['kutu'](30..30)],Button("Draw the Control",Evaluate('Draw'='plot(kutu,x=0..l)')),Plotter['Draw'](),[[Button("Distance to
Target",Evaluate('kutu2'=ms8(N,l,alpha,T,ph,f,g0,g1,mu,kaplus,k0,kl,kstart,beta,eps))),TextField['kutu2'](12)],[Button("Approximation to kaplus",Evaluate('kutu3'='evalf(int((kutu-kaplus)^2,x=0..l))')),TextField['kutu3'](12)]]],Button("Shutdown",Shutdown())])):
# -------------------------PROCEDURE FOR CALCULATION OF THE CONTROL FUNCTION-----------
with(inttrans):
with(linalg):
ms:=proc(N,l,alpha,T,ph,f,g0,g1,mu,kaplus,k0,kl,kstart,beta,eps):
with(inttrans):
with(linalg):
w:=simplify(x^2/2*g1/(l*kl)+(x^2/2-x*l)*g0/(l*k0)):
phdal:=ph-subs(t=0,w):
fdal:=simplify(f-diff(w,t)+diff(kaplus*diff(w,x),x)):
# ---------------------------------Solution of the Heat Problem------------------------------------
dp:=proc(ka)
with(inttrans):
with(linalg):
phi:=Vector(1..N):
phi[1]:=1/sqrt(l):
for i from 2 to N do
phi[i]:=evalf(sqrt(2/l)*cos((i-1)*Pi*x/l)):
od:
K:=Array(1..N,1..N):
for j from 1 to N do
for k from 1 to N do
K[j,k]:=evalf(-int(ka*diff(phi[k],x$2)*phi[j],x=0..l)):
od:
od:
F:=Vector(1..N):
for n from 1 to N do
F[n]:=evalf(int(fdal*phi[n],x=0..l)):
od:
A:=Vector(1..N):
for m from 1 to N do
A[m]:=evalf(int(phdal*phi[m],x=0..l)):
od:
KL:=Matrix(1..N,1..N):
for j1 from 1 to N do
for k1 from 1 to N do
if (j1=k1) then KL[j1,k1]:=s+K[j1,k1] else KL[j1,k1]:=K[j1,k1] fi:
od:
od:
FL:=Vector(1..N):
for i1 from 1 to N do
FL[i1]:=evalf(laplace(F[i1],t,s));
od:
S:=Vector(1..N):
for i2 from 1 to N do
S[i2]:=(A[i2]+FL[i2]);
od:
C:=Vector(1..N):
C:=evalm(inverse(KL)&*S):
c:=Vector(1..N):
for i3 from 1 to N do
c[i3]:=evalf(invlaplace(C[i3],s,t)):
od:
v:=evalf(add(c[n1]*phi[n1],n1=1..N)):
uyak:=v+w;
end:
# ---------------------------------Solution of the Adjoint Problem------------------------------------
ap:=proc(ka)
with(inttrans):
with(linalg):
utau:=evalf(subs(t=T-tau,dp(ka))):
phe:=evalf(2*(subs(tau=0,utau)-mu));
phie:=Vector(1..N):
phie[1]:=1/sqrt(l):
for i4 from 2 to N do
phie[i4]:=evalf(sqrt(2/l)*cos((i4-1)*Pi*x/l)):
od:
Kc:=Array(1..N,1..N):
for j2 from 1 to N do
for k2 from 1 to N do
Kc[j2,k2]:=evalf(-int(ka*diff(phie[k2],x$2)*phie[j2],x=0..l)):
od:
od:
Fc:=Vector(1..N):
for m1 from 1 to N do
Fc[m1]:=0:
od:
Ac:=Vector(1..N):
for cm1 from 1 to N do
Ac[cm1]:=evalf(int(phe*phie[cm1],x=0..l)):
od:
KLC:=Matrix(1..N,1..N):
for cj1 from 1 to N do
for ck1 from 1 to N do
if (cj1=ck1) then KLC[cj1,ck1]:=s+Kc[cj1,ck1] else KLC[cj1,ck1]:=Kc[cj1,ck1] fi:
od:
od:
FLC:=Vector(1..N):
for ci1 from 1 to N do
FLC[ci1]:=evalf(laplace(Fc[ci1],tau,s));
od:
Sc:=Vector(1..N):
for ci2 from 1 to N do
Sc[ci2]:=(Ac[ci2]+FLC[ci2]);
od:
CC:=Vector(1..N):
CC:=evalm(inverse(KLC)&*Sc):
cc:=Vector(1..N):
for ci3 from 1 to N do
cc[ci3]:=evalf((invlaplace(CC[ci3],s,tau))):
od:
ve:=evalf(add(cc[cn]*phie[cn],cn=1..N)):
eta:=evalf(subs(tau=T-t,ve));
end:
# ---------------------------------Calculation of the Gradient----------------------------------
T�rev:=proc(alpha,ka)
T�re:=simplify(evalf(-int(diff(dp(ka),x)*diff(ap(ka),x),t=0..T)+2*alpha*(ka-kaplus)));
end:
# ----------------------------Calculation of the Cost Functional--------------------------------
Jka:=proc(ka)
IJ1:=evalf(int((subs(t=T,dp(ka))-mu)^2,x=0..l));
end:
Sta:=proc(ka)
IJ2:=simplify(evalf((int((ka-kaplus)^2,x=0..l))));
end:
II:=proc(ka)
IJ:=simplify(evalf(Jka(ka)+alpha*Sta(ka))):
end:# 
# -----------------------------------Minimizing Process--------------------------------------------
a[0]:=kstart:
ka[0]:=kstart:
say�:=0:
for im from 0 to 60 do
a[im+1]:=simplify(evalf(ka[im-say�]-beta*T�rev(alpha,ka[im-say�]))): 
fark:=evalf(II(ka[im-say�])-II(a[im+1])): 
if(fark>0 and fark<eps) then break elif (fark>0) then 
j:=im+1: ka[j-say�]:=a[im+1]:   elif(fark<=0) then  say�:=say�+1: beta:=beta/(1.2): ka[im-say�+2]:=ka[im-say�+1]:   else fi:
od:
optcont:=a[im+1]:
end:
# -------------------------END OF THE PROCEDURE FOR CALCULATION OF THE CONTROL FUNCTION-----------
# ------PROCEDURE FOR CALCULATION OF THE DISTANCE TO THE TARGET FUNCTION-----------
ms8:=proc(N,l,alpha,T,ph,f,g0,g1,mu,kaplus,k0,kl,kstart,beta,eps):
with(inttrans):
with(linalg):
w8:=simplify(x^2/2*g1/(l*kl)+(x^2/2-x*l)*g0/(l*k0)):
phdal8:=ph-subs(t=0,w8):
fdal8:=simplify(f-diff(w8,t)+diff(kaplus*diff(w8,x),x)):
phi8:=Vector(1..N):
phi8[1]:=1/sqrt(l):
for i8 from 2 to N do
phi8[i8]:=evalf(sqrt(2/l)*cos((i8-1)*Pi*x/l)):
od:
K8:=Array(1..N,1..N):
for j8 from 1 to N do
for k8 from 1 to N do
K8[j8,k8]:=evalf(-int(ms(N,l,alpha,T,ph,f,g0,g1,mu,kaplus,k0,kl,kstart,beta,eps)*diff(phi8[k8],x$2)*phi8[j8],x=0..l)):
od:
od:
F8:=Vector(1..N):
for m28 from 1 to N do
F8[m28]:=evalf(int(fdal8*phi8[m28],x=0..l)):
od:
A8:=Vector(1..N):
for m8 from 1 to N do
A8[m8]:=evalf(int(phdal8*phi8[m8],x=0..l)):
od:
KL8:=Matrix(1..N,1..N):
for j18 from 1 to N do
for k18 from 1 to N do
if (j18=k18) then KL8[j18,k18]:=s+K8[j18,k18] else KL8[j18,k18]:=K8[j18,k18] fi:
od:
od:
FL8:=Vector(1..N):
for i148 from 1 to N do
FL8[i148]:=evalf(laplace(F8[i148],t,s));
od:
S8:=Vector(1..N):
for i48 from 1 to N do
S8[i48]:=(A8[i48]+FL8[i48]);
od:
C8:=Vector(1..N):
C8:=evalm(inverse(KL8)&*S8):
c8:=Vector(1..N):
for i58 from 1 to N do
c8[i58]:=evalf(invlaplace(C8[i58],s,t)):
od:
v8:=evalf(add(c8[n8]*phi8[n8],n8=1..N)):
uyak8:=v8+w8;
IJ18:=evalf(int((subs(t=T,uyak8)-mu)^2,x=0..l));
end:
# ------END OF THE PROCEDURE FOR CALCULATION OF THE DISTANCE TO THE TARGET FUNCTION-----------
Maplets[Display](HCC):


 

Hi!

I'm having problems with my maple not saving. I get no error message and no windows pop up.
The error occurred after the summer holidays in Maple 2022. I use Windows 11, everything is up to date. Have no Anti-virus programs.

  I have tried the following after I discovered the error:
- To install Maple 2023
- Uninstall and delete all maple folders, then reinstall Maple 2023
- Pressed Ctrl + s
- Press "Save as..."
- Pressed on the floppy disk/save icon
- Restarted computer and updated windows
- Run Maple as administrator

The only thing I can be allowed to do is:
- Ctrl + p
- Print to PDF/printer

Really hope you can help!

The following code effectively converts the image to the JPG format.
with(GraphTheory):
s:=DrawGraph(CompleteGraph(5),size=[250,250])
Export("D:\\s1.jpg",s)

But I would like to export it using PDF format. However, the modified code below seems to be quite unsuccessful. I am aware that Maple has export options in the front end, but I still prefer to use code for this purpose.

Export("D:\\s1.pdf",s)

Error, (in Export) invalid input: member received _ImportExport:-InfoTable["PDF"][4], which is not valid for its 2nd argument, s

There are two reasons for this.

with(GraphTheory):
Graphs:=[NonIsomorphicGraphs(6,8,output=graphs,outputform = graph)]:
num_g:=nops(Graphs):
num:=ceil((num_g)/5.):
Matrix (num,5,(i,j)->`if`((i-1)*5+j<=num_g, DrawGraph(Graphs[(i-1)*5+j],size=[250,250] ,overrideoptions ,showlabels=false,style=planar, stylesheet =  [
 vertexcolor     = orange
,vertexfontcolor = black
,vertexborder    = false
,edgethickness   = 0.6
,edgecolor       = MidnightBlue
,vertexshape     =  "circle"
,vertexfont      = [Arial, 4],
vertexthickness=5], caption = cat(H__,5*(i-1)+j),captionfont=["ROMAN",7]),plot(x = 0 .. 1, axes = none))):
DocumentTools:-Tabulate (M1[1..5,.. ],widthmode=percentage ,width=80 , exterior =all):

First 10 11 12 13 14 15 16 Last Page 12 of 26