Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

There are many questions that complain about Latex conversion in Maple.

I'd like to again request that Maplesoft improves Latex output of its expressions. If Maple can just fix how it generates fractions, that will good enough for now.

I am willing to send Maplesoft a personal check of the amount of one month salary for one of your developers to do this fix if you are willing to do it. It should not take more than one month to do this simple fix in your code. It might even take one day if someone knows the code.

The problem comes when there is a fraction in the expression. the Latex output instead of using proper latex code using "\frac{}{}", it instead uses "/" which makes the output terrible.

Another case, where Maple generate (expression)^{-1} instead of \frac{1}{expression}.

It can't be that hard to fix these 2 issues, which can go a long way towards making the latex generated by Maple much better. Here is an example

eq:=-(1/2)*1/y = (1/3)*x^3+z:
sol:=solve(eq,y);

latex(sol);
-3/2\, \left( {x}^{3}+3\,z \right) ^{-1}

Which renders as

Which is terrible. The screen output is much better.

Compare this to Mathematica

eq = -(1/2)*(1/y) == (1/3)*x^3 + z;
sol = y /. First@Solve[eq, y];
TeXForm[sol]

   -\frac{3}{2 \left(x^3+3 z\right)}

Which renders in Latex as

If Maplesoft does not think Latex is improtant, then they are completely wrong. CAS support in Latex is very important. Ignoring Latex means you will lose customers who want good Latex support of the math output of Maple. After all, Math and Latex go togother. And Maple is supposed to be all about Mathematics.

Any chance of Maplesoft taking some time to fix these issues in Latex? Maple has not had any improvement in Latex for years and years. I keep buying Maple each year, and nothing changes in its Latex export.

thank you

Good evening!!!

Let me briefly describe the problem I've faced recently.

The program (attached) deals with a rather complicated function f depending on parametrs eps1, eps2, eps3, eps4 and variable w. The aim is to expand the function f(w1) into Taylor series with respect to all parametrs (eps1, eps2, eps3, eps4) in order to study its asymptotic behavior as function depending only on k; 0<k<1.

