Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I'm working towards creating a way to visualise real polynomial ideals! (or at least the solutions of the polynomials in the ideals) this code creates a plot showing the solutions to all the polynomials in the ideal generated by P1 and P2 (these are specified in the code)

with(plots);
P1 := x^2+2*y^2-3;
solve(P1, y);
Plot1 := plot([%], x = -2 .. 2);

P2 := -2*x^2+2*x*y+3*y^2+x-4;
solve(%, y);
Plot2 := plot([%], x = -4 .. 2);

P2*a+P1;
solve(%, y);
seq(plot([%], x = -4 .. 2), a = 0 .. 10, .1);
display(%, Plot1, Plot2)




This is because when you multiply two polynomials their set of solution curves is just the union of the sets of curves associated with the previous polynomials.

For the next step I'd like to create a graph of the solutions associated with an ideal with three generators. To stop this from being excessively messy I'd like to do it with the RGB value of the colour of a curve is determined by  a and b where the formula for a generic polynomial that we are solving and graphing is given by:

P1+a*P2+b*P3;

where P3 is given by

P3 := x*y-3

I've tried various ways to use cury to make this work (my intuition is cury is the right function to use here)  but got no where. Any ideas how to procede?

I wanted to remove entry from a list that contain y=y or x=x in it. Here is an example

f:= (x-1)*y^4/(x^2*(2*y^2-1));
S:=[singular(f)]

Where I wanted to remove those entries highlighted above to obtain

This is below how I ended up doing it. I'd like to ask if there is a better or more elegent way. I had to use map, since could not get remove() to work on the original list in one shot. 

foo:= z->remove(has,z,{y = y,x = x});
map(foo,[singular(f)])

Which gives the output above.

Is there a better way to do this? I always learn when I find how to do something better.

Maple 2019.1

 

 

Which sorting related with famous sequence

for example 

sorting differential equation in a list

then access the list with famous sequence as index such as using https://oeis.org/

after access with sequence as index, use choose function to get combinations then most result are isomorphism differential ideals?

is there methods about this sorting in Richard Stanley Combinatiric book? which page of it?

Last month I still can read file

by 

read “c://Users//hello//Documents//h.m”

but

now it return error

no read access c://Users//hello//Documents/

and 

in security I add the m file into readable 

I saw open file at c drive has many shell folders 

i just add m file

but still the same error

i unencrypted m file by window properties

still the same error

i save file into maple roaming directory under 12 folder , still the same error

i save into maple installation directory maple 12 , still the same error

I am trying to find what the meaning of the values that _LatexSmallFractionConstant accepts and what they do.

For example

mu:=1/((4*t+1)^(8/5)*(t-1)^(7/5));
_LatexSmallFractionConstant:=34:
latex(simplify(mu))

{1 \left( 4\,t+1 \right) ^{-{\frac{8}{5}}} \left( t-1 \right) ^{-{
\frac{7}{5}}}}

Which renders wrong as follows

But when I set _LatexSmallFractionConstant to 35 instead of 34 this is what happens

restart;
mu:=1/((4*t+1)^(8/5)*(t-1)^(7/5));
_LatexSmallFractionConstant:=35:
latex(simplify(mu))

{\frac {1}{ \left( t-1 \right) ^{{\frac{7}{5}}}} \left( 4\,t+1
 \right) ^{-{\frac{8}{5}}}}

which renders as a little better as

And when I set it to _LatexSmallFractionConstant:=100 it becomes good

However, no settings value will make latex render this fraction correctly

restart;
mu:=1/(x+y);
_LatexSmallFractionConstant:=2000000000:
latex(mu)

           \left( x+y \right) ^{-1}

But if I set it to 35 again now it fails to handle fraction right

restart;
mu:=1/2;
_LatexSmallFractionConstant:=35:
latex(mu)

    1/2

but changing to  either zero or 1 or 2 makes it generate the correct latex

restart;
mu:=1/2;
_LatexSmallFractionConstant:=0:  #1 and 2 also works. By anything larger it goes back to 1/2
latex(mu)

    {\frac{1}{2}}  #but why extra {} ??

 

So it seems some values makes it work OK (35 for top example) but same value makes it not work well for another example.

It seems like random settings to me.

Where is all of this documented?  I can't find it in help. Which file to print to see what this option does?

Maple 2019.1  on windows.


 

restart;
mu:=1/((4*t+1)^(8/5)*(t-1)^(7/5));
_LatexSmallFractionConstant:=34:
latex(mu)

