MaplePrimes Questions

Search Questions:


Can someone help me with the kind of document I have to submit to prove my student status? 

Thank you!

I'm trying to debug a problem with define_external, and I would love some help!

I have a Maple module that contains this line of Maple code:

EigValsVecsC := define_external('EigValsVecsC', LIB = cat(dll_home,"\\operators.dll"), 'm'::ARRAY(datatype=float[8]), 'n'::integer[4], 'eig_vals'::ARRAY(datatype=float[8]), 'eig_vecs'::ARRAY(datatype=float[8]), 'THREAD_SAFE');

Running the Maple code to create the module produces this error message:

"Error, (in ModuleLoad) external linking: error loading external library C:\Users\zander\maple\toolbox\EigLib\misc\operators.dll: The specified procedure could not be found."

I've discovered that there's a single line of C++ code (in the C++ function EigValsVecsC) that I can comment out to make the problem go away.  Here's the line of C++ code:

MKL_INT info = LAPACKE_dsyev(LAPACK_ROW_MAJOR, 'V', 'U', eig_vecs.rows(), eig_vecs.raw(), eig_vecs.rows(), eig_vals.raw());

To clarify:

  • C++ compilation succeeds for operators.dll (which contains the function EigValsVecsC), with this one line either commented or uncommented.
  • The C++ function EigValsVecsC works correctly when not called from Maple (i.e., called from Visual Studio or the command line), with this one line either commented or uncommented.  (Of course, it doesn't work fully correctly with this one line commented, since this one line is the whole point of the function.  But it runs successfully and does the correct massaging of inputs.)
  • When this one line of C++ code is commented, the Maple module builds successfully, and I can call EigValsVecsC in Maple and get results back showing that, in the C++ code, the inputs to the commented line are being set up properly.

The relevant include statement in the C++ code is:

#include "mkl_lapacke.h"

I don't have to comment out the include statement (though the compiler may well be ignoring it if it's never used, when the call to LAPACKE_dsyev is commented out).

I have no good theories about what the problem may be.  I've been trolling the Web for any helpful information, and I've come up with nothing.

Can anyone help?  Thanks!

So my question is fairly simple, and it MUST've been asked multiple times before, but i had no luck using the search tool to find any results matching my question; or at least not any ones with answers that seemed to work.

For Maple 2019

Whenever i want to define a new function g(x) as the derivative of the function f(x), that is

f(x) := 3*x + 2
g(x):= f'(x)
g(3) --> Error

This is an annoyance almost every day of working with Maple for my engineering studies, and while i accidentally found a workaround for integrals, i need to figure out how to use derivatives in my expressions without needing to copy+paste the outputs.

Bonus question: why is the x in the derivative seen as a variable and not an operator? An



eq1 := 2*(diff(y__1(t), t)) = -2*y__1(t)-3*y__2(t)+2*u__1

eq2 := diff(y__2(t), t) = 4*y__1(t)-6*y__2(t)+2*u__1+4*u__2


We have two coupled differential equations relating two outputs (y__1, y__2 ) with two inputs u__1, u__2

The objective of the exercise is to obtain the four transfer functions relating the outputs to the inputs, in other words, we must find:

To save time, we will from now on write Y__1 instead of Y__1(s) , etc.

In order to find tese relations, we must solve Y__1 and Y__2 as a function of U__1 and U__2

Since our model is defined in the time-domain, the first step is to perform Laplace Transform:

Note tha y__1(0) and y__2(0)are zero because y__1 and y__2 are deviation variables, as indicated in the problem description of this exercise.

Now we have a set of two equations with two unknowns, which can be solved algebraically
(this is the advantage of the Laplace Transform). For example, from equation (3) we can
isolate Y__2:

We can substitute the expression (5) in equation (4) to obtain Y__1, as follows:

We can multiply both sides by -3 and expand the products to get:

Now we must group the factors multiplying Y__1, U__1 and U__2

Note that this relation is analogous to:

Y__1 = G__11*U__1+G__12*U__2

