## Converting to Latex ...

 > restart;
 > eq32r:=diff(B(r),$(r,3))+diff(B(r),r);  (1)  > with(PDEtools, casesplit, declare); with(DEtools, gensys):declare(b(r), prime = r);  (2)  > eq32r;  (3)  > latex(eq32r);  {\frac {{\rm d}^{3}}{{\rm d}{r}^{3}}}B \left( r \right) +{\frac {\rm d}{{\rm d}r}}B \left( r \right)  > #instead of {\frac {{\rm d}^{3}}{{\rm d}{r}^{3}}}B I want to have B''' in my latex file.  > Download convert-latex.mw Hi everybody I have a differential equation where derivatives (for example d/dr) have been displayed by prime notation. I want to convert this equation latex format by keeping the prime notation not d/dr. I would appreciate it if anyone could help me. I have attached a sample code. Thank you Hadi ## Having problems plotting a discrete plot for the C... Asked by: I'm having problems trying to plot a discrete plot for a Poisson Distribution CDF. I followed a model found elsewhere that someone had used to do a discrete plot of a sum. The OP, in that case, was looking to plot a partial sum of: sum(1/(n^3*sin^2(n)),n=1..400); The solution that was suggested to the OP was the following: with(DynamicSystems): f[N1_]=sum[1/(n^3*sin^2[n]), {n,1,N1}]; DiscretePlot[f[x], {x,0,400},PlotRange->All]; Using that solution as a guide, I tried this: with(DynamicSystems): lambda := 15.4; f[N1_] = sum[exp(-lambda)*lambda^n/n!, {0, N1, n}]; DiscretePlot[f[x], {0, 50, x}, PlotRange -> All]; In the attached image, you can see the output from my attempt. I am completely flummoxed. Any suggestions would be greatly appreciated. ## Differentiate three regions with implicitplot and/... Asked by: Dear Maple Expeets, In the attached Maple file, I have three procedures that are run smoothly. I am trying to compare outputs from each procedure to see which one if larger than the others. For changes on two parameters (alpha and delta), I used implicitplot and inequal commands to identify each region by a specific color. But the outcome is not reasonable. Would you please help with this? Thanks in advance!  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  >  > Download Compare_three_regions.mw the final plot does not look reasonable. Would you please guide me? ## How can Maple animate this family of pursuits?... Asked by: This worksheet contains an unnamed theorem on page 202 of David Wells's book The Penguin Dictionary of Curious and Interesting Geometry. Somehow I have uploaded both its contents and (a) link(s) to it. What Maple code can animate and display, in turn, each of the portrayed pursuit paths? Pursuit_problem.mw Consider a target point T which moves at constant speed along a straight line, and a moving point P which at all times moves directly towards T. If P starts anywhere on the outermost ellipse, and T starts from a focus of the outer ellipse, then P always captures T at the same point, the centre of the ellipse.  > The concentric ellipses, whose shape depends on the relative velocities of T and P, are isochrones, and the curves of pursuit are their isoclinal trajectories Download Pursuit_problem ## Exporting data from maple to matlab... Asked by: Please how can I export a matrix from maple to matlab A := Matrix(5, 5, {(1, 1) = -.841752461600000, (1, 2) = -71.7787800100000, (1, 3) = 0.701877157500000e-2, (1, 4) = 0.672783592200000e-2, (1, 5) = 0.646005759700000e-2, (2, 1) = -.877557898000000, (2, 2) = -100., (2, 3) = 0.701617590500000e-2, (2, 4) = 0.672545092900000e-2, (2, 5) = 0.645785863600000e-2, (3, 1) = -1.00426692300000, (3, 2) = -.677765381900000, (3, 3) = 0.700840041000000e-2, (3, 4) = 0.671830608400000e-2, (3, 5) = 0.645127072200000e-2, (4, 1) = -1.31039754100000, (4, 2) = -.820833777300000, (4, 3) = 0.699547946600000e-2, (4, 4) = 0.670643167900000e-2, (4, 5) = 0.644032067900000e-2, (5, 1) = -2.17574621300000, (5, 2) = -1.15959068100000, (5, 3) = 0.697746998200000e-2, (5, 4) = 0.668987785500000e-2, (5, 5) = 0.642505292600000e-2}) I tried ExportMatrix(matlabData, A, target=MATLAB,format=rectangular,mode=ascii); but didn't work. ## Is this a bug in LinearSolve or a wrong wrapper/ca... Asked by:  > restart:  > Digits:=15;  > A:=Matrix(4,4,[[-1,2,0,0],[2,-1,2,0],[0,2,-1,2],[0,0,1,-1]],datatype=float[8],storage=sparse);  > b:=Vector(4,[1,0.,0,0],datatype=float[8]):  >  > sol:=LinearAlgebra:-LinearSolve(A,b,method=SparseDirectMKL); Error, invalid input: LinearAlgebra:-LinearSolve expects value for keyword parameter method to be of type identical(none,SparseLU,SparseDirect,SparseDirectMKL,SparseIterative,LU,QR,solve,hybrid,Cholesky,subs,modular), but received SparseDirectMKL Download buglinearsolve.mw I was pleased to see the description of SparseDirectMKL, but it is not implemented properly yet. It is a step in the right direction, so please make this available in the near future ## How can fix the error"Error, (in Optimization:-NLP... Asked by: Hello everyone. after runnig this maple code i get the error :" Error, (in Optimization:-NLPSolve) non-numeric result encountered" . How can fix it? restart; Digits := 20; with(LinearAlgebra); with(linalg); with(Optimization); with(Student[Calculus1]); NULL; n := 2; z := 1; a := 0; b := 1; m := 2; NULL; PS1 := (j, t) -> piecewise(j = 0, 1, t^(j + s[j])); PI1 := (j, t) -> piecewise(j = 0, 1, t^(j + q[j])); PH1 := (j, t) -> piecewise(j = 0, 1, t^(j + h[j])); PL1 := (j, t) -> piecewise(j = 0, 1, t^(j + l[j])); NULL; PS := t -> local j; Transpose(convert([seq(PS1(j, t), j = 0 .. n - 1)], Matrix)); P_I := t -> local j; Transpose(convert([seq(PI1(j, t), j = 0 .. n - 1)], Matrix)); PH := t -> local j; Transpose(convert([seq(PH1(j, t), j = 0 .. n - 1)], Matrix)); PL := t -> local j; Transpose(convert([seq(PL1(j, t), j = 0 .. n - 1)], Matrix)); Warning, (in PS) j is implicitly declared local Warning, (in P_I) j is implicitly declared local Warning, (in PH) j is implicitly declared local Warning, (in PL) j is implicitly declared local NULL; NULL; B1 := (i, j) -> piecewise(i = j and j = 1, 1, i = 1 and 1 < j, 0, i = j and j = 2, 1, i = 2 and 2 < j, 0, j <= i, (i + j - 2)!/(2^(j - 1)*(j - 1)!*(i - j)!)); NULL; B := t -> Matrix(n, B1); DS1 := (m, k) -> piecewise(m <= 1, 0, m = k, GAMMA(k + s[k - 1])/GAMMA(k + s[k - 1] - z)); DI1 := (m, k) -> piecewise(m <= 1, 0, m = k, GAMMA(k + i[k - 1])/GAMMA(k + i[k - 1] - z)); DH1 := (m, k) -> piecewise(m <= 1, 0, m = k, GAMMA(k + h[k - 1])/GAMMA(k + h[k - 1] - z)); DL1 := (m, k) -> piecewise(m <= 1, 0, m = k, GAMMA(k + l[k - 1])/GAMMA(k + l[k - 1] - z)); DS := t -> t^(-z)*Matrix(n, DS1); DI := t -> t^(-z)*Matrix(n, DI1); DH := t -> t^(-z)*Matrix(n, DH1); DL := t -> t^(-z)*Matrix(n, DL1); NULL; NULL; cs := i -> ps[i]; ci := j -> p[j]; ch := j -> ph[j]; cl := i -> pl[i]; CS := convert([seq(cs(i), i = 1 .. n)], Matrix); CI := convert([seq(ci(i), i = 1 .. n)], Matrix); CH := convert([seq(ch(i), i = 1 .. n)], Matrix); CL := convert([seq(cl(i), i = 1 .. n)], Matrix); NULL; NULL; NULL; S := unapply(simplify(Multiply(Multiply(CS, B(t)), PS(t))[1, 1]), [t]); I1 := unapply(simplify(Multiply(Multiply(CI, B(t)), P_I(t))[1, 1]), [t]); H := unapply(simplify(Multiply(Multiply(CH, B(t)), PH(t))[1, 1]), [t]); L := unapply(simplify(Multiply(Multiply(CL, B(t)), PL(t))[1, 1]), [t]); DSS := unapply(simplify(Multiply(Multiply(Multiply(CS, B(t)), DS(t)), PS(t))[1, 1]), [t]); DII := unapply(simplify(Multiply(Multiply(Multiply(CI, B(t)), DI(t)), P_I(t))[1, 1]), [t]); DHH := unapply(simplify(Multiply(Multiply(Multiply(CH, B(t)), DH(t)), PH(t))[1, 1]), [t]); DLL := unapply(simplify(Multiply(Multiply(Multiply(CL, B(t)), DL(t)), PL(t))[1, 1]), [t]); NULL; NULL; RS := unapply(evalf(DSS(t) + (-0.0043217^z + 0.5944^z*Multiply(S(t), I1(t)) + (0.025^z + 0.0008^z)*S(t))), [t]); RI := unapply(evalf(DII(t) + (-0.5944^z*Multiply(S(t), I1(t)) - 0.0056^z*Multiply(H(t), I1(t)) - 0.027^z*L(t) + (((0.025^z + 0.0008^z) + 0.025^z) + 0.5^z)*I1(t))), [t]); RH := unapply(evalf(DHH(t) + (-0.535^z + 0.0056^z*Multiply(H(t), I1(t)) - 0.5^z*I1(t) + (0.025^z + 0.0008^z)*H(t))), [t]); RL := unapply(evalf(DLL(t) + (-0.025^z*I1(t) + (0.025^z + 0.0008^z + 0.027^z)*L(t))), [t]); R := unapply(evalf(RS(t)^2 + RI(t)^2 + RH(t)^2 + RL(t)^2), [t]); NULL; p1 := x -> (x^2 - 1)^m; dmp1 := x -> diff(p1(x), x$ m);
