Maple 2019 Questions and Posts

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

 I have a problem about extremal function.

The function is shown below with restricted condition of x and a:  x>=2 and -1 < a <0.

(x-3/2)^a-(x-1)^a+(1-2^(a-1))*((x-3/2)^a-(x-1/2)^a)-x*((x-3/2)^a+x^a-(x-1/2)^a-(x-1)^a)

I guess that  it's minimum value is greater than 0.  In other words,  I want prove that  (x-3/2)^a-(x-1)^a+(1-2^(a-1))*((x-3/2)^a-(x-1/2)^a)-x*((x-3/2)^a+x^a-(x-1/2)^a-(x-1)^a)>0

when I use Minimize function,

Optimization:-Minimize((x-3/2)^a-(x-1)^a+(1-2^(a-1))*((x-3/2)^a-(x-1/2)^a)-x*((x-3/2)^a+x^a-(x-1/2)^a-(x-1)^a),{x>=2, -1<a, a<0})

I 'm not seeing but Error, (in Optimization:-NLPSolve) strict inequalities are not valid constraints. I cannot but add the condition of equality of a : -1<=a, a<=0.

Optimization:-Minimize((x-3/2)^a-(x-1)^a+(1-2^(a-1))*((x-3/2)^a-(x-1/2)^a)-x*((x-3/2)^a+x^a-(x-1/2)^a-(x-1)^a),{x>=2, -1<=a, a<=0})

A result is returned with a warning:
Warning, no iterations performed as initial point satisfies first-order conditions
[0.000000, [a = -2.225074*10^(-308), x = 2.000000]]

 

Local or Global ?

When I read recent question post 

https://www.mapleprimes.com/questions/229132-Maximize-Function-Does-Not-Work?ref=Feed:MaplePrimes:New%20Questions

 I'm worrying  that Maple only returns local  extremun. So I use the freely  maple package DirectSearch. We can get it from  https://www.maplesoft.com/applications/view.aspx?SID=101333.

DirectSearch:-GlobalOptima(-((x-3/2)^a-(x-1)^a+(1-2^(a-1))*((x-3/2)^a-(x-1/2)^a)-x*((x-3/2)^a+x^a-(x-1/2)^a-(x-1)^a)),{x>=2, -1<a, a<0},maximize);

 Note: I add a  minus sign to find maximize value .

It returns: [0.002264, [a = -0.000203, x = 1.019590*10^13], 605]

But I substitute the value of a and x  into the function,it returns strange result:   4078.360000 not  -0.002264.

I’m confused.. 

I try to use  Mathematica, 

NMinimize[{(x - 3/2)^a - (x - 1)^
    a + (1 - 2^(a - 1))*((x - 3/2)^a - (x - 1/2)^a) - 
   x*((x - 3/2)^a + x^a - (x - 1/2)^a - (x - 1)^a), 
  x >= 2 && a > -1 && a <= 0}, {x, a}]

It retruns {0., {x -> 13.256, a -> 0.}}  May be well.

 

mimimize.mw

 

i need to create a table with information from plots like how many times x become 0

this is the way to make an null oscillation 

please help!

Any  idea is good for me !

 

According to Wikipedia  https://www.wikidata.org/wiki/Q3115604 ,

Outerplanar graph  is a graph that can be drawn without crossings in the plane (means it is planar graph) with all vertices on the outer face.  

For example 

 

Recently  in my project, I  need to judge whether a planar graph is a  outerplanar graph.

I tried to find some algorithms but failed. 

Maple  only considers how to test wheather a graph is  planar.

like following:

with(GraphTheory):
with(SpecialGraphs)
K4 := CompleteGraph(4)
IsPlanar(K4, 'F')

Hello,

 

 

 

restart; with(Physics); Setup(mathematicalnotation = true); Setup(dimension = 3, metric = Euclidean, spacetimeindices = lowercaselatin); g_[]; Define(X[i], P[k]); Setup(quantumop = {P, X}, algebrarules = {%Commutator(P[i], P[j]) = 0, %Commutator(X[i], X[j]) = 0, %Commutator(X[j], P[k]) = Physics:-`*`(I, g_[j, k])}); L2 := Simplify(Physics:-`^`(Physics:-`*`(Physics:-`*`(LeviCivita[i, j, k], X[j]), P[k]), 2)); L2X := Simplify(Commutator(L2, X[k])); L2L2X__1 := Simplify(Commutator(L2, L2X)); L2L2X__2 := Simplify(Expand(AntiCommutator(Physics:-`*`(2, L2), X[k]))); Simplify(L2L2X__1-L2L2X__2)

