Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I tryning to to plot 3d and then contour plot of the function N vs alpha

This is my try please any comments might help

Dear all,

im having trouble with adding two matrixes when they are only described with a letter asigned to them. I really dont know why it is the case. But it has got the be done with letters only because later on i will need this a lot with vector calculations etc. 

Thank you!

A := matrix([[2, -5, 1], [0, 3, -2]]); B := matrix([[0, 2, -1], [7, 1, 3]]); matrix(A+B)

A := Matrix(2, 3, {(1, 1) = 2, (1, 2) = -5, (1, 3) = 1, (2, 1) = 0, (2, 2) = 3, (2, 3) = -2})


array( 1 .. 2, 1 .. 3, [( 1, 2 ) = (2), ( 2, 2 ) = (1), ( 2, 3 ) = (3), ( 1, 1 ) = (0), ( 2, 1 ) = (7), ( 1, 3 ) = (-1)  ] )


Error, (in matrix) invalid argument A+B



(Matrix(2, 3, {(1, 1) = 2, (1, 2) = -5, (1, 3) = 1, (2, 1) = 0, (2, 2) = 3, (2, 3) = -2}))+(Matrix(2, 3, {(1, 1) = 0, (1, 2) = 2, (1, 3) = -1, (2, 1) = 7, (2, 2) = 1, (2, 3) = 3}))

Matrix(%id = 18446746769648450246)













The Function


At line 46 I do some integrals of a probablity function obainted from complex amplitudes. The plot of the function is shown above. However, the integral suddlenly drops to almost nothing when I increase the limits from +/- 0.195 to +/-0.2. The transition actually occus at ~0.196 (not shown)

This makes no sense. It doesn't seem  from the plot that the step size could get so large as to miss the peak! However, I don't know how to change numerical integral step size to test that.

---Arthur (a.k.a. Traruh)




How do I factor out a term,with command line, from an algebraic expression?


Consider the following algebraic expression.


f := A*sin(x)*theta(x)*k-A*sin(x)*theta(x)*m*omega^2



Suppose I wanted to factor out the quantity A*sin(x)*theta(x)from both terms. Done by hand, it would look like:

"f:=A*sin(x)*theta(x)*k-A*sin(x)*theta(x)*m*omega^(2) =A*sin(x)*theta(x)*(k-m*omega^(2))."


What is the typical way to do this operation with a command? I tried using the collect() command with no success:


collect(f, A*sin(x)*theta(x))collect(f, A*sin(x)*theta(x))

Error, (in collect) cannot collect A*sin(x)*theta(x)



From the help sheets, "The collect function views a as a general polynomial in x.  It collects all the coefficients with the same rational power of x." Though A*sin(x)*theta(x)could be expanded into a polynomial in x (if A and theta(x)are well-behaved), I just want to work algebraically and treat A, sin(x), and theta(x)as indeterminants.  



I have an expression and I want to select the part of the expression which has diff(y(x),x) in the expression.

Using select(has,expr,diff(y(x),x) works, except when the expression happend to be exactly diff(y(x),x) in this case select returns diff()

I understand why this happens. But I can not avoid this problem by say first checking if the expression has more than one operand, because nops(diff(y(x),x) is 2 and not one. Also 1+diff(y(x),x) has two operands. And I can not check if the expression is of type `+` or `*` before, because other types can have more than one operand also.

So now what I do is the folliwng: first check if the expression has diff(y(x),x). If so, convert the expression to D and now check if nops is more than one, and if so, only now call select.

This is becuase nops(D(y)(x)) is one, while nops(diff(y(x),x) is two.

Is there a better way to do this, in order to avoid calling select and getting diff() ? I suppose I could also just check if the expression is exactly diff(y(x),x) before even calling select or has and avoid all this?

Worksheet attached



`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

#the wrong way
if has(expr,diff(y(x),x)) then


#add extra check,  example 1
if has(expr,diff(y(x),x)) then
    if nops(convert(expr,D))>1 then
       print("expression is itself diff(y(x),x))");

"expression is itself diff(y(x),x))"

#add extra check, example 2
if has(expr,diff(y(x),x)) then
    if nops(convert(expr,D))>1 then
       print("expression is diff(y(x),x))");

"part_with_diff=", 3*(diff(y(x), x))




I have an equation which i want solve it with DTM and sketch the graph of f(η) along y axis and η along x axis, f ‘( η) and g( η)





That's my pleasure If there is somebody help me to code and solve this problem.

Thanks for every one very very much.

Why does my sequence return 0 at n=9 and n=10, when it should be 4?

Beneath the sequence i have also calculated the limit of f, as x approaches infinity, and it returns 4.

Below the initial screenshot, i have displayed a screenshot of the same plot but with a much bigger x-axis. It seems something weird happens at very large numbers of x. Is it a glitch, and if so how do i fix it?

here is the maple document containing the calculations below:

Good day.

Several years ago, I obtained access to a clustering package that was useful to my studies using Maple 17.

In the meantime, I switched to another computer and now, I  cannot access the file, ClusterAnalysis.mla.

Unfortunately, I do not recall how I was able to access this library file.

Can anybody please advise me on the exact steps that are necessary to initialize and execute this file?

Thanks for reading ...

I'd like to plot row[i] of M_jk (left axis) vs. row[i] of M_ki (right axis). i is the x axis, and varies discretely from 1 to 10 (number of runs). See attached screenshot below for details. My result is off in terms of values... How to fix my plot command?


Please, how do I generate a list of ones in maple?

Dear friends,

I found a file in the Maplesoft Application Center to evaluate the minimum of a function in two variables.

I tried to extend the code to find a minimum for a function in 4 variables.

But the code does not work. Any Help, I will be appreciated.


How to linearize eq (6) by neglecting all higher order terms i.e., epsilon[1]^2, epsilon[2]^2, epsilon[1]*epsilon[2]... etc? How to do it in maple?

Please help me create a variation table of the function in maple like the above figure.




Can I disable maple's use of the ' function? (aka prime/derivative function)


For example, if


f := x^2+1



it's derivative is obtained as


Diff(f(x), x) = diff(f(x), x)

Diff(x^2+1, x) = 2*x



We used the prime operator on the f to obtain f' on the right-hand-side.


The problem is, I use prime notation as a naming convention like in defining an integral equation such as:

"psi(t)=∫G(t,t')*psi(t') ⅆt' ."


This is common practice in many texts.


Is there a way that I can disable the operator function of ' so I can use it as a naming scheme? I have tried using the Alias( ) command which works on one evaluation but if an equation is passed to another function the Alias( ) command is extinguished by the previous evaluation and it takes the derivative again which is undesired.

I haven't managed to round values with units, and get the trailing zeroes cut away, so I'd like to use the MapleTA:-Builtin:-numfmt function to do the job.

The problem is, that this function doesn't accept values with units.

I have managed to write a rounding function to do the rounding, but the problem here is that it will write the values with trailing zeroes, which isn't what I want.

Any ideas how to fix that?

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