I decided to use mtaylor-function for that problem, which (as I've understood) is the only one to be applied in such cases, but the result was rather unsatisfactory, an error: 

Error, (in gcd/LinZip) input must be polynomials over the integers

Programm code: (1)-(12) only announcing functions....(((, see below
 

f := proc (w) options operator, arrow; -B1+(A1-C1)*w+(B1-D1)*w^2-A1*w^3 end proc

proc (w) options operator, arrow; -B1+(A1-C1)*w+(B1-D1)*w^2-A1*w^3 end proc

(1)

f1 := proc (w) options operator, arrow; A1-C1+(2*B1-2*D1)*w-3*A1*w^2 end proc

proc (w) options operator, arrow; A1-C1+(2*B1-2*D1)*w-3*A1*w^2 end proc

(2)

w1 := (B1-D1+sqrt((B1-D1)^2+3*A1*(A1-C1)))/(3*A1)

(1/3)*(B1-D1+(B1^2-2*B1*D1+D1^2+3*A1^2-3*A1*C1)^(1/2))/A1

(3)

f(w1)

-B1+(1/3)*(A1-C1)*(B1-D1+(B1^2-2*B1*D1+D1^2+3*A1^2-3*A1*C1)^(1/2))/A1+(1/9)*(B1-D1)*(B1-D1+(B1^2-2*B1*D1+D1^2+3*A1^2-3*A1*C1)^(1/2))^2/A1^2-(1/27)*(B1-D1+(B1^2-2*B1*D1+D1^2+3*A1^2-3*A1*C1)^(1/2))^3/A1^2

(4)

s := eps4*sin(l*tau)+(4*(l*sqrt(k/(1-k))+l*eps3)+2*l*((1-2*k)/sqrt(k*(1-k))+eps1))/l^2

eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2

(5)

A1 := (2*(l*sqrt(k/(1-k))+l*eps3)+l*((1-2*k)/sqrt(k*(1-k))+eps1))/s

(2*l*(k/(1-k))^(1/2)+2*l*eps3+l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)

(6)

A1 := (2*(l*sqrt(k/(1-k))+l*eps3)+l*((1-2*k)/sqrt(k*(1-k))+eps1))/s

(2*l*(k/(1-k))^(1/2)+2*l*eps3+l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)

(7)

B1 := 4/s^2

4/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)^2

(8)

C1 := (((1-2*k)/sqrt(k*(1-k))+eps1)^2+(-(1-2*k)/sqrt(k*(1-k))+eps2)^2)/s^2

(((1-2*k)/(k*(1-k))^(1/2)+eps1)^2+(-(1-2*k)/(k*(1-k))^(1/2)+eps2)^2)/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)^2

(9)

D1 := (2*((1-2*k)/sqrt(k*(1-k))+eps1))*(-(1-2*k)/sqrt(k*(1-k))+eps2)/s^2

2*((1-2*k)/(k*(1-k))^(1/2)+eps1)*(-(1-2*k)/(k*(1-k))^(1/2)+eps2)/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)^2

(10)

l := 1

1

(11)

f(w1)

-4/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^2+(1/3)*((2*(k/(1-k))^(1/2)+2*eps3+(1-2*k)/(k*(1-k))^(1/2)+eps1)/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)-(((1-2*k)/(k*(1-k))^(1/2)+eps1)^2+(-(1-2*k)/(k*(1-k))^(1/2)+eps2)^2)/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^2)*(4/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^2-2*((1-2*k)/(k*(1-k))^(1/2)+eps1)*(-(1-2*k)/(k*(1-k))^(1/2)+eps2)/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4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/(k*(1-k))^(1/2)+2*eps1)^2*(4/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^2-2*((1-2*k)/(k*(1-k))^(1/2)+eps1)*(-(1-2*k)/(k*(1-k))^(1/2)+eps2)/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^2+(16/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^4-16*((1-2*k)/(k*(1-k))^(1/2)+eps1)*(-(1-2*k)/(k*(1-k))^(1/2)+eps2)/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^4+4*((1-2*k)/(k*(1-k))^(1/2)+eps1)^2*(-(1-2*k)/(k*(1-k))^(1/2)+eps2)^2/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^4+3*(2*(k/(1-k))^(1/2)+2*eps3+(1-2*k)/(k*(1-k))^(1/2)+eps1)^2/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^2-3*(2*(k/(1-k))^(1/2)+2*eps3+(1-2*k)/(k*(1-k))^(1/2)+eps1)*(((1-2*k)/(k*(1-k))^(1/2)+eps1)^2+(-(1-2*k)/(k*(1-k))^(1/2)+eps2)^2)/(eps4*sin(tau)+4*(k/(1-k))^(1/2)+4*eps3+2*(1-2*k)/(k*(1-k))^(1/2)+2*eps1)^3)^(1/2))^3/(2*(k/(1-k))^(1/2)+2*eps3+(1-2*k)/(k*(1-k))^(1/2)+eps1)^2

(12)

assume(0 < k and k < 1)

mtaylor(f(w1), [eps1, eps2, eps3, eps4], 2)

Error, (in gcd/LinZip) input must be polynomials over the integers

 

``


Wish you could give some advice on how to improve the situation.

Thanks a lot in advance.

Download res2.mw

 

 

I am having some issues with NLPSolve (the code follows). As far as I can tell from the documentation, what is entered is syntactically correct.

 

with(Optimization)
[ImportMPS, Interactive, LPSolve, LSSolve, Maximize, Minimize, 

  NLPSolve, QPSolve]
nlc:={0<=d*(c-a) + c*(b-d), 0<=d*(c-e)+ c*(f-d), 0>=f*(e-a)+e*(b-f), (b-d)<=d*(c-a)+c*(b-d),(f-d)<=d*(c-e)+c*(f-d),(b-f)>=f*(e-a)+e*(b-f),(c-a)<=d*(c-a) + c*(b-d), (c-e)<=d*(c-e)+ c*(f-d), (e-a)>=f*(e-a)+e*(b-f),(c-a)+(b-d)<=d*(c-a) + c*(b-d), (c-e)+(f-d)<=d*(c-e)+ c*(f-d), (e-a)+(b-f)>=f*(e-a)+e*(b-f),2*(c-a)+(b-d)<=d*(c-a) + c*(b-d), 2*(c-e)+(f-d)<=d*(c-e)+ c*(f-d), 2*(e-a)+(b-f)>=f*(e-a)+e*(b-f)}

