MaplePrimes Questions

l45 := (x + 7)(x - 1) = (1 + x)^2;
                             "(->)"

Error, (in solve) cannot solve for an unknown function with other operations in its arguments

This is my first time working with plotting data from a matrix. However, with the help of a friends on MaplePrimes, I learned how to plot the data in both Maple and MATLAB. Despite this, I am having trouble with visualization. When I change the delta value, my function experiences vibrations or noise, which is clearly visible in the plot. But when I change delta, I encounter errors with my matrix data. How can I fix this problem? and there is any way for get better visualization by Explore ? also How show this vibration or noise in 2D?

restart;

randomize():

local gamma;

gamma

(1)

currentdir(kernelopts(':-homedir'))

NULL

T3 := (B[1]*(tanh(2*n^2*(delta^2-w)*k*t/((k*n-1)*(k*n+1))+x)-1))^(1/(2*n))*exp(I*(-k*x+w*t+delta*W(t)-delta^2*t))

(B[1]*(tanh(2*n^2*(delta^2-w)*k*t/((k*n-1)*(k*n+1))+x)-1))^((1/2)/n)*exp(I*(-k*x+w*t+delta*W(t)-delta^2*t))

(2)

NULL

params := {B[1]=1,n=2,delta=1,w=1,k=3 };

{delta = 1, k = 3, n = 2, w = 1, B[1] = 1}

(3)

NULL

insert numerical values

solnum :=subs(params, T3);

(tanh(x)-1)^(1/4)*exp(I*(-3*x+W(t)))

(4)

CodeGeneration['Matlab']('(tanh(x)-1)^(1/4)*exp(I*(-3*x+W(t)))')

Warning, the function names {W} are not recognized in the target language

 

cg = ((tanh(x) - 0.1e1) ^ (0.1e1 / 0.4e1)) * exp(i * (-0.3e1 * x + W(t)));

 

N := 100:

use Finance in:
  Wiener := WienerProcess():
  P := PathPlot(Wiener(t), t = 0..10, timesteps = N, replications = 1):
end use:

W__points := plottools:-getdata(P)[1, -1]:
t_grid := convert(W__points[..,1], list):
x_grid := [seq(-2..2, 4/N)]:

T, X := map(mul, [selectremove(has, [op(expand(solnum))], t)])[]:

ST := unapply(eval(T, W(t)=w), w)~(W__points[.., 2]):
SX := evalf(unapply(X, x)~(x_grid)):

STX := Matrix(N$2, (it, ix) -> ST[it]*SX[ix]);

_rtable[36893490640185799852]

(5)

opts := axis[1]=[tickmarks=[seq(k=nprintf("%1.1f", t_grid[k]), k=1..N, 40)]],
        axis[2]=[tickmarks=[seq(k=nprintf("%1.1f", x_grid[k]), k=1..N, 40)]],
        style=surface:

DocumentTools:-Tabulate(
  [
    plots:-matrixplot(Re~(STX), opts),
    plots:-matrixplot(Im~(STX), opts),
plots:-matrixplot(abs~(STX), opts)
  ]
  , width=60
)

"Tabulate"

(6)

MatlabFile := cat(currentdir(), "/ST2.txt"); ExportMatrix(MatlabFile, STX, target = MATLAB, format = rectangular, mode = ascii, format = entries)

421796

(7)

NULL

Download data-analysis.mw

After download MapleFlow 2024.2 "fsolve" return only one solution for a polynom of n-order.

Can I unchain by an hidden order?

A parallelogram is given in the Cartesian coordinate system. If the corner points of the parallelogram are connected to the midpoints of adjacent sides using lines, then the eight connecting lines form an octagon.
It must be proven that its area is one sixth of the parallelogram's area.

is(abs(x)=max(x,-x)) assuming real;

#  FAIL

I wonder if this will work in newer versions of Maple?

These two issues probably came up before, but I can't find where and when searching Maple primes.

So I thought to summarize the issues I see with odetest in one post, in the hope to get clarification on current status on these from the powers who know.

The first issue

The order in which odetest returns the answer. When odetest is called to check the ode and IC, as in 

the_status := odetest(sol,[ode,IC])

One would expect the_status to be a list, where the first entry tells if sol verifies the ode, and the second entry tells if sol verifies IC.

i.e. the order is the same as in the input. right? Since ode is first and IC is second in the input list.

But Maple sometimes mixes the order. See example 1 below. This makes it impossible to determine if the solution verifies the ode or IC,  when one of the entries in the_status is zero and the other is not, since order can be reversed sometimes.

