MaplePrimes Questions

I want to test how well Maple's numeric solver respects a variety of conservation laws. To do so, I must numerically integrate a numerical derivative; however, every method I've tried using does not work. In essence, I need the following code to work.

restart;
with(PDEtools); with(plots); with(DEtools);
pde := diff(v(x, t), t, t) = diff(v(x, t), x, x);
f := xi -> exp(-xi^2);
a := -10; b := 10; dx := 1/50; t_final := 10;

pds := pdsolve(pde, {v(a, t) = 0, v(b, t) = 0, v(x, 0) = f(x + 5), D[2](v)(x, 0) = -eval(diff(f(x), x), x = x + 5)}, numeric, range = a .. b, time = t, spacestep = dx);

sol_proc := rhs(pds:-value(output = listprocedure)[3]);
sol := (x, t) -> piecewise(a < x and x < b, sol_proc(x, t), 0);
int(fdiff(sol(x, t), [t = 0]), a .. b);

Error, (in depends) too many levels of recursion

Verification_24_09_2024.mw

In the attached file, in the subsection named #Transmittance calculation I had an issue with the absolute value calculation. The calculation in the first part for the expression a1 was carried out although with addition of some strange t parameter in the exponent power. The second one just didn`t. I will be more than grateful for some help and advice. In addition, I have been struggling with that for a long time so if you have in mind some book or youtube lesson that clarifies all of that I will be more than happy. Nothing valuable was found on the web so far :(

The result of the function was computed successfully using the proc function, but how to plot the computed image? Using the seq command but the step size can not get the desired, using the for loop is too cumbersome, what should be done?fuxian.mwfuxian.mw

Hi everyone, I buy a new laptop with high resolution (2560x1600), I wanna zoom in the size of toolbar (like the icon size of File, Edit, View,......). I modify the fontsize, so for well-proportioned I wanna modify the icon size but I failed.


 

How can I make some triangles in a bigger triangle knowing its perimeters like this picture?

Hello everyone,

I successfully plotted the intersection point of two linear equations using a matrix-based approach. Still, I’m facing an issue when trying to achieve the same result using the second method — solving the system symbolically and plotting without matrices.

The Matrix-Based Approach (Working): I used the following steps to plot both equations and mark the intersection point (solution). However, when I switch to solving the system symbolically without matrices, I can plot the two lines, but I'm unable to plot the intersection point correctly.

It seems that the symbolic solution isn't being properly converted to a numeric form for pointplot, even though I’m using evalf.

Any help would be greatly appreciated!

Download Linear_System.mw

Hi,
How can I remove the mentioned error in attached worksheet?

s1.mw

I was wondering if there is a way to measure/extract the contact forces that occur during a contact event? Preferably I would like to visualize the contact forces in the 3D result view.

I would also like to extract information about slippage in a contact.

Is this somehow possible?