[mathematicalnotation = true]

 

`The dimension and signature of the tensor space are set to `[3, `- - +`]

 

`The Euclidean metric in cartesian coordinates`

 

`Changing the signature of the tensor spacetime to: `*`+ + +`

 

[dimension = 3, metric = {(1, 1) = 1, (2, 2) = 1, (3, 3) = 1}, spacetimeindices = lowercaselatin]

 

Physics:-g_[a, b] = Matrix(%id = 18446746397905475934)

 

`Defined objects with tensor properties`

 

{Physics:-Dgamma[a], P[k], Physics:-Psigma[a], X[i], Physics:-d_[a], Physics:-g_[a, b], Physics:-LeviCivita[a, b, c]}

 

`* Partial match of  '`*quantumop*`' against keyword '`*quantumoperators*`' `

 

_______________________________________________________

 

[algebrarules = {%Commutator(P[i], P[j]) = 0, %Commutator(X[i], X[j]) = 0, %Commutator(X[j], P[k]) = I*Physics:-g_[j, k]}, quantumoperators = {P, X}]

 

(2*I)*Physics:-`*`(X[j], P[j])+Physics:-`*`(Physics:-`^`(X[j], 2), Physics:-`^`(P[k], 2))-Physics:-`*`(X[j], X[k], P[j], P[k])

 

2*X[k]-(2*I)*Physics:-`*`(Physics:-`^`(X[b], 2), P[k])+(2*I)*Physics:-`*`(X[c], X[k], P[c])

 

(12*I)*Physics:-`*`(X[c], X[k], P[c])-(4*I)*Physics:-`*`(Physics:-`^`(X[b], 2), P[k])+4*X[k]+4*Physics:-`*`(Physics:-`^`(X[b], 2), X[k], Physics:-`^`(P[h], 2))-4*Physics:-`*`(X[a], Physics:-`^`(X[b], 2), P[a], P[k])+4*Physics:-`*`(Physics:-`^`(X[b], 2), X[f], P[f], P[k])-4*Physics:-`*`(X[f], X[i], X[k], P[f], P[i])

 

4*X[k]+(12*I)*Physics:-`*`(X[c], X[k], P[c])+4*Physics:-`*`(Physics:-`^`(X[b], 2), X[k], Physics:-`^`(P[d], 2))-(4*I)*Physics:-`*`(Physics:-`^`(X[b], 2), P[k])-4*Physics:-`*`(X[e], X[f], X[k], P[e], P[f])

 

0

(1)

NULL

 

 

 

 

Download Commutator_Algebra_with_L2.mw

 

 

 

I have the following issue.

The way it is set at the moment, works kinda in that the final result is 0, which I tried to check.

However, the expression L2L2X[1] is not fully Simplified, since the term

-(4*X[a])*X[b]^2*P[a]*P[k] + (4*X[b]^2)*X[f]*P[f]*P[k]

is actually zero. I suppose that he doesn't manage because of the different indices "a" and "f" here. How can this be fixed?

 

When I comment out "Define" and use "Coordinates(X,P)" instead, it doesn't work. Seems to give the wrong result (Difference is not zero).

 

Hey,

I'm trying to differentiate a function but whenever I do so, it adds new variables for some reason. I think I might be able to copy the new function and just delete the extra but it is not a good solution.

 

So I'm hoping someone could help me to figure out how to remove all this extra that Maple adds to my equation. Thanks in advance.

 

I was working through an old text book, trying to understand a different problem.  I came across this problem in an exercise set and thought it was simple.  Until I tried it.

The difficlty I had was in using subs to substitute all values.  I had to use subs 2 or 3 times to get all substitutions.  How can I avoid this?

## Prove if F is the fibonacci sequence,
restart;
with(combinat, fibonacci):
F := n -> fibonacci(n);  ## F(n+1) = F(n)+F(n-1); F(1) = 1;
## the problem
P := n-> F(n+1)*F(n+2) - F(n)*F(n+3);
##
check_low := proc(n)
    local idx;
    for idx to n do
        print(P(idx),(-1)^idx);
    end do;
end proc;
check_low(1);
check_low(2);
check_low(3);
check_low(4);

## Assume true for n=k
A := P(k) = (-1)^k;