NULL;
p := x -> dmp1(x)/(2^m*m!);
eq := p(x) = 0;
r := solve(eq, x);
NULL;
ss := Vector[row](m);
w := Vector[row](m);
for i to m do
w[i] := 2/((-r[i]^2 + 1)*D(p)(r[i])^2);
ss[i] := w[i]*evalf(R((b - a)/2*r[i] + (b + a)/2));
end do;

Lambda := evalf((b - a)/2*SS);
;

C1 := S(0) - 43994 = 0;
C2 := I1(0) - 0.1 = 0;
C3 := H(0) = 0;
C4 := L(0) - 1 = 0;

NULL;
NLP := NLPSolve(Lambda, {C1, C2, C3, C4});
Error, (in Optimization:-NLPSolve) non-numeric result encountered


## How to substitute in argument of the exponential f...

Hi,

It might be really trivial, but I am struggling in the algebraic manipulation of the argument of the exponential function. As an example, I want to substitute

in the expression of

.

However, I am only able to do so by subs command and also by exactly copying the argument in the following manner.

The issue is I have expressions like this all over in the main problem, and I have to copy-paste such expressions for the substitution. So I am wondering if there is a more efficient way to tackle this problem.

Regards

## Maple's "is" and "coulditbe" yields seemingly fals...