1/((4*t+1)^(8/5)*(t-1)^(7/5))

{1 \left( 4\,t+1 \right) ^{-{\frac{8}{5}}} \left( t-1 \right) ^{-{
\frac{7}{5}}}}

restart;
mu:=1/((4*t+1)^(8/5)*(t-1)^(7/5));
_LatexSmallFractionConstant:=35:
latex(mu)

1/((4*t+1)^(8/5)*(t-1)^(7/5))

{\frac {1}{ \left( t-1 \right) ^{{\frac{7}{5}}}} \left( 4\,t+1
 \right) ^{-{\frac{8}{5}}}}

restart;
mu:=1/((4*t+1)^(8/5)*(t-1)^(7/5));
_LatexSmallFractionConstant:=100:
latex(mu)

1/((4*t+1)^(8/5)*(t-1)^(7/5))

{\frac {1}{ \left( 4\,t+1 \right) ^{8/5} \left( t-1 \right) ^{7/5}}}

restart;
mu:=1/(x+y);
_LatexSmallFractionConstant:=2000000000:
latex(mu)

1/(x+y)

 \left( x+y \right) ^{-1}

restart;
mu:=1/2;
_LatexSmallFractionConstant:=3:
latex(mu)

1/2

1/2

restart;
mu:=1/2;
_LatexSmallFractionConstant:=0:
latex(mu)

1/2

{\frac{1}{2}}

 


 

Download bug_july_17_2019.mw

This is really a FYI more than a question, since I do not expect any more to be able to fix these since they are part of old Maple code called algolib, downloaded from  http://algo.inria.fr/libraries/   

I was trying to see if the latex command included in the above will work better than Maple own latex command.  I downloaded the tar file from the above http://algo.inria.fr/libraries/17.0/algolib.tar    and extracted it.  

At first I could not find where the latex command is, since it is not part of the .mla. After some struggle, I found I can get their latex command to work if I read the following 6 .mpl files (in this order) that show up after opening the above tar file

read "C:/MAPLE/algolib/mad/CommonLib.mpl";
read "C:/MAPLE/algolib/mad/DocumentGenerator.mpl";
read "C:/MAPLE/algolib/mad/MAD.mpl";
read "C:/MAPLE/algolib/mad/LaTeX.mpl";
read "C:/MAPLE/algolib/mad/HTMX.mpl";
read "C:/MAPLE/algolib/mad/DocumentGenerator.mpl";

Once I did the above, now I could do the command

MADLaTeX:-latex(sol);

#or 

MADLaTeX:-latex(sol,'string')

And these work now. For example

MADLaTeX:-latex(1/2)

         \frac{1}{2}

So I said, great, finally a Maple latex command that knows how to convert a fraction to latex the right way. Much better than Maple's latex command default output 

latex(1/2)

         1/2

But when I started testing it more, I found many problems. So I am posting these issues, since I do not know where to send them to, as this package is no longer being maintained. May be some Maple expert can figure how to fix them if there is an interest.  I looked at the code above, and too complicated for me to even figure where to look and how to fix these.

restart;

read "C:/MAPLE/algolib/mad/CommonLib.mpl";
read "C:/MAPLE/algolib/mad/DocumentGenerator.mpl";
read "C:/MAPLE/algolib/mad/MAD.mpl";
read "C:/MAPLE/algolib/mad/LaTeX.mpl";
read "C:/MAPLE/algolib/mad/HTMX.mpl";
read "C:/MAPLE/algolib/mad/DocumentGenerator.mpl";

#EXAMPLE 1

V:=x->piecewise(0<=x and x<=a,0,infinity);
ic:=f(x,0)=piecewise(0<=x and x<=a,A*x*(a-x),0);
pde :=I*h*diff(f(x,t),t)=-h^2/(2*m)*diff(f(x,t),x$2) +V(x)*f(x,t);
sol:=pdsolve([pde,ic],f(x,t)) assuming a>0;
lprint(sol);

V := proc (x) options operator, arrow; piecewise(0 <= x and x <= a, 0, infinity) end proc

ic := f(x, 0) = piecewise(0 <= x and x <= a, A*x*(a-x), 0)

pde := I*h*(diff(f(x, t), t)) = -h^2*(diff(f(x, t), x, x))/(2*m)+piecewise(0 <= x and x <= a, 0, infinity)*f(x, t)