The EKHAD package from the book A=B (https://www2.math.upenn.edu/~wilf/AeqB.html) contains many effective algorithms. I want to use one of them in Maple, but I have troubles with the command `read`.

I saved the file from this link: https://sites.math.rutgers.edu/~zeilberg/tokhniot/EKHAD and followed the instructions at the beggining:
    #######################################################################
    ## EKHAD: Save this file as EKHAD. To use it, stay in the             #
    ## same directory, get into Maple (by typing: maple <Enter> )         #
    ## and then type:  read EKHAD : <Enter>                               #
    ## Then follow the instructions given there                           #
    ##                                                                    #
    ## Written by Doron Zeilberger, Rutgers University ,                  #
    ##  zeilberg@math.rutgers.edu.                                        # 
    #######################################################################

 After running the EKHAD file, I got:

     Last update: April 26, 2018, thanks to Daniel G. DuParc

       Previous updates:   Dec. 11, 2015 (adding procedures AZdI, 

        AZcI ); May 30, 2015 (adding procedure TerryTao )


                  May 29, 2014 (adding Ekhad )

              Version of July 2003: adapted to Maple 8 and 9 

                   Many thanks to Drew Sills

         In the penultimate Version of Feb 25, 1999 a suggestion

         of Frederic Chyzak was used, with considerable 

                speed-up. We thank him SO MUCH!


             The penpenultimate version, Feb. 1997,

      corrected a subtle bug discovered by Helmut Prodinger


           Previous versions benefited from comments by Paula Cohen, 

                 Lyle Ramshaw, and Bob Sulanke.


            This is EKHAD, One of the Maple packages

                     accompanying the book 

                             "A=B" 

          (published by A.K. Peters, Wellesley, 1996) 

      by Marko Petkovsek, Herb Wilf, and Doron Zeilberger.


        The most current version is available on WWW at:

            http://www.math.rutgers.edu/~zeilberg .

       Information about the book, and how to order it, can be found in

       http://www.central.cis.upenn.edu/~wilf/AeqB.html .

     Please report all bugs to: zeilberg@math.rutgers.edu .

            All bugs or other comments used will be acknowledged in future

                           versions.


    For general help, and a list of the available functions,

     type "ezra();". For specific help type "ezra(procedure_name)" 

           NULL;
 

Then I opened new document in same directory as in instructions and typed `read EKHAD.mw`, but I got the following error:


Error, on line %1, syntax error, character `?` unexpected:
<?xml version="1.0" encoding="UTF-8"?>
 ^

Error, while reading `%1`


I don't know what this error means and how to fix it. For both errors, after clicking on them, It sends me to the website where it says:

There is no help page available for this error

Sorry, we do not have specific information about your error. 

Thank you very much for your help. 

restart;
with(plots);
A := [0, 0];
B := [4, 2];
C := [2, 3];
distance := proc(P1, P2) sqrt((P1[1] - P2[1])^2 + (P1[2] - P2[2])^2); end proc;
plot_triangle := proc(A, B, C) plot([A, B, C, A], style = line, color = black, thickness = 2); end proc;
plot_bisectors := proc(A, B, C) local AB, BC, CA, AB_bisector, BC_bisector, CA_bisector, i; AB := [A, B]; BC := [B, C]; CA := [C, A]; AB_bisector := [seq(A[i] + t*(B[i] - A[i]), i = 1 .. 2)]; BC_bisector := [seq(B[i] + t*(C[i] - B[i]), i = 1 .. 2)]; CA_bisector := [seq(C[i] + t*(A[i] - C[i]), i = 1 .. 2)]; plot([AB_bisector, BC_bisector, CA_bisector], t = 0 .. 1, style = line, color = blue, thickness = 2); end proc;
plot_apollonius := proc(A, B, C, ratio) local f, g; f := (x, y) -> sqrt((x - A[1])^2 + (y - A[2])^2)/sqrt((x - B[1])^2 + (y - B[2])^2) - ratio; g := implicitplot(f(x, y), x = -5 .. 5, y = -5 .. 5, grid = [100, 100], style = line, color = red, thickness = 2); g; end proc;
plot_inscribed_circle := proc(A, B, C) local a, b, c, s, r, Ii; a := distance(B, C); b := distance(A, C); c := distance(A, B); s := 1/2*a + 1/2*b + 1/2*c; r := sqrt((s - a)*(s - b)*(s - c)/s); Ii := [(a*A[1] + b*B[1] + c*C[1])/(a + b + c), (a*A[2] + b*B[2] + c*C[2])/(a + b + c)]; plot(circle(Ii, r), style = line, color = green, thickness = 2); end proc;
plot_exscribed_circles := proc(A, B, C) local a, b, c, s, rA, rB, rC, IA, IB, IC; a := distance(B, C); b := distance(A, C); c := distance(A, B); s := 1/2*a + 1/2*b + 1/2*c; rA := sqrt((s - b)*(s - c)*s/(s - a)); rB := sqrt((s - a)*(s - c)*s/(s - b)); rC := sqrt((s - a)*(s - b)*s/(s - c)); IA := [(a*A[1] - b*B[1] + c*C[1])/(a - b + c), (a*A[2] - b*B[2] + c*C[2])/(a - b + c)]; IB := [(a*A[1] + b*B[1] - c*C[1])/(a + b - c), (a*A[2] + b*B[2] - c*C[2])/(a + b - c)]; IC := [(-a*A[1] + b*B[1] + c*C[1])/(-a + b + c), (-a*A[2] + b*B[2] + c*C[2])/(-a + b + c)]; plot([circle(IA, rA), circle(IB, rB), circle(IC, rC)], style = line, color = magenta, thickness = 2); end proc;
with(geometry);
point(A1, 0, 0);
point(B1, 4, 2);
point(C1, 2, 3);
tx := textplot([[coordinates(A1)[], "A"], [coordinates(B1)[], "B"], [coordinates(C1)[], "C"]], font = [times, bold, 16], align = [above, left]);
triangle_plot := plot_triangle(A, B, C);
restart;
with(plots);
A := [0, 0];
B := [4, 2];
C := [2, 3];
distance := proc(P1, P2) sqrt((P1[1] - P2[1])^2 + (P1[2] - P2[2])^2); end proc;
plot_triangle := proc(A, B, C) plot([A, B, C, A], style = line, color = black, thickness = 2); end proc;
plot_bisectors := proc(A, B, C) local AB, BC, CA, AB_bisector, BC_bisector, CA_bisector, i; AB := [A, B]; BC := [B, C]; CA := [C, A]; AB_bisector := [seq(A[i] + t*(B[i] - A[i]), i = 1 .. 2)]; BC_bisector := [seq(B[i] + t*(C[i] - B[i]), i = 1 .. 2)]; CA_bisector := [seq(C[i] + t*(A[i] - C[i]), i = 1 .. 2)]; plot([AB_bisector, BC_bisector, CA_bisector], t = 0 .. 1, style = line, color = blue, thickness = 2); end proc;
plot_apollonius := proc(A, B, C, ratio) local f, g; f := (x, y) -> sqrt((x - A[1])^2 + (y - A[2])^2)/sqrt((x - B[1])^2 + (y - B[2])^2) - ratio; g := implicitplot(f(x, y), x = -5 .. 5, y = -5 .. 5, grid = [100, 100], style = line, color = red, thickness = 2); g; end proc;
plot_inscribed_circle := proc(A, B, C) local a, b, c, s, r, Ii; a := distance(B, C); b := distance(A, C); c := distance(A, B); s := 1/2*a + 1/2*b + 1/2*c; r := sqrt((s - a)*(s - b)*(s - c)/s); Ii := [(a*A[1] + b*B[1] + c*C[1])/(a + b + c), (a*A[2] + b*B[2] + c*C[2])/(a + b + c)]; plot(circle(Ii, r), style = line, color = green, thickness = 2); end proc;
plot_exscribed_circles := proc(A, B, C) local a, b, c, s, rA, rB, rC, IA, IB, IC; a := distance(B, C); b := distance(A, C); c := distance(A, B); s := 1/2*a + 1/2*b + 1/2*c; rA := sqrt((s - b)*(s - c)*s/(s - a)); rB := sqrt((s - a)*(s - c)*s/(s - b)); rC := sqrt((s - a)*(s - b)*s/(s - c)); IA := [(a*A[1] - b*B[1] + c*C[1])/(a - b + c), (a*A[2] - b*B[2] + c*C[2])/(a - b + c)]; IB := [(a*A[1] + b*B[1] - c*C[1])/(a + b - c), (a*A[2] + b*B[2] - c*C[2])/(a + b - c)]; IC := [(-a*A[1] + b*B[1] + c*C[1])/(-a + b + c), (-a*A[2] + b*B[2] + c*C[2])/(-a + b + c)]; plot([circle(IA, rA), circle(IB, rB), circle(IC, rC)], style = line, color = magenta, thickness = 2); end proc;
with(geometry);
point(A1, 0, 0);
point(B1, 4, 2);
point(C1, 2, 3);
tx := textplot([[coordinates(A1)[], "A"], [coordinates(B1)[], "B"], [coordinates(C1)[], "C"]], font = [times, bold, 16], align = [above, left]);
triangle_plot := plot_triangle(A, B, C);
bisectors_plot := plot_bisectors(A, B, C);
apollonius_plot := plot_apollonius(A, B, C, 1);
with(geometry);
inscribed_circle_plot := plot_inscribed_circle(A, B, C);
exscribed_circles_plot := plot_exscribed_circles(A, B, C);
display(triangle_plot, tx, bisectors_plot, apollonius_plot, axes = none, scaling = constrained, title = "Triangle with Bisectors, Apollonius Hyperbola, and Circles");
Error, (in plot) cannot determine plotting variable
Error, (in plot) cannot determine plotting variable
Warning, data could not be converted to float Matrix
Can you tel why these errors mean ? Thank you.
 

On my journey of discovery in the Maple world, which is new to me, I have now looked at the linear algebra packages. I am less interested in numerics than in symbolic calculations using matrices. I would like to illustrate this with the following task:

Let A be any regular (n; n) matrix over the real numbers for natural n. The regular (n; n) matrix X that solves the equation

X - A^(-1)*X*A = 0 for each A is to be determined. In this, A^(-1) is the inverse of A. Is there perhaps a symbolic solution for a specifically chosen n?

The solution to this old exercise is known. X is every real multiple of the unit/identity matrix, i.e. the main diagonal is occupied by a constant and all other matrix elements are zero.

Hi everyone, maybe this question is a picky cause handling with such issue is much more suitable for GeoGebra but I just wanna try. I wanna the output figure like below (NVM the sequence of pointname). As for my Maple output, I wanna: the vertex names and vertices should not overlap, keep a little distance to make it more beautiful. Moreover, how to color the planar BDD_1B_1 graph?


The below is Maple code:

NULL

with(plots); with(plottools)

display(cuboid([0, 0, 0], [1, 1, 1]), transparency = .6, scaling = constrained, size = [200, 200], axes = boxed, orientation = [-54, 78, 5], tickmarks = [0, 0, 0])

 

p1 := display(line([0, 0, 0], [1, 1, 1]), axes = boxed, color = black, linestyle = dash, orientation = [-54, 78, 5], scaling = constrained, size = [200, 200], tickmarks = [0, 0, 0])

 

Pointsname := textplot3d({[0, 0, 0, A], [0, 0, 1, A[1]], [0, 1, 0, D], [0, 1, 1, D[1]], [1, 0, 0, B], [1, 0, 1, B[1]], [1, 1, 0, C], [1, 1, 1, C[1]]}, axes = none, size = [200, 200]); P := plot3d(Points, style = point, color = "Black", symbol = solidcircle, symbolsize = 10, size = [200, 200], tickmarks = [0, 0, 0]); display({p1, Pointsname}, style = line)

 

 

 

NULL


 

Download cubic.mw

Executing the code in ?InvertedPendulum produces an error when

sysLin := Linearize(convert(sysEqs, list), [u(t)], [x(t), theta(t)], lin_point)

is executed. The problem is the line where EQ4 is assigned a value.

Something is wrong with the line where EQ4 is assigned a value. It is not executed.
It is like the mode changes to text for that line????

I thought I had post with collection showing timelimit still hangs in Maple. But can't find it searching. I wanted to add this to it.

If someone finds such post, please let me know and I will append this to that post and delete this.

I just found another example where int() hangs all of Maple, using timelimit. I put timelimit of 30 seconds. After 2 hrs it is still running.

Maple 2024.1 on windows 10. This shows clearly that timelimit in Maple still does not work when It was supposed to have been fixed in Maple 2021?

For me, if there is anything that will make me stop using Maple for good, it is this timelimit issue.

Because with timelimit not working all the time, my program keeps hanging. It is not possible to do antything then. Having to keep checking if the program is still running or have hanged and restarting it is not a way to develop software.

Software that have been in development for almost 45 years now like Maple, should have figured by now how to implement timelimit that works. 

Note that, with smaller timelimit it is possible it will  not hang, because longer time limit makes it end in the code path which causes the hang. When I tried 5 seconds for example instead of 30 second, it did not hang With 30 it does. so if you try it and it does not hang, please increase the timelimit a little and it will surely hang. Just make sure to do restart each time, since Maple remembers last result.

maple's server.exe was running at full cpu also.

 

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1810 and is the same as the version installed in this computer, created 2024, September 18, 18:16 hours Pacific Time.`

libname;

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

restart;

M:=-6*(3^(1/2)*(27*R^2-4)^(1/2)-9*R)^(1/3)/(-6*(3^(1/2)*(27*R^2-4)^(1/2)-9*R)^(1/3)*R+(-6*I*3^(1/6)-2*3^(2/3))*2^(1/3)+2^(2/3)*(I*3^(5/6)-3^(1/3))*(3^(1/2)*(27*R^2-4)^(1/2)-9*R)^(2/3));
try #this hangs
    timelimit(40,int(M,R));
    print("finished with no timeout");
catch:
    print("waiting for timeout");
end try;

-6*(3^(1/2)*(27*R^2-4)^(1/2)-9*R)^(1/3)/(-6*(3^(1/2)*(27*R^2-4)^(1/2)-9*R)^(1/3)*R+(-(6*I)*3^(1/6)-2*3^(2/3))*2^(1/3)+2^(2/3)*(I*3^(5/6)-3^(1/3))*(3^(1/2)*(27*R^2-4)^(1/2)-9*R)^(2/3))

 

 

Download int_hangs_with_timelimit.mw

 

Update OCT 10, 2024

This is another example showing hang in Maple 2024.1 using timelimit. So adding it to this collection. I had large collection of such problems but not able to find it now.

I was trying to verify this solution (which could very well be wrong) on ode with IC. timelimit hangs when I added assumptions as shown. Used 10,20,30 seconds, and so on. all hang. Waited and waited. 

Does it hang on other systems? I am using Windows 10 and Maple 2024.1 with 128 GB RAM on fast CPU.


 

sol:=y(x) = -8/9*x-11/9+1/9*arcsin(1/103*2509^(1/2)*tan(1/5*(x+5/2509*2509^(1/2)*arctan(1/2509*2509^(1/2)*(103*tan(37)+90*sec(37)))-1)*2509^(1/2))*(90*2509^(1/2)*tan(1/5*(x+5/2509*2509^(1/2)*arctan(1/2509*2509^(1/2)*(103*tan(37)+90*sec(37)))-1)*2509^(1/2))-103*(2509*tan(1/5*(x+5/2509*2509^(1/2)*arctan(1/2509*2509^(1/2)*(103*tan(37)+90*sec(37)))-1)*2509^(1/2))^2+2509)^(1/2))/(2509*tan(1/5*(x+5/2509*2509^(1/2)*arctan(1/2509*2509^(1/2)*(103*tan(37)+90*sec(37)))-1)*2509^(1/2))^2+10609)-90/103):
ode:=5*diff(y(x),x) = 7+10*sin(8*x+9*y(x)+11):
IC:=y(1) = 2:
func:=y(x);

y(x)

try
    timelimit(30,`assuming`([odetest(sol,[ode, op(IC)],func)],[positive, func::positive]));
catch:
    print("timed out OK");
end try;
print("After try/catch");

 

Download time_limit_hang_example_oct_10_2024.mw

I would like to officially offer $1,000 prize for any one who can solve the timelimit hanging problem in Maple. Will send you personal check of this amount if you find why it hangs and provide fix to use that I can verify works.

I have an expression equal to the sum of N terms of the form Int(fn=1..N(x), x) and I want to replace each fn(x) by its Taylor (or series) expansion.

When the integrals are definite, like J1 below, I can easily obtain a new expression (K1) where the integrand has been replaced by some expansion.
But when the integral is indefinite, like J2, I get an evaluated expression for K2.

It seems I have to do some gymnastic (J3 --> K3) to get what I want

restart

J1 := Int(sin(p*x), x=0..1);
K1 := eval(J1, Int = ((a, b) -> Int(mtaylor(a, x=0, 5), b)));

Int(sin(p*x), x = 0 .. 1)

 

Int(p*x-(1/6)*p^3*x^3, x = 0 .. 1)

(1)

# undefined integration

J2 := Int(sin(p*x), x);

`Expected result` = Int(p*x-(1/6)*p^3*x^3, x);

K2 := eval(J2, Int = ((a, b) -> Int(mtaylor(a, x=0, 5), b)));

Int(sin(p*x), x)

 

`Expected result` = Int(p*x-(1/6)*p^3*x^3, x)

 

eval(Int(sin(p*x), x), {Int = (proc (a, b) options operator, arrow; Int(mtaylor(a, x = 0, 5), b) end proc)})

(2)

# undefined integration using Intat

J3 := Intat(op(1, J2), op(2, J2)=y);
eval(%, Intat = ((a, b) -> Intat(mtaylor(a, x=0, 5), b))):

K3 := IntegrationTools:-Change(convert(%, Int), y=x, x)

Intat(sin(p*x), x = y)

 

Int(p*x-(1/6)*p^3*x^3, x)

(3)
 

 

Download Integration.mw

Why do I get this unevaluatedform for K2?
Do I have to use Intat to get K3?

Thanks in advance

First 67 68 69 70 71 72 73 Last Page 69 of 2426