I am trying to determine constraints for a,b,c that are real, such that the eigenvalues of my system matrix have all negative real part.

restart;
with(LinearAlgebra):
assume(a,'real');
assume(b,'real');
assume(c,'real');
A:=<c,0,0;0,-1,a;0,b,-1>
elist:=Eigenvalues(A):
map(lprint,elist):
c
-1+(b*a)^(1/2)
-1-(b*a)^(1/2)


If all eigenvalues real part must be less than 0, then clearly:

c < 0

ab < 1

However, when trying to verify these results with "is" and "coulditbe" Maple gives me blatantly false results:

additionally(c<0)
is(Re(-1+sqrt(a*b))<0)
false

coulditbe(Re(-1+sqrt(a*b))>0)
true



The real part of -1+sqrt(a*b) can never be greater than 0 under the assumption that ab<1. So why is Maple giving me nonsense? Am I using the commands incorrectly?

## Error, invalid input: rhs received 19715.18184, wh...

Hi, I am completely new to Maple and I keep getting this message:

Error, invalid input: rhs received 19715.18184, which is not valid for its 1st argument, expr

my code is:

sqq:=Vector(n):
for i from 1 by 1 to n do

sqq[i]:=rhs(pom):

end do:

I am trying to get a vector sqq solving the equation sigma[qq] using the constants and vectors written there. Can anybody help me please?

## Units:-Simple min() bug...

While Maple itself is a pleasure to work with, the multitude and persistance of bugs in the Units package doesn't stop to surprise.

Especially as the same bugs come up again and again, after having been fixed i older versions.

