Loop two outputs...

I've made this proc and it has 2 outputs

*

How do I fix that?

strange latex result. Why an extra 1 shows up?...

We all know that Maple's Latex is not the best of Maple to say the least.

But this one is really strange. Maple prints a 1 for no apparant reason in the latex which makes it ugly.

I wonder if Maplesoft still maintains its Latex conversion code at all?  So one can at least hope may be one day all of this will get fixed? Year after year, and Maple's Latex still not changed.

If Mapesoft do not intend to make any changes in its Latex conversion software at all, it will be good if an official statement is made in this regards so that at least customers know.

 > sol:=dsolve((x-a)*(x-b)*diff(y(x),x)+k*(y(x)-a)*(y(x)-b) = 0,y(x)): sol:=subs(_C1=C[1],sol);

 > latex(sol)

y \left( x \right) ={1 \left(  \left( x-b \right) ^{-k} \left( x-a
\right) ^{k}a{{\rm e}^{akC_{{1}}-bkC_{{1}}}}- \left( x-b \right) ^{-k
} \left( x-a \right) ^{k}b{{\rm e}^{akC_{{1}}-bkC_{{1}}}}+b \left( {
\frac {-x+b}{-x+a}} \right) ^{-k}{{\rm e}^{akC_{{1}}-bkC_{{1}}}}-b

\right)  \left( -1+ \left( {\frac {-x+b}{-x+a}} \right) ^{-k}{{\rm e}
^{akC_{{1}}-bkC_{{1}}}} \right) ^{-1}}

 >

