MaplePrimes Questions

Hi got this set of error using the Plot package. Anyone here know what they mean? 

Given any arbitrary function, say... cos(3t)+2sin(2t-3)

How can I generate data from said funciton. Precisely, I want to generat the dataset

t         value

0.1      value1
0.2      value2
...

10.0    value(@t=10)

Surely there has to be some easy way to do this but I cannot seem to find it. the plottool:-getdata does not seem to be able to export the data in the desired t increments.

The following example shows clearly that timelimit is still broken in Maple.

I tried this 10 times, and it hangs each time. I could wait 30 minutes and it still hangs. timelimit simply does not work. I set timelimit to 20 or 30 seconds.  This really makes developing software in Maple very difficult when timelimit itself hangs as it means the whole program comes to halt and becomes frozen and I see no workaround this problem.

 

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

restart;

ode:=1/2*sqrt((diff(y(x), x) - sqrt(-a^2*(a - b)*(a + b))/a^2)^2 + 2*sqrt(-a^2*(a - b)*(a + b))*(diff(y(x), x) - sqrt(-a^2*(a - b)*(a + b))/a^2)/a^2 + b^2/a^2)/a - 1/2*b^2*ln((2*b^2/a^2 + 2*sqrt(-a^2*(a - b)*(a + b))*(diff(y(x), x) - sqrt(-a^2*(a - b)*(a + b))/a^2)/a^2 + 2*sqrt(b^2/a^2)*sqrt((diff(y(x), x) - sqrt(-a^2*(a - b)*(a + b))/a^2)^2 + 2*sqrt(-a^2*(a - b)*(a + b))*(diff(y(x), x) - sqrt(-a^2*(a - b)*(a + b))/a^2)/a^2 + b^2/a^2))/(diff(y(x), x) - sqrt(-a^2*(a - b)*(a + b))/a^2))/(a^3*sqrt(b^2/a^2)) + 1/2*sqrt((diff(y(x), x) + sqrt(-a^2*(a - b)*(a + b))/a^2)^2 - 2*sqrt(-a^2*(a - b)*(a + b))*(diff(y(x), x) + sqrt(-a^2*(a - b)*(a + b))/a^2)/a^2 + b^2/a^2)/a - 1/2*b^2*ln((2*b^2/a^2 - 2*sqrt(-a^2*(a - b)*(a + b))*(diff(y(x), x) + sqrt(-a^2*(a - b)*(a + b))/a^2)/a^2 + 2*sqrt(b^2/a^2)*sqrt((diff(y(x), x) + sqrt(-a^2*(a - b)*(a + b))/a^2)^2 - 2*sqrt(-a^2*(a - b)*(a + b))*(diff(y(x), x) + sqrt(-a^2*(a - b)*(a + b))/a^2)/a^2 + b^2/a^2))/(diff(y(x), x) + sqrt(-a^2*(a - b)*(a + b))/a^2))/(a^3*sqrt(b^2/a^2)) - 1/2*b*ln(a^2*diff(y(x), x)^2 + a^2 - b^2)/a^2 - y(x) - _C1 = 0:

try
  print("Before calling timelimt on odeadvisor");
  timelimit(20,DEtools:-odeadvisor(ode,y(x)));
  print("Did not time out");
catch:
  print("TIMED OUT");
end try;

"Before calling timelimt on odeadvisor"

 


 

Does this hang on your version of Maple? I am using 2022.2 on windows 10.

I was hoping this problem with timelimit has finally been fixed in Maple 2022.2. From this post almost 2 years ago!  it says

"You will also be pleased to know that Maple 2021 addresses the timelimit() issue that you mentioned."

But it is clearly not yet fixed.

 

Some important observations

1) sometimes I noticed if timelimit is small (say 5 or 10), it does not hang. So it the above does timeout for you, please try with larger time out, say 40 or 60 seconds. Since it depens on how fast the PC is.

2)sometimes I  noticed if I close Maple and start new sesstion, the very first time it could timeout OK, but the second time it is called, it hangs. May be because the server caches something to cause this.

All this means, it is completely not predictable what wil happen when starting the maple run. I have no idea how long it will take from one time to another, or even if it will hang or not. For all the years I used Maple, I never had one single time where one run completed without having to restart it at least 2 or 3 times in order to reach the finish line.  This is in addition to all those server.exe crashing on its own many times in between. I noticed more and more of these in Maple 2022.2.  But that is for another topic.

The following screen shot showing one instance when I run the above timelimit (been wainting now for 15 minutes, using timeout of 30 second)., It shows Maple server taking 81% of the CPU

 