In general, working with units and 0 is a pain in the ass. And this one doesn't even need a unit to compare with.

This one works in Maple 2022 - does not work in Maple 2023.

with(Units[Simple]);
min(0, 0);


## System of 4 non-linear equations, fsolve...

Hi,

Im trying to solve a system of 4 non-linear equations using the fsolve function. When i compute the command i seemingly dont get an answer to the system. Maple only prompts the command itself, can any of you locate my mistake or give any input on how to solve the issue.

My code is as follows:

restart;
r__C := 400;
r__D := 600;
r__E := 800;
a := 100;
p := 0.7;
q := Pi*a^2*p;
h__eq := 0.9*h__1*(E__1/E__2)^(1/3);
R__Ceq := sqrt(h__eq^2 + r__C^2);
R__C := sqrt(r__C^2 + h__1);
R__Deq := sqrt(h__eq^2 + r__D^2);
R__D := sqrt(r__D^2 + h__1);
R__Eeq := sqrt(h__eq^2 + r__E^2);
R__E := sqrt(r__C^2 + h__1);

eqC := 174.5*10^(-3) = q*(1 + nu)/(2*Pi*E__2*R__Ceq)*(2*(1 - nu) + h__eq^2/R__Ceq^2) + q*(1 + nu)/(2*Pi*E__1*r__C)*(2*(1 - nu) + 0) - q*(1 + nu)/(2*Pi*E__1*R__C)*(2*(1 - nu) + h__1^2/R__C^2);
eqD := 151.7*10^(-3) = q*(1 + nu)/(2*Pi*E__2*R__Deq)*(2*(1 - nu) + h__eq^2/R__Deq^2) + q*(1 + nu)/(2*Pi*E__1*r__D)*(2*(1 - nu) + 0) - q*(1 + nu)/(2*Pi*E__1*R__D)*(2*(1 - nu) + h__1^2/R__D^2);
eqE := 133.2*10^(-3) = q*(1 + nu)/(2*Pi*E__2*R__Eeq)*(2*(1 - nu) + h__eq^2/R__Eeq^2) + q*(1 + nu)/(2*Pi*E__1*r__E)*(2*(1 - nu) + 0) - q*(1 + nu)/(2*Pi*E__1*R__E)*(2*(1 - nu) + h__1^2/R__E^2);
eqA := 401.7*10^(-3) = 2*q*a*(-nu^2 + 1)*(sqrt(1 + (h__eq/a)^2) - h__eq/a)/E__2 + 2*(-nu^2 + 1)*q*a/E__1 - 2*q*a*(-nu^2 + 1)*(sqrt(1 + (h__1/a)^2) - h__1/a)/E__1;

fsolve({eqA, eqC, eqD, eqE}, {E__1, E__2, h__1, nu}, {E__1 = 0 .. 5000, E__2 = 0 .. 5000, h__1 = 0 .. 1000, nu = 0 .. 0.5});

Picture for refference:

## How to Specify the Number of Non-zero Entries in a...

Hi,

I am using A:=LinearAlgebra:-RandomMatrix(10,10,generator=-10..10) to generate a random matrix. How may I specify that every row of A has at least three non-zero entries?

Thanks!

## Can One Designate names as local in Operators in a...

The attached worksheet shows a simple operator to calculaute the cartesian product of a set. The code is executed in both 1D and 2D notation in the worksheet.  The code is also placed in a code edit region and in the startup code area if the worksheet.  When entered into a worksheet is either notation, it produces an error message,  Without the local designation, it executes with a warning message. When entered into a code edit region it executes without error or warning.

I assume that this behavior reflects a limitation of the 2d notation or is there a workaround to the problem?

error4.mw

## How to specify that all problem variables take int...

For instance, given nine integer x1, x2, …, x9 satisfying x1, x2, …, x9 ≥ -5 and x13x23＋…＋x93＝0, the goal is to maximize x1 + x2 + … + x9. However, according to Optimization/Options,  is not accepted by the Optimization:-Maximize command. A probable method is applying floor into the optimization variables; unfortunately, I can only get: Error, (in Optimization:-NLPSolve) no improved point could be found
(*restart;*)
Optimization:-Maximize(?()(+, floor~(expr)), [add(floor~(expr) ^~ 3) = 0, expr[] >=~ -5], initialpoint = (unapply~(expr) =~ rand(-5 .. 10))()); # Alternatives to exhaustive search?
Error, (in Optimization:-NLPSolve) no improved point could be found