p:=2*(f-a)*(d-b) - [(d-b)*(c-a) + (d-f)*(e-c) + (f-b)*(e-a)]

NLPSolve(p,nlc)
Error, (in Optimization:-NLPSolve) non-numeric result encountered
 

Any help is much appreciated.

When I finished the following code, I can not export the .eps file for the densityplot

 

 

restart; t := 1; a[1] := 0; a[2] := 2; a[4] := 0; a[5] := 1; a[6] := -1; a[8] := 0; g := t*a[3]+x*a[1]+y*a[2]+a[4]; h := t*a[7]+x*a[5]+y*a[6]+a[8]; f := g^2+h^2+a[9]; a[3] := -(3*a[1]^3+a[1]*a[2]^2+3*a[1]*a[5]^2-a[1]*a[6]^2+2*a[2]*a[5]*a[6])/(3*(a[1]^2+a[5]^2)); a[7] := -(3*a[1]^2*a[5]+2*a[1]*a[2]*a[6]-a[2]^2*a[5]+3*a[5]^3+a[5]*a[6]^2)/(3*(a[1]^2+a[5]^2)); a[9] := (3*(a[1]^6+3*a[1]^4*a[5]^2+3*a[1]^2*a[5]^4+a[5]^6))/(a[1]*a[6]-a[2]*a[5])^2; u := (4*(2*a[1]^2+a[5]^2))/f-8*(g*a[1]+h*a[5])^2/f^2; with(plots); plot3d(u, x = -20 .. 20, y = -20 .. 20, axes = frame, labels = ["x", "y", "z"], labeldirections = ["horizontal", "horizontal", "horizontal"], labelfont = ["TIMES", 16], style = patchnogrid); densityplot(u, x = -10 .. 10, y = -10 .. 10, axes = frame, labels = ["x", "y"], labeldirections = ["horizontal", "horizontal"], labelfont = ["TIMES", 16], colorstyle = HUE, style = patchnogrid); contourplot(u, x = -5 .. 5, y = -5 .. 5, labels = ["x", "y"], labeldirections = ["horizontal", "horizontal"], labelfont = ["TIMES", 16])

Hi

Two sets of ordered pairs (i.e. A and B) are calculated in a problem.

A = {[0.5, 3.15], [1, 4.87], [1.5, 6.56], [2, 8.22]}

B = {[0.5, 3.67], [1, 4.94], [1.5, 5.29], [2, 5.93]}

Two control points are considered to check the validity of interpolated polynomials as follows:

- Control point for A:

  Calculated by interpolation [1.75, 7.3959] ... Exact amount [1.75, 7.3971]

- Control point for B:

  Calculated by interpolation [1.75, 5.4981] ... Exact amount [1.75, 5.6225]

The calculated polynomial via interpolation for sets A and B are plotted for independent variable between 0.5 and  2. The plot of interpolated polynomial for A is a curve without local extremum. However ordered pairs in B show that the polynomial should be a strictly increasing function, but the plot of interpolated polynomial for B has many local extremums. By increasing ordered pairs in B, the local extremums are increased. Moreover, the control point for B shows that the interpolated polynomial is not reliable. 

The more exact ordered pairs for B are presented in below. If more ordered pairs are required for interpolation, you can use them.

{[0.75, 4.1457],[1.25, 4.9448],[1.75,5.62]}

How can I find the best curve fitting for ordered pairs in B?

Thank you for taking your time

Hi everybody,

Why f generates the error "... orthopoly is not a module or member"

f := proc(n)
   uses orthopoly;
   H(n,z);
end proc;

as g works correctly ?

g := proc(n)
   orthopoly:-H(n,z);
end proc;


Thanks in advance

I want to animate the functions approximate_f and f in the worksheet where 0<=t<=1.

 

Please find the following code.

code.mw

 

Thank you very much.

 

Does anybody mind clarifying what the three argument signum means?

I have the expression

signum(0,R-sqrt(R^2+z^2),1)

in which z>0, R>0. I guess I know what signum means, however in this case according to the help it is considering signum of 0 and then in the help it is talking about some environment variable. I just dont quite understand...