And the following is screen shot of the worksheet itself when I took the above screen shot

 

Download timelimit_hangs_on_odeadvisor.mw

 

 

Maple offers the dimension “lenght” whereas MapleSim offers two types.

What is the difference between the two types length and distance?

Can they always be used interchangeably?

Hello community. I'm trying to use Maple for some study.
My goal is to get the Wiener-Hopf equation in matrix form like in the book (eq 3.56).
So at first i need the gradient of eq 3.53, the result is eq 3.55 (nabla is not printed) .
Could you please provide an example of this operation, if it is possible, thanks.


_local(D);
f := (x, y) -> 3*x^2 - 3*y*x + 6*y^2 - 6*x + 7*y - 9;
coeffs(f(x, y));
A, B, C, D, E, F := %;
theta := 1/2*arctan(B/(A - C));
solve({-2*A*xc - B*yc = D, -B*xc - 2*C*yc = E});
assign(%);
x := xcan*cos(theta) - ycan*sin(theta) + xc;
y := xcan*sin(theta) + ycan*cos(theta) + yc;
Eq := simplify(expand(f(x, y)));
xcan^2/simplify(sqrt(-tcoeff(Eq)/coeff(Eq, xcan^2)))^`2` + ycan^2/simplify(sqrt(-tcoeff(Eq)/coeff(Eq, ycan^2)))^`2` = 1;
a := sqrt(-tcoeff(Eq)/coeff(Eq, xcan^2));
b := sqrt(-tcoeff(Eq)/coeff(Eq, ycan^2));
c := sqrt(a^2 - b^2);
F1 := [xc + c*cos(theta), yc + c*sin(theta)];
evalf(%);
F1 := [xc - c*cos(theta), yc - c*sin(theta)];
evalf(%);
Points := pointplot([F1[], F2[]], symbol = solidcircle, color = [red], symbolsize = 6);
xcan := plot(yc + tan(theta)*('x' - xc), 'x' = -2 .. 3.5, color = black);
ycan := plot(yc - ('x' - xc)/tan(theta), 'x' = 0.1 .. 1.5, color = black);
Ellipse := plots[implicitplot](f('x', 'y'), 'x' = -2 .. 3.5, 'y' = -2 .. 1.5, color = red, thickness = 2, gridrefine = 5);
labels := plots[textplot]([[0.4, 1.3, "ycan"], [3.2, 0.75, "xcan"]], font = [TIMES, ROMAN, 14]);
plots[display](xcan, ycan, Points, Ellipse, labels, scaling = constrained);

I do not why I get this message:

Error, (in plots:-display) expecting plot structure but received: pointplot([17/21-(2/21)*(1407/(-(3/2)*2^(1/2)+9/2)-1407/((3/2)*2^(1/2)+9/2))^(1/2)*cos((1/8)*Pi), -8/21-(2/21)*(1407/(-(3/2)*2^(1/2)+9/2)-1407/((3/2)*2^(1/2)+9/2))^(1/2)*sin((1/8)*Pi), F2[]], symbol = solidcircle, color = [red], symbolsize = 6) NULL;

Thank you for your help.
 

I have an expression and I want to find its maximum value.

expr:=sin(sqrt(3)*t)*cos(sqrt(3)*t)*(sqrt(3)*cos(sqrt(3)*t) - sin(sqrt(3)*t))/3

It is easy to find its maximum value in a numerical form.

Optimization:-Maximize(sin(sqrt(3)*t)*cos(sqrt(3)*t)*(sqrt(3)*cos(sqrt(3)*t) - sin(sqrt(3)*t))/3)

[0.324263244248023330, [t = 1.39084587050767]]

The images of the expression is as follows.

 

But does it exist an acceptable maximum value in symbolic form?  As the function maximize seems to take a lot of time, I don't see any hope so far. Perhaps the expression is indeed complex.

maximize(expr)# it runs long time.

We try to find the derivative of expr and get some points where thier derivatives are 0.

s:=[solve(diff(expr,t),t)]
evalf~(s) # Some solutions seem to have been left out.

[0.7607468963 + 0.*I, -0.4229534936 - 0.*I, 0.2668063857 + 0.*I]

ex:=convert(expr,exp):
s:=[solve(diff(ex,t)=0,t)]:
s1:=evalf~(s);# choose the 6th item: 1.390845877 + (4.655829150*10^(-9))*I
fexpr := unapply(ex, t);
evalf(fexpr(s1[6]));
fexpr (s[6]); # a very long expression that is not quite acceptable.