notation := { F(k)   = a,
              F(k+1) = b,
              F(k+2) = c,
              F(k+3) = d,
              F(k+4) = e };

## some fibonacci definitions
fibs := [ e = c + d,  d = b + c, c = a + b ];

eq1 := subs(notation,A);
eq1 := subs(fibs,eq1);
eq1 := subs(fibs,eq1);  ## have to repeat to get only a and b in the expression

eq2 := subs(notation,P(k+1));
eq2 := subs(fibs, eq2);
eq2 := subs(fibs, eq2);
eq2 := subs(fibs, eq2);  ## have to repeat to get only a and b in the expression
## Reduce eq2 to (-1)^(k+1)
simplify(eq2 = -lhs(eq1));
verify(eq2, -lhs(eq1), equal);
evalb(eq2); simplify(%);  ## Ah, this is why I need equal in verify.
evalb(-lhs(eq1)); simplify(%);

testeq(eq2, -lhs(eq1));

 

Hello,

I'm compiling a maple procedure to a C code with the Compiler command. I was wondering if it is possible to change the optimization flag, for example -03  for gcc? Is there a way to maybe change a file in the Maple directory that specifies the compiler options?

Second Try:

f:= c/(c - 1) - c*(Pi^2 - 12*ln(c))*(1 + c)/(12*(c - 1)^3*n) + (((144*c^3 + 1584*c^2 + 1584*c + 144)*ln(c)^2 - 24*Pi^2*(1 + c)*(c^2 + 10*c + 1)*ln(c) + (-96*c^3 - 288*c^2 + 288*c + 96)*Zeta(3) + Pi^2*((Pi^2 + 24)*c^3 + (11*Pi^2 + 72)*c^2 + (11*Pi^2 - 72)*c + Pi^2 - 24))*c)/(288*(c - 1)^5*n^2)

This expression is already arranged with respect to n. However, the nominator of each term is not collected with respect to c. So naturally I thought

collect(f,[n,c]) or collect(f,[n,c],simplify)

would work. But now he messes up the nominator i.e. he can not factor and simplify. Note that the single variable case collect(f,n,simplify) works in not messing up, but this is not what I want, since the nominator of each n-term is not in c-collected form.

collect(f,[n],u->collect(u,[c],...))

also does not work, since he messes up again.

By c-collected form I mean the following:

The n^0 and n^{-1} term are actually fine. The factorization in the second term is ok. But for the third term

f2:=(144*c^3 + 1584*c^2 + 1584*c + 144)*ln(c)^2 - 24*Pi^2*(1 + c)*(c^2 + 10*c + 1)*ln(c) + (-96*c^3 - 288*c^2 + 288*c + 96)*Zeta(3) + Pi^2*((Pi^2 + 24)*c^3 + (11*Pi^2 + 72)*c^2 + (11*Pi^2 - 72)*c + Pi^2 - 24)

what I mean by c-collected is

collect(f2,c,simplify)

This is the nominator of the n^{-2} term.

I sort of managed by the following to procedings:

of:=[op(f)];
add(`~`[`/`](collect~(numer~(of), c, factor), ` $`, denom(of)));
add(collect~(of, c, simplify));

but the first one seems cumbersome for such a trivial thing that should be handled by collect. It also does not factor out the e.g. 12*ln(c)-Pi^2. This seems to be a general behaviour

g:=a*x*(x+1);
collect(g,x) does not factor out the a as in a*(x^2+x).

With the second method I'm more or less happy, but I didn't manage to completely collect the c terms i.e. the n^{-1} term is still c*(c+1) and not c^2+c.

 Hello everyone!

 I want to find all solutions of  following equations :

I used Maple 2019: 

solutions:=solve([abs(1+1/3*lambda+1/18*lambda^2-1/324*lambda^3+1/1944*lambda^4)-1=0],[lambda]);
evalf(solutions)

The output is:

So we have two solutions. But when I use Matlab 2018, 
four solutions are returned.

syms lambda
eqn =abs(1+1/3*lambda+1/18*lambda^2-1/324*lambda^3+1/1944*lambda^4)-1==0;
solx1=solve(eqn, lambda) 
%%
solx1 =
 root (z1 ^ 4-6 * z1 ^ 3 + 108 * z1 ^ 2 + 648 * z1, z1, 1)
 root (z1 ^ 4-6 * z1 ^ 3 + 108 * z1 ^ 2 + 648 * z1, z1, 2)
 roots (z1 ^ 4-6 * z1 ^ 3 + 108 * z1 ^ 2 + 648 * z1, z1, 3)
 roots (z1 ^ 4-6 * z1 ^ 3 + 108 * z1 ^ 2 + 648 * z1, z1, 4)


 