Second issue:

When the solution is implicit, Maple gives invalid odetest result on the IC, unless one rewrites the solution using (lhs-rhs)(sol)=0.

i.e. move everything to the left side of the equation with RHS zero. This happens sometimes and when the solution is implicit.

I have thought this was fixed in current Maple, but it is not.  I remember this came up before, but can't find when and where.

Example 2 below shows an example.

Will these two issues hopefully be fixed in Maple 2025? Sometimes one forgets to rewrite the solution using (lhs-rhs)(sol)=0 and this results in false negative. 

Please see worksheet below. ps. I hope forum manager does not delete this question.

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1838 and is the same as the version installed in this computer, created 2024, December 2, 10:11 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

 

Example 1: order of status from odetest is not same as order of input

 

ode:=1+x*y(x)*(1+y(x)^2*x)*diff(y(x),x) = 0:
IC:=y(1) = 0:
sol:=x = 1/(3*exp(y(x)^2/2) - y(x)^2 - 2);

x = 1/(3*exp((1/2)*y(x)^2)-y(x)^2-2)

#we see that odetest verifies the ode
odetest(sol,ode)

0

#but when adding IC, 0 is now in second entry, instead of first

odetest(sol,[ode,IC])

[(y(x)^4-y(x)^2*y(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))*(D(y))(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))+y(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))^3*(D(y))(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))-6*y(x)^2*exp((1/2)*y(x)^2)+3*exp((1/2)*y(x)^2)*y(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))*(D(y))(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))+4*y(x)^2-2*y(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))*(D(y))(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))+9*exp(y(x)^2)-12*exp((1/2)*y(x)^2)+4)/(y(x)^2-3*exp((1/2)*y(x)^2)+2)^2, 0]

#SHOULD NOT zero above be in first slot in the list instead of second slot??

 

 

Example 2. We must write the solution using (lhs-rhs)(sol)=0

 

restart;

ode:=1+x*y(x)*(1+y(x)^2*x)*diff(y(x),x) = 0:
IC:=y(1) = 0:
sol:=x = 1/(3*exp(y(x)^2/2) - y(x)^2 - 2);

x = 1/(3*exp((1/2)*y(x)^2)-y(x)^2-2)

odetest((lhs-rhs)(sol)=0,[ode,IC])

[0, 0]

#we see that now it verified both IC and sol

 

 

 

 

Download issues_with_odetest_dec_16_2024.mw

I have a matrix for data analysis that I want to plot. Ideally, I would like to use Maple, but I’m struggling to create a well-designed plot suitable for submission to journals. Because of this, I’m considering transferring the data to Excel or constructing a 3D graph using MATLAB.

My question is: how can I transfer this data to Excel? The data is currently saved as a Notepad file, but I’m unsure how to convert it into an Excel format. I will upload a figure to show the data structure.