why odetest fail to verify solution when using C[1...

Why odetest sometimes fail to give 0  from odetest when simply using C[1] instead of _C1 as constant of integration?

I do not remember now if I asked about this before now. But for me as a user, this does not look right. I like to use C[1] instead of _C1 as the constant of integration as it looks better in Latex. I had no idea it will make a difference to odetest what the constant of integration symbol used is.

Is this a known issue? Do you consider this a bug? Maple 2019.1 on windows 10.

 > restart;
 > ode:= x^2*diff(y(x),x)+x*y(x)+sqrt(y(x)) = 0;

 > sol_1:=sqrt(y(x))=1/x+_C1/sqrt(x); odetest(sol_1,ode)

 > sol_2:=subs(_C1=C[1],sol_1); odetest(sol_2,ode); #why this now fails??

 > sol_3:=subs(C[1]=_C1,sol_2); odetest(sol_3,ode)

A=B but Maple does not want to simplify arctanh(A...

A=B  but not able to simplify arctanh(A)-arctanh(B)  to be zero.  Why? Is there a workaround? Using Maple 2019.1

 > restart;
 > A:=((y*sqrt(3) + 3)*sqrt(3))/(6*sqrt(y^2 + 1)); B:=(y + sqrt(3))/(2*sqrt(y^2 + 1)); simplify(A-B)

 > simplify(arctanh(A)-arctanh(B))

 > simplify(arctanh(A)-arctanh(B),trig)

 > simplify(arctanh(A)-arctanh(B)) assuming positive

 > simplify(arctanh(A)-arctanh(B),trig) assuming positive

 > plot(arctanh(A),y=-Pi..Pi)

 > plot(arctanh(B),y=-Pi..Pi)

 >

Compare to Mathematica:

How can i make assumptions for all subscript-varia...

Hello,

In this simple example in Maple 2019:

k[1] := 16;

solve(k[2]^2 = k[1], {k[2]}, useassumptions) assuming 0 < k;

The result of the solve is

{k[2] = 4}, {k[2] = -4}

which is not what I'm expecting.

I'm expecting

{k[2] = 4}

I'm trying to assume that both the variable named k[1] and the variable named k[2] are greater than 0 by assuming that 0 < k.
My goal is a way to make the same assumption for variables with the same base but different subscripts.
How can I do this?

Combining and converting units...

 >

Note: To enter units, I used the unit key (blue) in the Units palette.

When I use the combine and simplify functions to manipulate temperature units, Maple returns a wrong answer, as we can see below;

 >
 (1)
 >
 (2)

The quantity 20 Celsius is not converted correctly. However, for other types of dimensions, the combine and simplify functions work correctly.

 >
 (3)
 >
 (4)
 >

Another strange thing happens with the convert function, with temperature units. When we use the same source unit, the convert function deletes the unit, leaving only the quantity.

 >
 (5)

I do not understand why this occurs.

 >
 (6)

I do not understand why this occurs.

Oliveira

lprint output (format)...

If I copy the output of a lprint command e.g.
lprint(<1,2;3,4>);

Matrix(2,2,{(1, 1) = 1, (1, 2) = 2, (2, 1) = 3, (2, 2) = 4},datatype = anything
,storage = rectangular,order = Fortran_order,shape = [])

and paste it in a new execution group, I obtain a "Line print output" instead of a Maple (1D) input,
so it cannot be executed.
(Of course, it's possible to paste in Notepad to remove the format, but it's annoying.)

This happens in Maple 2019,  Windows 64, Worksheet mode, 1D input;  but not all the time (sometimes it is as it used to be).
Do you see the same behavior?

When i type sqrt(25), i get 1.81847767202745*10^(-...

Yeah, i have tried evalf[10](sqrt(25)).
How can i get a simple number as answer? I'm loving the software but i just wished i could type in:
int(sin(x), x = 0 .. pi)
and get 2 instead of (2.739493386*10^(-116) + (2.739493386*10^(-116))*I)*pi.
Also, when i type evalf[50](pi), i wish to get all the 50 digits, but i just get \pi :/.

why rewriting the ODE changes it classification by...

This for me seems strange. A first oder ODE of degree one of form   A+B*y'=0. Asking Maple for its classification, it gives exact AND rational.  After rewriting it in the form y'=f(x,y) , now Maple says it is rational only. It no longer recognize it as exact.

How could this be possible? It is the same ODE, just rewrittng differently.  Maple 2019.1 on windows.

 > restart;
 > Typesetting:-Settings(typesetprime=true):

 > dsolve(ode)

 > new_ode:=convert(ode,D); #so I can solve for y' RHS:=solve(new_ode,D(y)(x));

 > dsolve(new_ode)

 >

how to correctly find leading sign on expression?...

8/24/19. Updated question the bottom

I need to find if expression has  a "-" in front of it or not.  This is for formatting purposes for something I am doing, that is all.

I was using the command sign() for this, and it seems to work OK, but sometimes a Maple error is generated or not leading term sign is returned.

The sign function computes the sign of the leading coefficient of expr.

Is there a better and more robust way to do this other than using sign() or Am I using sign wrong?

 > restart;
 > expr:=-sin(x)/ln(y)+1; op(expr);

 > #why this gives 1 as sign for the above? sign(expr);

 > #workaround? sign(op(1,expr))

 > expr:=sin(x)/ln(y)+1; sign(expr);

 > expr:=-x; sign(expr);

 > expr:=-LambertW(exp(p))+1; sign(expr)

 > expr:=-LambertW(exp(p))/(1+LambertW(exp(p)))+1; sign(expr)

Error, invalid argument for sign, lcoeff or tcoeff

 > #it seems the following is a work around for the above case #but why it is needed just here? sign(op(1,expr))

 >

UPDATE

Thanks to comment below about using frontend. I never used this before except for now. It seems a very useful command and I think I will be using it a lot more from now on.

Just to clarify again what I want. I am just looking to see if there is a leading negative sign in front of an expression. I am not looking to find if the expression itself can be postive or negative when evaluated or anything more subtle or deep than that.

I simply want to check if there is literally a "-" in front of the maple expression. That is all.

Only issue left, is why Maple still gives Error, invalid argument for sign, lcoeff or tcoeff for the last example below? Here is the updated worksheet.

 > restart;
 > expr:=-sin(x)/ln(y)+1; frontend(sign,[expr]);

 > expr:=sin(x)/ln(y)+1; frontend(sign,[expr]);

 > expr:=-x; frontend(sign,[expr]);

 > expr:=-LambertW(exp(p))+1; frontend(print,[expr]); frontend(sign,[expr]);

 > expr:=-LambertW(exp(p))/(1+LambertW(exp(p)))+1 ; frontend(print,[expr]); frontend(sign,[expr]);

Error, invalid argument for sign, lcoeff or tcoeff

 >

Just a basic question, wanted to be clear.  When odeavisor returns a list of types (or classifications) of an ODE. This must mean the ODE can be of any one of these types?

For example, this ODE below, it says it is either homogeneous or rational or Abel or dAlembert.

I am asking because it can be much easier to solve an ODE if one knows if it is of one type vs. the other.

For example, for this one below, it is little easier to solve it if one sees it is Abel instead of dAelmbert.

The hard part is knowing what type of ODE one is trying to solve and so it is important to pick the right/easier type to use.

Which brings another question: When Maple is given an ODE to solve, and it can be of number of types, how does it select which type to use to solve the ODE? Since the method to solve the ODE depends on the type of the ODE. (At least, when solving it by hand it does make a big difference).

Is there any detailed document that explains more how odeadvisor determines the type of the ODE? This is a very powerful and a useful command but I can't find in help any hints on how it determines the type of ODE.

It must use some general method/algorithm to approach this problem instead of trying to match each different ODE type one by one. right?  I tried to trace the code in the debugger, but I do not fully understand the code flow.

 > restart;
 > Typesetting:-Settings(typesetprime=true):
 > ode:=x^2*(4*x-3*y(x))*diff(y(x),x) = (6*x^2-3*x*y(x)+2*y(x)^2)*y(x)

 > new_ode := diff(y(x),x)=convert(solve(ode,diff(y(x),x)),parfrac); # y'= the following below. So it is Abel indeed

 > #But to solve it as dAlembert, one need to rewrite it as y=x*g(y')+f(y') and it gets messy #becuase one has to solve for y(x) first, and this will generate more than one ODE ode:=convert(ode,D); map(z-> y(x)=convert(z,diff),[solve(ode,y(x))])

 >

Defining a simple function...

Hi,

I have a simple expression  g1:=x^2+x;

Then its derivative D1:=diff(g1,x); which is 2x+1

Then I want to make a function with this derivative f1:=x->D1;

And I want to evalute this function at any point, for instance f1(3)

And what I get for f1(3) is the the derivative 2x+1 and not the value 7 as I would expect.

What am I missig?

Why is maple using so much memory?...

Hey there.

I'm trying to fill out the entries of a matrix. Each matrix element is the result of a very complicated calculation. Currently, I am using nested do loops (two loops total) to scan through each row and column respectively. I find that this process racks up a ton of memory, and that I often run out of memory before the matrix has been completely specified (depending on how big a matrix I want).

First, why is this happening? And second, what is a smarter way to perform the calculation? I will attatch my code below.

Cheers!

MaplePrimes2MuchMemory.mw

Approximating a function near a point...

I realise this is probably a really obvious question...

I have this function:

(2^(1/3)*Pi*AiryAi(x))/(b*(a*AiryAi(x) + b*AiryBi(x)))

And I want to approximate it near to the root of the equation

a*AiryAi(x) + b*AiryBi(x)=0 (say the solution is x=x0)

The first term - I know - is a term for 1/(x-x0) for which the coefficient is

AiryAi(RootOf(AiryAi(_Z)*a + b*AiryBi(_Z)))*2^(1/3)*Pi/(b*a*AiryAi(1, RootOf(AiryAi(_Z)*a + b*AiryBi(_Z))) + b^2*AiryBi(1, RootOf(AiryAi(_Z)*a + b*AiryBi(_Z)))).

However the next term, which should be a constant, comes out as a really large term which I can't make sense of (I've included it at the bottom of this post but it is very large).

Am I doing something wrong? Because I feel that this should be easier than I'm making it.

The determined expansion was:

(1/3)                                       2
-3 2      Pi RootOf(AiryAi(_Z) a + b AiryBi(_Z))

3
AiryBi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  AiryAi(RootOf(

3      (1/3)
AiryAi(_Z) a + b AiryBi(_Z))) b  - 9 2      Pi

2
RootOf(AiryAi(_Z) a + b AiryBi(_Z))

2
AiryBi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

2    2      (1/3)
AiryAi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a b  - 9 2      Pi

2
RootOf(AiryAi(_Z) a + b AiryBi(_Z))  AiryBi(RootOf(AiryAi(_Z) a

3
+ b AiryBi(_Z))) AiryAi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

2        (1/3)                                       2
a  b - 3 2      Pi RootOf(AiryAi(_Z) a + b AiryBi(_Z))

4  3      (1/3)
AiryAi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a  - 4 2      Pi

RootOf(AiryAi(_Z) a + b AiryBi(_Z)) AiryBi(RootOf(AiryAi(_Z) a

+ b AiryBi(_Z)))

2
AiryBi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  AiryAi(RootOf(

3      (1/3)
AiryAi(_Z) a + b AiryBi(_Z))) b  - 8 2      Pi RootOf(AiryAi(_Z) a

+ b AiryBi(_Z)) AiryBi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

AiryBi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z))) AiryAi(1,

RootOf(AiryAi(_Z) a + b AiryBi(_Z))) AiryAi(RootOf(AiryAi(_Z) a

2      (1/3)
+ b AiryBi(_Z))) a b  - 4 2      Pi RootOf(AiryAi(_Z) a

+ b AiryBi(_Z)) AiryBi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