f(x, t) = piecewise(0 <= x and x <= a, A*x*(a-x), 0)+Sum(t^n*((proc (U) options operator, arrow; -I*(-(1/2)*h^2*(diff(diff(U, x), x))/m+piecewise(0 <= x and x <= a, 0, infinity)*U)/h end proc)@@n)(piecewise(0 <= x and x <= a, A*x*(a-x), 0))/factorial(n), n = 1 .. infinity)

f(x,t) = piecewise(0 <= x and x <= a,A*x*(a-x),0)+Sum(t^n*((U -> -I*(-1/2*h^2/m
*diff(diff(U,x),x)+piecewise(0 <= x and x <= a,0,infinity)*U)/h)@@n)(piecewise(
0 <= x and x <= a,A*x*(a-x),0))/n!,n = 1 .. infinity)

MADLaTeX:-latex(sol)

Error, (in typetomath) 0 <= x and x <= a: invalid for math mode

latex(sol)

f \left( x,t \right) =
\cases{Ax \left( a-x \right) &$0\leq x$\  and \ $x\leq a$\cr 0&otherwise\cr}
+\sum _{n=1}^{\infty }{\frac {{t}^{n} \left( U\mapsto {\frac {-i
\cases{0&$0\leq x$\  and \ $x\leq a$\cr \infty &otherwise\cr}U}{h}}^{

 \left( n \right) } \right)  \left(
\cases{Ax \left( a-x \right) &$0\leq x$\  and \ $x\leq a$\cr 0&otherwise\cr}
 \right) }{n!}}

#EXAMPLE 2

pde := diff(v(t, s), t) +s^2*(diff(v(t, s), s, s))/(2*sigma^2)+(r-q)*s*(diff(v(t, s), s))-r*v(t, s) = 0;
ic:=v(T, s) = psi(s);
sol:=pdsolve([pde,ic],v(t,s));
lprint(sol);

diff(v(t, s), t)+(1/2)*s^2*(diff(diff(v(t, s), s), s))/sigma^2+(r-q)*s*(diff(v(t, s), s))-r*v(t, s) = 0

v(T, s) = psi(s)

v(t, s) = psi(s)+Sum((t-T)^n*((proc (U) options operator, arrow; -(1/2)*(diff(diff(U, s), s))*s^2/sigma^2+s*(-r+q)*(diff(U, s))+r*U end proc)@@n)(psi(s))/factorial(n), n = 1 .. infinity)

v(t,s) = psi(s)+Sum((t-T)^n*((U -> -1/2*diff(diff(U,s),s)*s^2/sigma^2+s*(-r+q)*
diff(U,s)+r*U)@@n)(psi(s))/n!,n = 1 .. infinity)

MADLaTeX:-latex(sol)

Error, (in symbol/string) only ANSI-C compliant symbols are handled

latex(sol)

v \left( t,s \right) =\psi \left( s \right) +\sum _{n=1}^{\infty }{
\frac { \left( t-T \right) ^{n} \left( U\mapsto rU^{ \left( n \right)
} \right)  \left( \psi \left( s \right)  \right) }{n!}}

#EXAMPLE 3

interface(showassumed=0);
pde := diff(u(x,t),t)=k*diff(u(x,t),x$2)- u(x,t)*x;
ic  := u(x,0)=sin(x);
bc  := u(0,t)=0,u(Pi,t)=0;
sol:=pdsolve([pde,ic,bc],u(x,t)) assuming k>0;
lprint(sol)

0

diff(u(x, t), t) = k*(diff(diff(u(x, t), x), x))-u(x, t)*x

u(x, 0) = sin(x)

u(0, t) = 0, u(Pi, t) = 0

u(x, t) = `casesplit/ans`(Sum(-(AiryBi(-lambda[n]/k^(1/3))*AiryAi((-lambda[n]+x)/k^(1/3))-AiryBi((-lambda[n]+x)/k^(1/3))*AiryAi(-lambda[n]/k^(1/3)))*((Int(sin(x)*AiryBi((-lambda[n]+x)/k^(1/3)), x = 0 .. Pi))*AiryAi(-lambda[n]/k^(1/3))-AiryBi(-lambda[n]/k^(1/3))*(Int(sin(x)*AiryAi((-lambda[n]+x)/k^(1/3)), x = 0 .. Pi)))*(-sinh(lambda[n]*t)+cosh(lambda[n]*t))/((Int(AiryBi((-lambda[n]+x)/k^(1/3))^2, x = 0 .. Pi))*AiryAi(-lambda[n]/k^(1/3))^2-2*AiryBi(-lambda[n]/k^(1/3))*(Int(AiryBi((-lambda[n]+x)/k^(1/3))*AiryAi((-lambda[n]+x)/k^(1/3)), x = 0 .. Pi))*AiryAi(-lambda[n]/k^(1/3))+AiryBi(-lambda[n]/k^(1/3))^2*(Int(AiryAi((-lambda[n]+x)/k^(1/3))^2, x = 0 .. Pi))), n = 0 .. infinity), {And(AiryAi((-lambda[n]+Pi)/k^(1/3))*AiryBi(-lambda[n]/k^(1/3))-AiryBi((-lambda[n]+Pi)/k^(1/3))*AiryAi(-lambda[n]/k^(1/3)) = 0, -infinity <= lambda[n] and lambda[n] <= infinity)})