Since the effects of `U__1 ` and U__2 are additive, if we want to obtain the relation between one output and only one input ( for example Y__1 and "`U__1`)" we can set the other input to zero, i.e. U__2 = 0.

We still have to obtan the relation between Y__2 and the inputs. We can use equation (5) and (6):

Finally we can find the relations:






I have this problem:

in which I have to find the four transfer functions relating the outputs(yand y2) to the inputs (u1,u2).

The u and y are deviation variables. 

The objective is to find the four transfer functions:

So I have done it by hand but I was wondering if there are any maple commands, that could be used to solve such a question?


I found the transfer functions to be:

I can display an animated plot of the Normal distribution pdf and was wondering if anybody has a routine to animate the Normal cdf. If this is so - is it possible to generalise for any continuous statistical distribution?

Thanks for reading! 

I use append and cmaple to run

originally can See result in real time even if open text file

but suddenly text file become 0KB

when I copy text file and paste 

0 KB become 3 KB 

but the program can not further output to text file and no error shown



I have a vector calculus question. I was given three points, p,q, and r, and I got Maple to calculate vectors pq and pr. I also got Maple to calculate the cross product vector, pq x pr. The problem says to draw the triangle formed by p,q, and r, as well as the cross product vector. I tried to use the polygonplot tool to plot the triangle formed by the three points, but I am confused as to how to get the cross product vector to appear on the plot with the triangle. What tool do I use to plot the triangle with the cross product vector on it, so I can have a picture of the cross product vector starting at p, showing that it is orthogonal to vector pq and pr?

Thank you.

Dear Community!

I'm struggleing with a problem long since. I highly appreciate any help with this theme.

The problem is the following:

- I have a set of points, what comes from a numerical solution of a complex, but periodical function. Therefore I have a set of points (X;Y). The points are doesn't matter, but in my case, it look like this:

I want to use the Fourier-method to approximate this points with a function.

The best result I could get is this:

But it is not acceptable due to the high inaccuracy at the starting, and finishing points (there is a diagram inaccuracy %):

I'm feel like, I'm doing something wrong. Unfortunately, I had no time to look deep into the math here. Can somebody tell me, that how can I get a better result, using this method?

Thank you very much for the help in advance.

Best regards


Could anybody give me an idea of how I would go about ignoring the Christoffel symbols with coefficients of order Omega(r)^2 in the following code? Thanks.


[`*`, `.`, Annihilation, AntiCommutator, Antisymmetrize, Assume, Bra, Bracket, Check, Christoffel, Coefficients, Commutator, CompactDisplay, Coordinates, Creation, D_, Dagger, Decompose, Define, Dgamma, Einstein, EnergyMomentum, Expand, ExteriorDerivative, Factor, FeynmanDiagrams, Fundiff, Geodesics, GrassmannParity, Gtaylor, Intc, Inverse, Ket, KillingVectors, KroneckerDelta, LeviCivita, Library, LieBracket, LieDerivative, Normal, Parameters, PerformOnAnticommutativeSystem, Projector, Psigma, Redefine, Ricci, Riemann, Setup, Simplify, SortProducts, SpaceTimeVector, StandardModel, SubstituteTensor, SubstituteTensorIndices, SumOverRepeatedIndices, Symmetrize, TensorArray, Tetrads, ThreePlusOne, ToFieldComponents, ToSuperfields, Trace, TransformCoordinates, Vectors, Weyl, `^`, dAlembertian, d_, diff, g_, gamma_]



Setup(metric = -exp(2*alpha(r))*%d_(t)^2+exp(2*beta(r))*%d_(r)^2+r^2*%d_(theta)^2+r^2*sin(theta)^2*(%d_(phi)-Omega(r)*%d_(t))^2)

[metric = {(1, 1) = -exp(2*alpha(r))+(-r^2*cos(theta)^2+r^2)*Omega(r)^2, (1, 4) = -r^2*sin(theta)^2*Omega(r), (2, 2) = exp(2*beta(r)), (3, 3) = r^2, (4, 4) = r^2*sin(theta)^2}]



Physics:-g_[mu, nu] = Matrix(%id = 18446746171579097566)



Physics:-Christoffel[alpha, mu, nu] = {(1, 1, 2) = -(diff(alpha(r), r))*exp(2*alpha(r))-r*Omega(r)*(cos(theta)-1)*(cos(theta)+1)*(r*(diff(Omega(r), r))+Omega(r)), (1, 1, 3) = r^2*sin(theta)*Omega(r)^2*cos(theta), (1, 2, 1) = -(diff(alpha(r), r))*exp(2*alpha(r))-r*Omega(r)*(cos(theta)-1)*(cos(theta)+1)*(r*(diff(Omega(r), r))+Omega(r)), (1, 2, 4) = -(1/2)*r*sin(theta)^2*(r*(diff(Omega(r), r))+2*Omega(r)), (1, 3, 1) = r^2*sin(theta)*Omega(r)^2*cos(theta), (1, 3, 4) = -r^2*sin(theta)*Omega(r)*cos(theta), (1, 4, 2) = -(1/2)*r*sin(theta)^2*(r*(diff(Omega(r), r))+2*Omega(r)), (1, 4, 3) = -r^2*sin(theta)*Omega(r)*cos(theta), (2, 1, 1) = (diff(alpha(r), r))*exp(2*alpha(r))+r*Omega(r)*(cos(theta)-1)*(cos(theta)+1)*(r*(diff(Omega(r), r))+Omega(r)), (2, 1, 4) = (1/2)*r*sin(theta)^2*(r*(diff(Omega(r), r))+2*Omega(r)), (2, 2, 2) = (diff(beta(r), r))*exp(2*beta(r)), (2, 3, 3) = -r, (2, 4, 1) = (1/2)*r*sin(theta)^2*(r*(diff(Omega(r), r))+2*Omega(r)), (2, 4, 4) = -r*sin(theta)^2, (3, 1, 1) = -r^2*sin(theta)*Omega(r)^2*cos(theta), (3, 1, 4) = r^2*sin(theta)*Omega(r)*cos(theta), (3, 2, 3) = r, (3, 3, 2) = r, (3, 4, 1) = r^2*sin(theta)*Omega(r)*cos(theta), (3, 4, 4) = -r^2*sin(theta)*cos(theta), (4, 1, 2) = -(1/2)*r*sin(theta)^2*(r*(diff(Omega(r), r))+2*Omega(r)), (4, 1, 3) = -r^2*sin(theta)*Omega(r)*cos(theta), (4, 2, 1) = -(1/2)*r*sin(theta)^2*(r*(diff(Omega(r), r))+2*Omega(r)), (4, 2, 4) = r*sin(theta)^2, (4, 3, 1) = -r^2*sin(theta)*Omega(r)*cos(theta), (4, 3, 4) = r^2*sin(theta)*cos(theta), (4, 4, 2) = r*sin(theta)^2, (4, 4, 3) = r^2*sin(theta)*cos(theta)}





Hi guys,

I'm trying to apply boundary condition on the seris i generated using Adomian decomposition. Could some one please check it for me?


u[0] := a1+a2*y:



w[0] := a3+a4*y:

theta[0] := a6*y+a5

phi[0] := a8*y+a7








A[1] := R*(diff(u[0], y))+A-Gr*(B*phi[0]+theta[0])/Ree+Ha^2*(alpha*u[0]+beta*w[0])/(alpha^2+beta^2)



u[1] := int(A[1], y = 0 .. y)



u[11] := int(u[1], y = 0 .. y)



u = u[0]+u[11]

u = a1+a2*y+(1/3)*(-(1/2)*Gr*(a6+B*a8)/Ree+(1/2)*Ha^2*(alpha*a2+beta*a4)/(alpha^2+beta^2))*y^3+(1/2)*(R*a2+A-Gr*(a5+B*a7)/Ree+Ha^2*(alpha*a1+beta*a3)/(alpha^2+beta^2))*y^2


A[2] := R*(diff(w[0], y))-Ha^2*(beta*u[0]-alpha*w[0])/(alpha^2+beta^2)



w[1] := int(A[2], y = 0 .. y)



w[11] := int(w[1], y = 0 .. y)




w = w[0]+w[11]

w = a3+a4*y-(1/6)*Ha^2*(beta*a2-alpha*a4)*y^3/(alpha^2+beta^2)+(1/2)*(R*a4-Ha^2*(beta*a1-alpha*a3)/(alpha^2+beta^2))*y^2


A[3] := R*Pr*(diff(theta[0], y))-2*Br*((diff(u[0], y))^2+(diff(w[0], y))^2+M^2*C*(u[0]^2+w[0]^2))-gamma*R*Pr*theta[0]



theta[1] := int(A[3], y = 0 .. y)



theta[11] := int(theta[1], y = 0 .. y)



theta = theta[0]+theta[11]

theta = a5+a6*y-(1/6)*Br*M^2*C*(a2^2+a4^2)*y^4+(1/3)*(-Br*M^2*C*(2*a1*a2+2*a3*a4)-(1/2)*gamma*R*Pr*a6)*y^3+(1/2)*(R*Pr*a6-2*Br*(a2^2+a4^2+M^2*C*(a1^2+a3^2))-gamma*R*Pr*a5)*y^2





A[4] := R*Sc*(diff(phi[0], y))-K*Sc*phi[0]



phi[1] := int(A[4], y = 0 .. y)



phi[11] := int(phi[1], y = 0 .. y)



phi = phi[0]+phi[11]

phi = a7+a8*y-(1/6)*K*Sc*a8*y^3+(1/2)*(R*Sc*a8-K*Sc*a7)*y^2





Hello MaplePrimes users

How do I find expressions of an integer as a sum of four squares in Maple?

Hi everyone,

Please, I really need your expertise advice(s) on what i am not doing right in the code attached below. I was actually writing the code on Multi-step DTM, but, instead of continuing from the last point, it starting all over again. Please, your expertise will save a soul here. Regard



I need to plot some correlation matrices C1, C2, ... and I use matrixplot for this.
I would like to use the same absolute scale (-1..+1) for all of them.
For instance is I decide to uses colorscheme=["blue", "white", "red"] I would like blue to correspond to value -1, white to value 0 and red to value 1.
Unfortunately colorscheme set to blue the cell with the mininum value (not necessarily -1) and to red the maximum one (not necessarily +1).
Here is an example

N := 10:
P := 3:
A := Sample(Uniform(0, 1), [N, P]):
C := CorrelationMatrix(A):

​​​​​​​  gap=0.25,
​​​​​​​  color=((x,y)->(C[x,y]+1)/2),
​​​​​​​  orientation=[0, 0, 0],
​​​​​​​  lightmodel=none,
​​​​​​​  tickmarks=[[seq(i+1/2=A||i, i=1..P)], [seq(i+1/2=A||i, i=1..P)], default],
​​​​​​​  labels=[("")$3]​​​​​​​
​​​​​​​  );