-I/6*(-sqrt(-(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)*((1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3)*sqrt(3)*I - 2*I*sqrt(3)*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) + (1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3) + 36*I*sqrt(3) + 2*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) - 44))/(6*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)) + 6*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)/sqrt(-(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)*((1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3)*sqrt(3)*I - 2*I*sqrt(3)*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) + (1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3) + 36*I*sqrt(3) + 2*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) - 44)))*(-sqrt(-(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)*((1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3)*sqrt(3)*I - 2*I*sqrt(3)*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) + (1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3) + 36*I*sqrt(3) + 2*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) - 44))/(12*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)) - 3*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)/sqrt(-(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)*((1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3)*sqrt(3)*I - 2*I*sqrt(3)*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) + (1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3) + 36*I*sqrt(3) + 2*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) - 44)))*(sqrt(3)*(-sqrt(-(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)*((1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3)*sqrt(3)*I - 2*I*sqrt(3)*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) + (1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3) + 36*I*sqrt(3) + 2*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) - 44))/(12*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)) - 3*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)/sqrt(-(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)*((1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3)*sqrt(3)*I - 2*I*sqrt(3)*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) + (1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3) + 36*I*sqrt(3) + 2*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) - 44))) + (-sqrt(-(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)*((1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3)*sqrt(3)*I - 2*I*sqrt(3)*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) + (1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3) + 36*I*sqrt(3) + 2*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) - 44))/(6*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)) + 6*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)/sqrt(-(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3)*((1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3)*sqrt(3)*I - 2*I*sqrt(3)*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) + (1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(2/3) + 36*I*sqrt(3) + 2*(1404*I*sqrt(3) - 1396 + 36*sqrt(-3018 - 3018*I*sqrt(3)))^(1/3) - 44)))*I/2)

An interesting problem is that an acceptably concise expression (although it is very subjective) for the maximum value may not exist mathematically. But knowing this in advance is difficult.

Download compute_zlc.mw

During my reaserch on diffusion I am arrived at the integral with argument

exp(-1/sqrt(x^2 + 1)) which Maple is not able to solve.

If some experts in solving integrals is able to solve it please keep me informed.

The file in Maple 2022 is below

primes_integral_diffusion.mw

Hello everyone!

I use this procedure to open my inbox:

>restart;
ShellExecute := define_external('ShellExecuteA', hwnd::(integer[4]), lpOperation::string, lpFile::string, lpParameters::string, lpDirectory::string, nShowCmd::integer[4], 'RETURN'::integer[4], LIB = "C:\\WINDOWS\\SYSTEM32\\shell32.dll"):
OpenBrowser := proc(someURL::string := "http://")

ShellExecute(0, " ", someURL, " ", " ", 1); NULL;

end proc:

Case 1:  I entered the correct email address of my friend who sent me the mail

>OpenBrowser("https://mail.google.com/mail/u/0/?tab=rm&ogbl#inbox/xxxxxxGqRZXPKXGzrrSrfHscdNWspRJF");

As a result, the content of the message I received was opened with full information.

Case 2:  When I enter an arbitrary email address that is not my friend, the result is that no content is displayed.

>OpenBrowser("https://mail.google.com/mail/u/0/?tab=rm&ogbl#inbox/yyyyyyGqRZXPKXGzrrSrfHscdNWspRJf");

On the email there is only the message: The conversation you requested could not be loaded.

May I ask:  Is there any Maple command to return true in case 1 and to return false in case 2 ?

Thank you very much for your help !

Procedure returns two values. I would like to print a comment after them if possible, without it being a returned value


foo := proc(a, b) 
local x, y; 
x := a^2 - b; 
y := b^2 - a; 
# return x,y, "test on foo"  # returns 3 values
return x, y, print(" tests on return"); end proc;

A, B := foo(6, 3);
                       " tests on return"

                         A, B := 33, 3  #would like "tests on return here"

 

Dear Users!
I hope are fine here. I got the following expression after a lot of computations

((1/2)*r*(r-1)+(1/6)*r*(r-1)*(r-2))*`Δy`[-1]^3+(1/2)*r*(r-1)*`Δy`[-1]^2+(1/120)*r*(r-1)*(r-2)*(r-3)*(r-4)*`Δy`[-2]^7+((1/6)*r*(r-1)*(r-2)+(1/12)*r*(r-1)*(r-2)*(r-3)+(1/120)*r*(r-1)*(r-2)*(r-3)*(r-4))*`Δy`[-2]^5+((1/6)*r*(r-1)*(r-2)+(1/24)*r*(r-1)*(r-2)*(r-3))*`Δy`[-2]^4+((1/24)*r*(r-1)*(r-2)*(r-3)+(1/60)*r*(r-1)*(r-2)*(r-3)*(r-4))*`Δy`[-3]^7+((1/24)*r*(r-1)*(r-2)*(r-3)+(1/60)*r*(r-1)*(r-2)*(r-3)*(r-4))*`Δy`[-3]^6+r*`Δy`[0]+y[0]