also in last runig program give me error which is (Error, (in ExportMatrix) permission denied

Thank you in advance for any help!

restart;

randomize():

local gamma;

gamma

(1)
 

T3 := (B[1]*(tanh(2*n^2*(delta^2-w)*k*t/((k*n-1)*(k*n+1))+x)-1))^(1/(2*n))*exp(I*(-k*x+w*t+delta*W(t)-delta^2*t))

(B[1]*(tanh(2*n^2*(delta^2-w)*k*t/((k*n-1)*(k*n+1))+x)-1))^((1/2)/n)*exp(I*(-k*x+w*t+delta*W(t)-delta^2*t))

(2)

``

params := {B[1]=1,n=2,delta=1,w=1,k=3 };

{delta = 1, k = 3, n = 2, w = 1, B[1] = 1}

(3)

``

insert numerical values

solnum :=subs(params, T3);

(tanh(x)-1)^(1/4)*exp(I*(-3*x+W(t)))

(4)

CodeGeneration['Matlab']('(tanh(x)-1)^(1/4)*exp(I*(-3*x+W(t)))')

Warning, the function names {W} are not recognized in the target language

 

cg = ((tanh(x) - 0.1e1) ^ (0.1e1 / 0.4e1)) * exp(i * (-0.3e1 * x + W(t)));

 

N := 100:

use Finance in:
  Wiener := WienerProcess():
  P := PathPlot(Wiener(t), t = 0..10, timesteps = N, replications = 1):
end use:

W__points := plottools:-getdata(P)[1, -1]:
t_grid := convert(W__points[..,1], list):
x_grid := [seq(-2..2, 4/N)]:

T, X := map(mul, [selectremove(has, [op(expand(solnum))], t)])[]:

ST := unapply(eval(T, W(t)=w), w)~(W__points[.., 2]):
SX := evalf(unapply(X, x)~(x_grid)):

STX := Matrix(N$2, (it, ix) -> ST[it]*SX[ix]);

_rtable[36893489786521178348]

(5)

opts := axis[1]=[tickmarks=[seq(k=nprintf("%1.1f", t_grid[k]), k=1..N, 40)]],
        axis[2]=[tickmarks=[seq(k=nprintf("%1.1f", x_grid[k]), k=1..N, 40)]],
        style=surface:

DocumentTools:-Tabulate(
  [
    plots:-matrixplot(Re~(STX), opts),
    plots:-matrixplot(Im~(STX), opts),
plots:-matrixplot(abs~(STX), opts)
  ]
  , width=60
)

"Tabulate"

(6)

MatlabFile := cat(currentdir(), "/ST2.txt"); ExportMatrix(MatlabFile, STX, target = MATLAB, format = rectangular, mode = ascii, format = entries)

Error, (in ExportMatrix) permission denied

 
 

 

Download data-analysis.mw

Hi!  I am trying to calculate a complex integral.  To double check my work, I directly coded the calculation.  The result is that the two results don't match.  Have I done something wrong?

here is the file

Complex_valued_integrals.mw

It's becoming increasingly common for questions to be deleted, the most frequently evoked argument being that they duplicate earlier questions.
Usually it's the author of the question who complains, in this case it's the one who provided an answer.

I've always found this self-given freedom on the part of moderators somewhat inappropriate, especially given that these deletions are done on the sly, without even the courage to be explicitly claimed by their authors.

Couldn't these latter take the time to leave a message indicating what they've just done (and why) and where the deleted question, and any exchanges associated with it, can be found?
Otherwise, this attitude is more akin to contempt and censorship than to real management of this blog.

A few years ago, when I came to this site, these deletions were the exception and I can only deplore the fact that they have become commonplace.
They say that life is better elsewhere, I don't know, but what I do know is that I've never come across this on any Scilab, R, SageMath or OpenTurns user's blog.

Anyway, here's the reply I sent to @salim-barzani :  Hirota_derivative_KdV_equation.mw

Is it possible to configure newer maple versions to use a different file extension ?

I have a lot of  Maple 9 files  with .mw extension. I dont want them opened and saved by a later version as they are valuable and actually work better than later maple versions which throws unneccesary signum errors. The results are verified so the signum errors are bogus in the recent maple versions running the same file.

Particularly, can I configure e.g. Maple 2022 to save to a different file extension say .mww or similar rather than .mw so I can avoid destroying to original 9.5 files?

Hi everyone!  I'm trying to study a certain function.  The output says that, from -5 to 5, the output is undefined.  Am I doing something wrong?

Thanks in advance.

range_not_undefined.mw

Dear friends,

I need a procedure to classify a list of polynomials by their leading monomials. For example, if F = [x^2 - y - 1, y^2 - y, x^2 - 4, y^3 - 1, z^2 - 4] and a < be the lex ordering s.t. z<y<x, it should return [[x^2 - y - 1, x^2 - 4], [y^3 - y, y^3 - 1], [z^2 - 4]]. 

I appreciate any help you can provide.

Sincerely,

A gardener wants to spread 25 roses over an area so that there are 5 roses in each of 15 straight rows. The roses should be arranged rotationally symmetrically so that more than 3/4 of them are less than half as far from the center of symmetry as the outermost ones and that the center of symmetry itself remains unplanted. How is such an arrangement possible?

What is the correct syntax to do this change of variable from the text book:

The problem is that using PDEtools:-dchange, it wants the transformation to have form { old = new}, i.e. x=...  so I can not write  z=g(x) in the transformation. 

For example

ode:= diff(y(x),x$2)+diff(y(x),x)+y(x)=sin(x);
PDEtools:-dchange({z= g(x)},ode,known={x},unknown={z});

Error, (in dchange/info) missing a list with the new variables
And if I first solve for x so that I can write the transformation with x on left side, it still does not work

ode:= diff(y(x),x$2)+diff(y(x),x)+y(x)=sin(x);
PDEtools:-dchange({x=RootOf(g(_Z) - z)},ode,known={x},unknown={z});

Where RootOf(g(_Z) - z) was result of solve(z=g(x),x);

I am sure this can be done in Maple, I just do not know the right syntax to use with dchange.

Maple 2024.2

First 46 47 48 49 50 51 52 Last Page 48 of 2425