2
AiryAi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  AiryAi(RootOf(

2        (1/3)
AiryAi(_Z) a + b AiryBi(_Z))) a  b - 4 2      Pi RootOf(AiryAi(

_Z) a + b AiryBi(_Z))

2
AiryBi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

2    2      (1/3)
AiryAi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a b  - 8 2      Pi

RootOf(AiryAi(_Z) a + b AiryBi(_Z)) AiryBi(1,

RootOf(AiryAi(_Z) a + b AiryBi(_Z))) AiryAi(1,

RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

2  2        (1/3)
AiryAi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a  b - 4 2      Pi

RootOf(AiryAi(_Z) a + b AiryBi(_Z))

2
AiryAi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

2  3      (1/3)
AiryAi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a  + 2 2      Pi

2
AiryBi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  AiryBi(1,

RootOf(AiryAi(_Z) a + b AiryBi(_Z))) AiryAi(RootOf(AiryAi(_Z) a

3      (1/3)
+ b AiryBi(_Z))) b  + 2 2      Pi

2
AiryBi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  AiryAi(1,

RootOf(AiryAi(_Z) a + b AiryBi(_Z))) AiryAi(RootOf(AiryAi(_Z) a

2      (1/3)
+ b AiryBi(_Z))) a b  + 4 2      Pi AiryBi(RootOf(AiryAi(_Z) a

+ b AiryBi(_Z))) AiryBi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

2    2      (1/3)
AiryAi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a b  + 4 2      Pi

AiryBi(RootOf(AiryAi(_Z) a + b AiryBi(_Z))) AiryAi(1,

RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

2  2         (1/3)
AiryAi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a  b + 12 2      Pi

3
AiryBi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  AiryAi(1,

3       (1/3)
RootOf(AiryAi(_Z) a + b AiryBi(_Z))) b  + 36 2      Pi

2
AiryBi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

2    2
AiryAi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a b  + 36

(1/3)
2      Pi AiryBi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

3  2        (1/3)
AiryAi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a  b + 2 2      Pi

AiryBi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

3  2
AiryAi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a  b

(1/3)                                                  4
+ 12 2      Pi AiryAi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

3      (1/3)
a  + 2 2      Pi AiryAi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

3  3\//
AiryAi(RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a / \12

4  4
AiryAi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a  b + 48

3
AiryAi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  AiryBi(1,

3  2
RootOf(AiryAi(_Z) a + b AiryBi(_Z))) a  b  + 72

2
AiryAi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

2  2  3
AiryBi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a  b  + 48

AiryAi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))

3    4
AiryBi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  a b

4  5\
+ 12 AiryBi(1, RootOf(AiryAi(_Z) a + b AiryBi(_Z)))  b /

The sum of two paraemetrised plots...

So I have two differently parametrised plots:

p1 := plot([2^(1/3)*Pi*AiryAi(x)/(Q*(P*AiryAi(x) + Q*AiryBi(x))), -2*(-0.0008397983056*2^(1/6)*AiryAi(1, x) + 0.004845212367*2^(1/6)*AiryBi(1, x))/((-0.0008397983056*2^(1/6)*AiryAi(x) + 0.004845212367*2^(1/6)*AiryBi(x))^3*(648.3911162*2^(1/6)*AiryAi(1, x)/(-0.0008397983056*2^(1/6)*AiryAi(x) + 0.004845212367*2^(1/6)*AiryBi(x)) - 648.3911162*2^(1/6)*AiryAi(x)*(-0.0008397983056*2^(1/6)*AiryAi(1, x) + 0.004845212367*2^(1/6)*AiryBi(1, x))/(-0.0008397983056*2^(1/6)*AiryAi(x) + 0.004845212367*2^(1/6)*AiryBi(x))^2)), x = -1 .. 5])

and

p2 := plot([(sin(x) - sin(ap))/K, abs(sin(x)/cos(x)), x = 0 .. 2])

I would like to show the sum of these two plots. How would I go about doing this?

 1 2 3 4 5 6 7 Last Page 2 of 12
﻿