u(x,t) = `casesplit/ans`(Sum(-(AiryBi(-1/k^(1/3)*lambda[n])*AiryAi((-lambda[n]+
x)/k^(1/3))-AiryBi((-lambda[n]+x)/k^(1/3))*AiryAi(-1/k^(1/3)*lambda[n]))*(Int(
sin(x)*AiryBi((-lambda[n]+x)/k^(1/3)),x = 0 .. Pi)*AiryAi(-1/k^(1/3)*lambda[n])
-AiryBi(-1/k^(1/3)*lambda[n])*Int(sin(x)*AiryAi((-lambda[n]+x)/k^(1/3)),x = 0
.. Pi))*(-sinh(lambda[n]*t)+cosh(lambda[n]*t))/(Int(AiryBi((-lambda[n]+x)/k^(1/
3))^2,x = 0 .. Pi)*AiryAi(-1/k^(1/3)*lambda[n])^2-2*AiryBi(-1/k^(1/3)*lambda[n]
)*Int(AiryBi((-lambda[n]+x)/k^(1/3))*AiryAi((-lambda[n]+x)/k^(1/3)),x = 0 .. Pi
)*AiryAi(-1/k^(1/3)*lambda[n])+AiryBi(-1/k^(1/3)*lambda[n])^2*Int(AiryAi((-
lambda[n]+x)/k^(1/3))^2,x = 0 .. Pi)),n = 0 .. infinity),{And(AiryAi(1/k^(1/3)*
(-lambda[n]+Pi))*AiryBi(-1/k^(1/3)*lambda[n])-AiryBi(1/k^(1/3)*(-lambda[n]+Pi))
*AiryAi(-1/k^(1/3)*lambda[n]) = 0,-infinity <= lambda[n] and lambda[n] <=
infinity)})

MADLaTeX:-latex(sol)

Error, (in typetomath) -infinity <= lambda[n] and lambda[n] <= infinity: invalid for math mode

latex(sol)

u \left( x,t \right) =\mbox {{\tt `casesplit/ans`}} \left( \sum _{n=0
}^{\infty } \left( {(-\sinh \left( \lambda_{{n}}t \right) +\cosh
 \left( \lambda_{{n}}t \right) ) \left( {{\rm Bi}\left({\frac {-
\lambda_{{n}}+x}{\sqrt [3]{k}}}\right)}{{\rm Ai}\left(-{\frac {\lambda
_{{n}}}{\sqrt [3]{k}}}\right)}-{{\rm Bi}\left(-{\frac {\lambda_{{n}}}{

\sqrt [3]{k}}}\right)}{{\rm Ai}\left({\frac {-\lambda_{{n}}+x}{\sqrt [
3]{k}}}\right)} \right)  \left( \int_{0}^{\pi}\!\sin \left( x \right)
{{\rm Bi}\left({\frac {-\lambda_{{n}}+x}{\sqrt [3]{k}}}\right)}
\,{\rm d}x{{\rm Ai}\left(-{\frac {\lambda_{{n}}}{\sqrt [3]{k}}}
\right)}-{{\rm Bi}\left(-{\frac {\lambda_{{n}}}{\sqrt [3]{k}}}\right)}
\int_{0}^{\pi}\!\sin \left( x \right) {{\rm Ai}\left({\frac {-\lambda_
{{n}}+x}{\sqrt [3]{k}}}\right)}\,{\rm d}x \right)  \left( \int_{0}^{
\pi}\! \left( {{\rm Bi}\left({\frac {-\lambda_{{n}}+x}{\sqrt [3]{k}}}
\right)} \right) ^{2}\,{\rm d}x \left( {{\rm Ai}\left(-{\frac {\lambda
_{{n}}}{\sqrt [3]{k}}}\right)} \right) ^{2}-2\,{{\rm Bi}\left(-{\frac
{\lambda_{{n}}}{\sqrt [3]{k}}}\right)}\int_{0}^{\pi}\!{{\rm Bi}\left({
\frac {-\lambda_{{n}}+x}{\sqrt [3]{k}}}\right)}{{\rm Ai}\left({\frac {
-\lambda_{{n}}+x}{\sqrt [3]{k}}}\right)}\,{\rm d}x{{\rm Ai}\left(-{
\frac {\lambda_{{n}}}{\sqrt [3]{k}}}\right)}+ \left( {{\rm Bi}\left(-{
\frac {\lambda_{{n}}}{\sqrt [3]{k}}}\right)} \right) ^{2}\int_{0}^{\pi
}\! \left( {{\rm Ai}\left({\frac {-\lambda_{{n}}+x}{\sqrt [3]{k}}}
\right)} \right) ^{2}\,{\rm d}x \right) ^{-1}} \right) , \left\{ {\it
And} \left( {{\rm Ai}\left({\frac {-\lambda_{{n}}+\pi}{\sqrt [3]{k}}}
\right)}{{\rm Bi}\left(-{\frac {\lambda_{{n}}}{\sqrt [3]{k}}}\right)}-
{{\rm Bi}\left({\frac {-\lambda_{{n}}+\pi}{\sqrt [3]{k}}}\right)}{
{\rm Ai}\left(-{\frac {\lambda_{{n}}}{\sqrt [3]{k}}}\right)}=0,-
\infty \leq \lambda_{{n}} \land \lambda_{{n}}\leq \infty  \right)
 \right\}  \right)

 

 


 