Does it mean Maple has issues to clarify the sign of R-sqrt(R^2+z^2) ??

Thanks

Rayleigh's identity is listed below:


              infinity                                           
               -----                                             
                \                                                
                 )             2      /      2        1      1  \
                /        |f(k)|  = int||f(t)| , t = - - T .. - T|
               -----                  \               2      2  /
            k = -infinity                                        

 

sum(abs(f(k))^2, k = -infinity .. infinity) = int(abs(f(t))^2, t = -(1/2)*T .. (1/2)*T);

This identity is an extension from Parseval's theorem for the case where the function of interest is periodic.  The link below provides a worksheet that confirms for a finite series that Rayleigh's identity is valid to within so many significant figures as the frequency parameter, k, increases for CASE 1.  However, for CASE 2 concurrence between the integral and the finite series is not that great.  I suspect I have an error somewhere that is causing the discrepancy.  I thought it might be useful if I get other sets of eyes on this to help isolate the discrepancy.  How I came up with Ck for CASE 2 I can create another worksheet with that derivation if requested.

Rayleighs_identity.mw

Appreciate any useful feedback

 

I found that when changing constant of integration from _C1 to C1, Maple now fails to verify solution.

Is one supposed to only use constant with _ in it for this? I prefer to use C1 instead of _C1. Why does Maple odetest fail in this case? Is there a way around this?

Here is an example

restart;
ode:=diff(y(x),x)=x*ln(y(x)):
implicit_sol := -Ei(1, -ln(y(x)))+C1=(1/2)*x^2;
explicit_sol := solve(implicit_sol,y(x)):
odetest(y(x)=explicit_sol,ode);

Now changing C1 to _C1 and nothing else, odetest verifies the solution

implicit_sol:= subs(C1=_C1,implicit_sol);
explicit_sol := solve(implicit_sol,y(x)):
odetest(y(x)=explicit_sol,ode);

I understand the using symbol with _ is a convention in Maple for global symbols. But I want to use C1 and not _C1 as it is easier to read.

 

Hello guys,

I have three equations with three unknowns that I can not solve but my friend solved it with Mathematica, but I do not know how to get answers with Maple.

 

Thankssolutions.mw

 

Hello,

I'm writing an equation that has a term including divergence .. i'd like to print that as the sum of the derivatives

for example instead of nabla(u) display it as ux+uy+uz

 

restart

VectorCalculus[SetCoordinates]('cartesian'[x, y, z]); F := x, y, z, t

vel := VectorCalculus[VectorField](`<,>`(u(F), v(F), w(F)))

vel := u(x, y, z, t)*`#mover(mi("e"),mo("&lowbar;"))`[x]+v(x, y, z, t)*`#mover(mi("e"),mo("&lowbar;"))`[y]+w(x, y, z, t)*`#mover(mi("e"),mo("&lowbar;"))`[z]

(1)

Mass_eqn := diff(rho(F), t)+Divergence(rho(F)*vel)

Mass_eqn := diff(rho(x, y, z, t), t)+VectorCalculus[Nabla].(Vector(3, {(1) = rho(x, y, z, t)*u(x, y, z, t), (2) = rho(x, y, z, t)*v(x, y, z, t), (3) = rho(x, y, z, t)*w(x, y, z, t)}))

(2)

print(Mass_eqn)

diff(rho(x, y, z, t), t)+VectorCalculus[Nabla].(Vector(3, {(1) = rho(x, y, z, t)*u(x, y, z, t), (2) = rho(x, y, z, t)*v(x, y, z, t), (3) = rho(x, y, z, t)*w(x, y, z, t)}))

(3)

NULL


 

Download aero.mw

How do I convert a complex number to abs and arg presentation.

For example:

z=1+1*I would be z=sqrt(2)*exp(I*Pi/4)

or when doing a calculation how can I tell him to always present these number in that form and do not expand out.

Thanks

Dear all,

 

I have variables like: x1, x2, x3, x4, ...

I want to unassign all x? variables.

How can I do it?

 

I tried

 

for i from 1 to n_x do ... unassign('x||i') ... od:

 

but it does not work :(

How can I run Maple Script ,hold it and continue to run it ?
Somethink like Matlab pause statment

Tank you

First 797 798 799 800 801 802 803 Last Page 799 of 2217