​​​​​​​I also tried to use color=((x,y) -> (C[x, y]+1)/2) instead of colorscheme but here again matrixplot uses a local scale defined by the reange of the correlation matrix to plot.

I fixed this by using something like seq(seq(PLOT(POLYGONS(...), i=1..P), j=1..P) instead of matrixplot, but I think it is a shame to do so.

So my question: is it possible to force matrixplot not to use a scale defined by the matrix to plot, but a "user" scale?

PS: I'm using Maple 2015 

Thanks in advance

I have some trouble solving the pde of:
ut + u^2*ux = u, u(x,0) = x, with x::real and t>0.

I think that I have 2 problems.

The first part of the code I define u(x,t) with both the variable rp.
Then I define the variable q copying the definition of u(x,t).
When I try to insert q and u(x,t) in the initial equation - one is able to be reduced to one term while the other isn't.
So I'm not really sure what is happening here.

When I use Maple's pdsolve() I get a result, but when I insert the answer in the initial equation - then it isn't correct.
I tried to show this in the last part of the code.




# ut + u^2*ux = u, u(x,0) = x


rp := (-1 + sqrt(1 + 4*exp(t)^2*t*x))/(2*exp(t)^2*t);



u := (x,t) -> rp*exp(t):
'u(x,t)' = u(x,t);

u(x, t) = (1/2)*(-1+(1+4*(exp(t))^2*t*x)^(1/2))/(exp(t)*t)


q := (-1 + sqrt(1 + 4*exp(t)^2*t*x))/(2*exp(t)*t); # Copying the result from above and defining q the same



# Now doing the same operations on supposedly the same term, but one is able to be reduced with assumptions while the other isn't.

L_nothing := diff(u(x,t),t) + u(x,t)^2*diff(u(x,t),x) ;
L_real := diff(u(x,t),t) + u(x,t)^2*diff(u(x,t),x) assuming x::real;
L_t := diff(u(x,t),t) + u(x,t)^2*diff(u(x,t),x) assuming t>0;
L_all := diff(u(x,t),t) + u(x,t)^2*diff(u(x,t),x) assuming t>0, x::real;









L_nothing := diff(q,t) + q^2*diff(q,x) ;
L_real := diff(q,t) + q^2*diff(q,x) assuming x::real;
L_t := diff(q,t) + q^2*diff(q,x) assuming t>0;
L_all := diff(q,t) + q^2*diff(q,x) assuming t>0, x::real;










pde := diff(u(x,t),t) + u(x,t)^2*diff(u(x,t),x) = u(x,t);
ic := u(x,0) = x;

diff(u(x, t), t)+u(x, t)^2*(diff(u(x, t), x)) = u(x, t)


u(x, 0) = x


pdsolve([pde, ic]);

u(x, t) = exp(t)*((2*exp(2*t)*x-2*x+1)^(1/2)-1)/(exp(2*t)-1)


u := (x,t) -> exp(t)*(sqrt(2*exp(2*t)*x - 2*x + 1) - 1)/(exp(2*t) - 1);

proc (x, t) options operator, arrow; exp(t)*(sqrt(2*exp(2*t)*x-2*x+1)-1)/(exp(2*t)-1) end proc


L := diff(u(x,t),t) + u(x,t)^2*diff(u(x,t),x) assuming t>0, x::real;



LL := simplify(L) = u(x,t)

exp(t)*(2*exp(2*t)*x-(2*exp(2*t)*x-2*x+1)^(1/2)-2*x+1)/((2*exp(2*t)*x-2*x+1)^(1/2)*(exp(2*t)-1)) = exp(t)*((2*exp(2*t)*x-2*x+1)^(1/2)-1)/(exp(2*t)-1)





# Obviously not correct solution... or what?







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