Download bugs_in_aldor_latex.mw

 

possible to solve following equation with unknown parameter omega.

parameter constant.

I see before for one dimension ode this type equation was solved.

Now for 2d equation is possible?

can consider or I can send again.

Best

2d-2

 

Why am I not able to use my MaplePrimes login credentials to login into MapleCloud?

A few months ago i completely lost one of my linux operating systems in a single line of commands I entered into the terminal, and at some point I want to utilize the StringTools package with commands like  RegSubs and RegMatch to output the matching strings that match for the current command line content in a linux terminal, so I will know before I hit the enter key how stupid it was of me to do so *prior* to hitting the enter key.

 

The part I have no idea about is the piping of the keyboard input  for a terminal window to the maple session that will output the strings matching as previously described. I'm sorry if this question is not very clear I will try clarify more this afternoon. 

 

 

maple does not work at all

it displays this error

Error, (in StringTools:-FormatMessage) unknown option MAPLE
 

How to calculate potential function of Maxwell equations?

is there calculation examples of strong and weak force examples too?

which library can calculate intersection numbers of familes of potential function of Maxwell equations?

is there any examples?

Hi everybody:

I have the code in Maple that when run it I see this error, how can I solve this error? 

tnx...

 

hello everyone,

please I need our help to find the eigenvalues (m) of this equation (eq)

thank you 

eq.mw
 

``

restart

with(LinearAlgebra):

NULL

Digits := 5:

``

``

eq := exp(-m*xi)*(exp((1/4)*sqrt(-m)*r*(r-1))*(1+(7/20)*sqrt(m)*r+((49/800)*m-(1/4)*sqrt(m))*r^2)*r^I+exp((1/4)*sqrt(-m)*r*(r-1))*(1+(7/20)*sqrt(m)*r+((49/800)*m-(1/4)*sqrt(m))*r^2)*r^I*cos(theta)+r^I*sin(5*theta))

exp(-m*xi)*(exp((1/4)*(-m)^(1/2)*r*(r-1))*(1+(7/20)*m^(1/2)*r+((49/800)*m-(1/4)*m^(1/2))*r^2)*r^I+exp((1/4)*(-m)^(1/2)*r*(r-1))*(1+(7/20)*m^(1/2)*r+((49/800)*m-(1/4)*m^(1/2))*r^2)*r^I*cos(theta)+r^I*sin(5*theta))

(1)

``


 

Download eq.mw

 

Hi all

trying to find analytically sin(erf(t)) and cos(erf (t)) rather than numerically

 

1/0;
Error, numeric exception: division by zero
lastexception;
            0, "numeric exception: division by zero"
lastexception; # ???
            Typesetting:-Typeset, "invalid input: %1 expects %2 arguments, but received %3", type, 2, 3

 

So, printing lastexception produces a new error!
When typesetting=standard, it's OK.

 

1 2 3 4 5 6 7 Last Page 1 of 1562