solx3=solve(eqn, lambda,   'MaxDegree', 4)
double(solx3)
%%The solution is:
 -4.2681 + 0.0000i
 0.0000 + 0.0000i
 5.1340 -11.2012i
5.1340
+ 11.2012i

It is easy to check that  first two in Maple and Matlab are  same.

Who is right? Does Maple miss complex solutions?

 

 

 

 

 

 

 

 

Hi forum

I got a problem:

When i use these lines:

with(plots);
implicitplot(y = a*x + b, x = -10 .. 10, y = -10 .. 10, axis = [gridlines = [10, color = blue]]);



The vertical axis dosent stretches as far as i want it to.

The 'Axis Gridlines Properties' match the plot.

But the 'Axis Properties' dosent:


I can change the 'range' manually, by checking off the 'use data extend' box.
- But i need to use these plotting commands, very often.
Is it possible to write something in the plot-function, so i dosent need to do these corrections manually, every time i plot something?

Thank you in advance
Dan

I'm working along in Maple 2019 and then all of a sudden it freezes.  Anyone else have this?

Maple 2018 and earlier displayed an Array like this

In Maple 2019 I get this

How do I display Arrays in Maple 2019 like Maple 2018?

How Do I set the Command Line Font in Maple 2019?

The default font is strange.  eq is displayed as a a lower case char like '8' followed by 'q'.

I would like to have something like courier 10, etc.

Hi, I am using the GroupTheory package and I wanted to created the following group in Maple:

I stumbled across this link https://www.maplesoft.com/products/maple/features/grouptheory.aspx and then tried to use the following commands to define this group in Maple:

1. First a defined a 12x12 matrix:

ct := <<e | p | q | r | s | t | u | v | w | x | y | z>, <p | q | e | y | u | w | z | r | x | t | v | s>, <q | e | p | v | z | x | s | y | t | w | r | u>, <r | z | t | s | e | y | v | x | p | u | q | w>, <s | w | y | e | r | q | x | u | z | v | t | p>, <t | r | z | x | w | u | e | q | y | p | s | v>, <u | x | v | p | y | e | t | z | s | r | w | q>, <v | u | x | z | q | r | y | w | e | s | p | t>, <w | y | s | t | x | z | p | e | v | q | u | r>, <x | v | u | w | t | s | q | p | r | e | z | y>, <y | s | w | u | p | v | r | t | q | z | e | x>, <z | t | r | q | v | p | w | s | u | y | x | e>>

 

2. Then I tried to define my  group using:

G := Group(ct)

 

However this doesn't work because I get the following error:

Error, (in GroupTheory:-Group) invalid input: arguments to GroupTheory:-Group, [Matrix(12, 12, {(1, 1) = e, (1, 2) = p, (1, 3) = q, (1, 4) = r, (1, 5) = s, (1, 6) = t, (1, 7) = u, (1, 8) = v, (1, 9) = w, (1, 10) = x, (1, 11) = y, (1, 12) = z, (2, 1) = p, (2, 2) = q, (2, 3) = e, (2, 4) = y, (2, 5) = u, (2, 6) = w, (2, 7) = z, (2, 8) = r, (2, 9) = x, (2, 10) = t, (2, 11) = v, (2, 12) = s, (3, 1) = q, (3, 2) = e, (3, 3) = p, (3, 4) = v, (3, 5) = z, (3, 6) = x, (3, 7) = s, (3, 8) = y, (3, 9) = t, (3, 10) = w, (3, 11) = r, (3, 12) = u, (4, 1) = r, (4, 2) = z, (4, 3) = t, (4, 4) = s, (4, 5) = e, (4, 6) = y, (4, 7) = v, (4, 8) = x, (4, 9) = p, (4, 10) = ...  (12, 8) = s, (12, 9) = u, (12, 10) = y, (12, 11) = x, (12, 12) = e})], do not match any of the accepted calling sequences

 

I don't know what's going wrong. It doesn't give a 2D Plot. Thanks in advance.

Temperature over 24hr period

 

y := 0.26e-1*x^3-1.03*x^2+10.2*x+34, 0 <= x and x <= 24

``

``

 

NULL


 

Download temperature24hr.mw

First 20 21 22 23 24 25 26 Last Page 22 of 45