Actually, for the above, I want the factorization of each coefficient of `Δy`[0], `Δy`[-1], `Δy`[-2] etc and the above expression shoud be in descending order given as:

y[0]+r*`Δy`[0]+(1/2)*r*(r-1)*`Δy`[-1]^2+(1/6)*r*(r-1)*(1+r)*`Δy`[-1]^3+(1/24)*r*(r-1)*(r-2)*(1+r)*`Δy`[-2]^4+(1/120)*r*(r-1)*(r-2)*(r+2)*(1+r)*`Δy`[-2]^5+(1/120)*r*(r-1)*(r-2)*(r-3)*(r-4)*`Δy`[-2]^7+(1/120)*r*(r-1)*(r-2)*(r-3)*(-3+2*r)*`Δy`[-3]^6+(1/120)*r*(r-1)*(r-2)*(r-3)*(-3+2*r)*`Δy`[-3]^7

I am waiting for your positive response. Thanks

I was trying New-Display-Of-Arbitrary-Constants-And-Functions- but found a small problem.

in my code I build the constants of integrations using parse("_C"||N); where N is an integer that can go up to as many constants of integration are needed. For example, for 4th order ode, there will be 4 of them.

I noticed only the first 2 come out using the nice c__1,c__2 notation, but anything after 2 ,they come out using old notation _C3, _C4.

Here is a MWE

restart;

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1346 and is the same as the version installed in this computer, created 2022, October 7, 13:4 hours Pacific Time.`

restart;

dsolve(diff(y(x),x)=1,arbitraryconstants=subscripted);
pdsolve(diff(psi(x,t),x$2)=0,arbitraryfunctions=subscripted);

y(x) = x+c__1

psi(x, t) = f__1(t)*x+f__2(t)

_C1

c__1

for N from 1 to 4 do
    parse("_C"||N);
od;

c__1

c__2

_C3

_C4

 


So now my solution comes out with mixed looking constants. Why does this happen for N>2?

Download problem_with_C.mw

So for now, I went back to using the old method of using alias as follows

restart;

alias(seq(c[k] = _C||k, k = 0..10)):

_C1

c[1]

for N from 1 to 4 do
    parse("_C"||N);
od;

c[1]

c[2]

c[3]

c[4]

 

Download problem_with_C_alias.mw

Strange behavior. I don't know if this can be made to work.  I replaced an equation with an interpolation object, f(x).

tInt := int(f, 133  .. 134, numeric);
tInt := 324.95206944305  <= Computes a result. I

tInt := int(f, 133  .. 312, numeric);
tInt:= int(fproc, 133. .. 312.) <= Won't compute it. The interpolation object has 3051 points, so that's not the problem. The name "fproc" is not something I have in my  code, just the name, "f".

If I try to make the  integral just slightly more complex by  passing a variable in, it doesn't work at all. This was to see if I could integrate with a varying divisor: f(x)/(x+1)
int(f(x), x = 133 .. 134, numeric); 

Error, (in int) wrong number (or type) of arguments: invalid options or option values passed to definite integration. <=

A fallback  was to use summation, but that doesn't work at all, same typ of error as the Error for int. (Not shown.)

So my fallback is to use a for loop to sum the set. The for loops produce another set of values, and I think I have to make interpolation objects for that as well. And so on. I really  was expecting  Maple to handle this better.

When I try to change the number format (decimal places) of a sequence in Maple Flow using the right hand slide out context panel all numbers in the sequence are replaced by only the first number in the sequence.  I'm not sure if it has been fixed in 2022.1

Before the adjustment ...  

Selecting fixed prompts the result to stop after the first number in the series.

 

Can anyone else confirm this issue?

conjcl := proc(k, p, n) local t, L, q; L := []; t := 0; q := p^n - 1; while k*p^t <> k mod q do t := t + 1; L := [op(L), t mod q]; end do; return L; end proc

I'm fairly new to coding with Maple / in general, but basically for my course I need to do the following:
For each t=0,1,... I need to first check if kp^t = k mod (p^n-1), and if it isn't, I compute t mod (p^n-1) then add it to my list. The problem I have is I just can't seem to get it to work. I incliuded both the screenshot of the code and typed it out. Thanks in advance

First 142 143 144 145 146 147 148 Last Page 144 of 2308