Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Conquest Creatives is a B2B design and branding agency based in Singapore. Our expertise lies in corporate branding, brand consultancy, annual report design services, ESG Report Design, sustainability report design and corporate deck design. Check out our branding services and design projects at https://www.conquestcreatives.com  

Problem Q15 in the book Parabolic Problems by David Angell and Thomas Britz describes a large circle (LC) and several smaller circles (SCs) which are each tangent to its neighbour SC(s), and externally to LC. All circles are tangent to the x axis and above it.

Section one of this worksheet displays the LC and six of the SCs based on the book's formula for the diameter of the latter in terms of the diameter of the LC and the largest SC, which is determined by the user.

Section two finds and displays that all of the displayed SCs' centers lie on the diameter of a circle closely related to the LC and larger than it.

Can this be proved to be the case for any sizes of the LC and SCs in the same formation as that displayed?

Parabola_Problems_Q15.mw

I need assistance with building the homotopy analysis method to solve the system of odes. here is the attempt to do it. I'm still new to maple restart; # Declare functions for the system PDEtools[declare]([f(x), g(x)], prime = x): # Order of expansion N := 4; # Define series for each function f1(x) := sum(p^i*f[i](x), i = 0..N): f2(x) := sum(p^i*g[i](x), i = 0..N): # Define the system of ODEs using Homotopy HPMEq1 := (1-p)*(diff(f1(x), x$3)) + p*(diff(f1(x), x) + f2(x)): HPMEq2 := (1-p)*(diff(f2(x), x$3)) + p*(diff(f2(x), x) - f1(x)): # Extract coefficients for the system for i from 0 to N do equl[1][i] := coeff(HPMEq1, p, i) = 0: equl[2][i] := coeff(HPMEq2, p, i) = 0: end do: # Define boundary conditions for the system cond= 0, D(f1[0])(5) = 1]: cond = 0, D(f2[0])(0) 1]: for j from 1 to N do cond = 0, D(f1[j])(0) = 0, D(f1[j])(5) , D(f2[j])(0) = 0, D(f2[j])(5) = 0]: end do: # Solve the system iteratively for each order for k from 0 to N do dsolve([equl[1][k], cond[1][k]], f1[k](x)): dsolve([equl[2][k], cond[2][k]], f2[k](x)): end do:

i try to get same result by substituation but i don't know what is mistake after i take second derivative is wronge i don't know how get same result as in paper did can anyone help  to calculate this part is not hard but is complicated ,How calculated second derivative and put in our ode to get the parameters?

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

"          with(Student[ODEs][Solve]):"

_local(gamma)

declare(Omega(x, y, t)); declare(U(xi)); declare(u(x, y, t)); declare(Q(xi)); declare(V(xi)); declare(W(xi)); declare(f(xi))

Omega(x, y, t)*`will now be displayed as`*Omega

 

U(xi)*`will now be displayed as`*U

 

u(x, y, t)*`will now be displayed as`*u

 

Q(xi)*`will now be displayed as`*Q

 

V(xi)*`will now be displayed as`*V

 

W(xi)*`will now be displayed as`*W

 

f(xi)*`will now be displayed as`*f

(2)

NULL

ode := -delta*(diff(diff(U(xi), xi), xi))+U(xi)*(w^2-gamma*U(xi)-beta-alpha) = 0

-delta*(diff(diff(U(xi), xi), xi))+U(xi)*(w^2-gamma*U(xi)-beta-alpha) = 0

(3)

ode1 := -delta*(diff(diff(f(xi), xi), xi))+f(xi)*(w^2-gamma*f(xi)-beta-alpha) = 0

-delta*(diff(diff(f(xi), xi), xi))+f(xi)*(w^2-gamma*f(xi)-beta-alpha) = 0

(4)

F := U(xi) = sum(tanh(xi)^(i-1)*(B[i]*sech(xi)+A[i]*tanh(xi)), i = 1 .. n)+A[0]

U(xi) = sum(tanh(xi)^(i-1)*(B[i]*sech(xi)+A[i]*tanh(xi)), i = 1 .. n)+A[0]

(5)

S := U(f(xi)) = sum(cos(f(xi))^(i-1)*(B[i]*sin(f(xi))+A[i]*cos(f(xi))), i = 1 .. n)+A[0]

U(f(xi)) = sum(cos(f(xi))^(i-1)*(B[i]*sin(f(xi))+A[i]*cos(f(xi))), i = 1 .. n)+A[0]

(6)

``

n := 2

2

(7)

eval(ode1, S)

-delta*(diff(diff(f(xi), xi), xi))+f(xi)*(w^2-gamma*f(xi)-beta-alpha) = 0

(8)

Download complex-issue.mw

Maple dsolve hangs (mserver.exe runs with high CPU for long time, had to stop it). 

This question is, why does it hang? As this can indicate internal logic bug.

This question is not why Maple can't solve this ode (taken from old textbook) as not solving an ode is not a bug (even though it should, as Maple is very good in solving ode's) but hanging is a bug.

infolvel shows it hangs when it reaches

<- Abel successful
         equivalence to an Abel ODE successful, Abel ODE has been solved

And stops here. 

Here is worksheet, showing the attempts made, and verifying book solution is correct using Maple with change of variable.

Make sure to save all your work before trying this just to be safe.

restart;

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 1841 and is the same as the version installed in this computer, created 2025, January 3, 8:59 hours Pacific Time.`

original_ode :=(diff(y(x),x)*x-y(x))*(x-diff(y(x),x)*y(x))=2*diff(y(x),x);

((diff(y(x), x))*x-y(x))*(x-(diff(y(x), x))*y(x)) = 2*(diff(y(x), x))

#infolevel[dsolve]:=5;
dsolve(original_ode); #hangs

restart;

original_ode :=(diff(y(x),x)*x-y(x))*(x-diff(y(x),x)*y(x))=2*diff(y(x),x);
dsolve(original_ode,'implicit'); #hangs

restart;  #ONE SOLUTION IS:

original_ode:=(diff(y(x),x)*x-y(x))*(x-diff(y(x),x)*y(x))=2*diff(y(x),x);
book_sol:=y(x)=sqrt(x^2*c__1+2*c__1/(c__1-1));
odetest(book_sol,original_ode)

((diff(y(x), x))*x-y(x))*(x-(diff(y(x), x))*y(x)) = 2*(diff(y(x), x))

y(x) = (x^2*c__1+2*c__1/(c__1-1))^(1/2)

0

workaround to solve, by change of variables

 

restart;

original_ode :=(diff(y(x),x)*x-y(x))*(x-diff(y(x),x)*y(x))=2*diff(y(x),x);
ode2:=PDEtools:-dchange({x=sqrt(u),y(x)=sqrt(v(u))},original_ode,[v(u),u]):
sol:=dsolve(ode2):
sol:=map(X->eval(X,[v(u)=y(x)^2,u=x^2]),[sol]);
map(X->odetest(X,original_ode),sol)

((diff(y(x), x))*x-y(x))*(x-(diff(y(x), x))*y(x)) = 2*(diff(y(x), x))

[y(x)^2 = x^2+2-2*2^(1/2)*(x^2)^(1/2), y(x)^2 = x^2+2+2*2^(1/2)*(x^2)^(1/2), y(x)^2 = c__1*x^2+2*c__1/(c__1-1)]

[0, 0, 0]

 


 

Download why_dsolve_hangs_jan_17_2025.mw

 

How do I access the Maple Fundamentals guide video? Every time I click on the video, it tells me I must log in to view the video. But there is no where on that page to log in. When I log in to Maple Primes, I can't find the video.

I think the worksheet below is enough to define the problem I'm facing.

(question updated by adding a simple 2D case ; the expected value is about 0.67684)

restart

# How can I define CharFunc so that int(CharFunc, x=...) gives me the expected value?
#
# Motivation:
# Let Dom some 2D domain and Env another 2D domain which contains Dom.
# The interior of Dom is defined by a sequence L(x, y) of inequalities.
# The area of Dom can be expressed by the integral over Env of the characteristic function
# CharFunc(x, y) of Dom which returns 1 if (x, y) belongs to Dom and 0 otherwise.
#
# Here is a simple 1D example


CharFunc := proc(x)
  if x::numeric then
    piecewise(is(And(x >= 0, x <= 1)), 1, 0)
  else
    'procname( _passed )'
  end if:
end proc:


Env := -1..2:
plot(CharFunc(x), x=Env, thickness=5);

 

# Expected value = 1

int(CharFunc(x), x=Env);

int(CharFunc(x), x = -1 .. 2)

(1)

# Expected value = 1/2

int(CharFunc(x), x=1/4..3/4);

int(CharFunc(x), x = 1/4 .. 3/4)

(2)


Works with floats

# Expected value = 0.5

int(CharFunc(x), x=0.25..0.75);

.5000000000

(3)

# Expected value = 1

int(CharFunc(x), x=-1.0..2.0);

1.000000000

(4)


2D example

Env := x=0.8..3, y=0..1.3;

x = .8 .. 3, y = 0 .. 1.3

(5)

Dom := proc (x, y) options operator, arrow; And(y <= 1/(1+sinh(2*x)*ln(x)^2), .8 <= x, x <= 3, 0 <= y, y <= 1.1) end proc

proc (x, y) options operator, arrow; And(y <= 1/(1+sinh(2*x)*ln(x)^2), .8 <= x, x <= 3, 0 <= y, y <= 1.1) end proc

(6)

CharFunc := proc(x, y)
  piecewise(is(Dom(x, y)), 1, 0)
end proc:

plot3d(
  [0, 'CharFunc'(x, y)], Env
  , grid=[40, 40]
  , style=surface, color=[gray, blue], transparency=[0, 0]
  , title=typeset('CharFunc'(x, y))
);

 

int(CharFunc(x, y), Env)

0.

(7)
 

 

Download Integration_issue.mw

Thanks in advance

Does Maple provide any command/examples that can help verfying whether an analytic function or a time series (a sequence of numbers) is periodic?

I had a look at signal processing. In principle auto-correlation could be used for that purpose but I am interested in a command that outputs a period for a given allowable error or a graphical display that can help in an assessment.

Analytic convolution and analysis of the convolution terms for periodic conditions would be great for analytic functions.

I have no time (and limited skills) to program such things myself.

Hello everyone, first time poster here.

I am trying to calculate xDLVO theory for a surface, which is simply 3 equations with 3 unknown. I have values for everything except x, y and z and Maple gives intermediate results for all the equations when defining them. The cos(x) is of a contact angle, and the problem is that Maple will not calculate x, y and z when all three cos(x) have decimal numbers. when changing just one of them to a whole number, such as changing cos(66.969) to cos(67), then it solve the unknowns. This is the same for the other two numbers, there just always have to be a atleast one whole number in one of the cos(x). I have tried to just use the results of the cos(x), so I enter decimal numbers instead of the entire (1+cos(x) bracket, and it still will not work with decimal numbers.

I am not the brightest at math or Maple, so maybe it is a dumb mistake from my part :)

 

eqw := Ytotw*(1 + cos(66.696)) = 2*(sqrt(Ylww*x) + sqrt(y*Ypw) + sqrt(Ymw*z));

           eqw := 17.99142992 = 2*sqrt(26)*sqrt(x) + 10.09950494*sqrt(y) + 10.09950494*sqrt(z)


eqf := Ytotf*(1 + cos(42.497)) = 2*(sqrt(Ylwf*x) + sqrt(y*Ypf) + sqrt(Ymf*z));

           eqf := 62.95291273 = 2*sqrt(39)*sqrt(x) + 3.019933774*sqrt(y) + 12.58570618*sqrt(z)


eqd := Ytotd*(1 + cos(30.405)) = 2*(sqrt(Ylwd*x) + sqrt(y*Ypd) + sqrt(Ymd*z));

          eqd := 77.77865435 = 14.25482374*sqrt(x)


solve([eqw, eqf, eqd], [x, y, z]);
                               []

 

Thank you for your time!

Best regards

Jakob

Hello, I need help to find the real and Imaginary components of following complex model using maple, here q=u+iv,

The maple worksheet shows an incorrect evaluation of the integral in (1) which is a standard integral representation of a Bessel function.  Equations (2)-(5) along with the graph show the incorrectness of the evaluation.  What is going on?

Bessel.mw

This worksheet defines two physics problems and fails in the attempt to solve the first one.

How can these problems be solved?

Rolling_circle.mw

Hello, can somebody give some suggestions to speed up this summations? I am summing up to 10 and it take ages (about 10min).

Digits := 10;
n1 := 122;
x := 54;
n2 := 65;
y := 14;
alpha1 := 1.1;
beta1 := 1.1;
alpha2 := 1.1;
beta2 := 1.1;

Sigma2 := (j, l, psi0) -> Sum(Sum(Sum(psi0^(-y - alpha2 - l - alpha2*h - v)*pochhammer(beta2 - 1, h)*pochhammer(beta1 - 1, u)*pochhammer(y + alpha2 + l + alpha2*h, v)*2^(-y - alpha2 - l - alpha2*h - x - alpha1 - j - alpha1*u - v)*(psi0 - 1)^v/(h!*(y + alpha2 + l + alpha2*h)*u!*v!*(y + alpha2 + l + alpha2*h + x + alpha1 + j + alpha1*u + v)), u = 0 .. upto), h = 0 .. upto), v = 0 .. upto);

F2 := psi0 -> Sum(binomial(n1 - x, j)*Sum(binomial(n2 - y, l)*(-1)^(j + l)*Sigma2(j, l, psi0), l = 0 .. n2 - y), j = 0 .. n1 - x);

upto:=10;

F2(5.620);

Thanks in advance.

Found this old procedure code and revived it
Trying to include an Exploreplot as well
a0,a1,a2,b1,b2 are coeifficents in a ode to construct 
How about odetype when constructing a ode is this correct in code?


 

restart;

Odegenerator := proc(V, x, y, df, const_values)
    local input_args, xi, F, result, a0, a1, a2, b0, b1, sol, Fsol, rows, numrows, eq, count, odeplot_cmd, ode_type, row_number, values;
    uses plots, PDEtools;
       if nargs = 1 and V = "help" then
        printf("Use this procedure as follows:\n");
        printf("Define an ODE template:\n");
        printf("Odegenerator(V, x, y, df, const_values)\n");
        printf("V: A set of values for iteration over constants (if df > 0)\n");
        printf("x: The independent variable\n");
        printf("y: The function\n");
        printf("df: The row number in the DataFrame or 0 for manual input\n");
        printf("const_values: A list of values for the constants (used if df = 0)\n");
        return;
    end if;

    if nargs < 4 or nargs > 5 then
        error "Incorrect number of arguments. Expected: V, x, y, df, [const_values (optional)]";
    end if;

    # Determine the ODE type using odeadvisor for the global eq_template
    ode_type := odeadvisor(eq_template);

    # Display the ODE and its type
    print(eq_template, ode_type);

    rows := [];
    count := 0;
    ###################### BOF manuele invoer ###################
    if df = 0 then
    # If df = 0, use const_values for substitution
    if nargs < 5 or not type(const_values, list) then
        error "When df = 0, a list of constant values must be provided as the fifth argument.";
    end if;

    # Assign constant values
    if nops(const_values) <> 5 then
        error "The list of constant values must contain exactly 5 elements.";
    end if;

    # Find the corresponding row number by unique identification
    count := 1;
    for a0 in V do
        for a1 in V do
            for a2 in V do
                for b0 in V do
                    for b1 in V do
                        if [a0, a1, a2, b0, b1] = const_values then
                            row_number := sprintf("%d", count);  # Convert to string
                        end if;
                        count := count + 1;
                    end do;
                end do;
            end do;
        end do;
    end do;

    if not assigned(row_number) then
        row_number := "Unique (outside iterative rows)";  # Mark as unique
    end if;

    # Substitute the given values
    eq := subs({'a__0' = const_values[1], 'a__1' = const_values[2], 'a__2' = const_values[3], 'b__0' = const_values[4], 'b__1' = const_values[5]}, eq_template);

    # Solve the equation
    sol := dsolve(eq, y(x));
    if type(sol, `=`) then
        Fsol := rhs(sol);
    else
        Fsol := "No explicit solution";
    end if;

    # Display the solution and its row number
    odeplot_cmd := DEtools[DEplot](eq, y(x), x = 0 .. 2, y = -10 .. 10, [[y(0) = 1]]);
    print(plots:-display(odeplot_cmd, size = [550, 550]));

    printf("The found function is:\n");
    print(Fsol);
    printf("The corresponding row number is: %s\n", row_number);

    # -- Start of Additional Functionality --
    # Optionally display the simplified ODE
    printf("The simplified ODE using the given coefficients is:\n");
    print(eq, ode_type);
    # -- End of Additional Functionality --

    return Fsol;
     ################# EOF manuele berekening ##################
     ############## BOF iterative berekening##############
    else
        # Iterative approach for DataFrame generation
        for a0 in V do
            for a1 in V do
                for a2 in V do
                    for b0 in V do
                        for b1 in V do
                            xi := x;
                            F := y;

                            # Substitute constant values into the ODE
                            eq := subs({'a__0' = a0, 'a__1' = a1, 'a__2' = a2, 'b__0' = b0, 'b__1' = b1}, eq_template);

                            sol := dsolve(eq, F(xi));
                            if type(sol, `=`) then
                                Fsol := rhs(sol);
                            else
                                Fsol := "No explicit solution";
                            end if;

                            rows := [op(rows), [a0, a1, a2, b0, b1, Fsol]];
                        end do;
                    end do;
                end do;
            end do;
        end do;

        numrows := nops(rows);
        result := DataFrame(Matrix(numrows, 6, rows), columns = ['a__0', 'a__1', 'a__2', 'b__0', 'b__1', y(x)]);

        interface(rtablesize = numrows + 10);

        if df > 0 and df <= numrows then
            a0 := result[df, 'a__0'];
            a1 := result[df, 'a__1'];
            a2 := result[df, 'a__2'];
            b0 := result[df, 'b__0'];
            b1 := result[df, 'b__1'];

            eq := subs({'a__0' = a0, 'a__1' = a1, 'a__2' = a2, 'b__0' = b0, 'b__1' = b1}, eq_template);

            # Display the additional parameters
            print(eq, ode_type, [df], [a0, a1, a2, b0, b1]);

            # Retrieve the solution
            Fsol := result[df, y(x)];

            # Display the solution in DEplot
            odeplot_cmd := DEtools[DEplot](eq, y(x), x = 0 .. 2, y = -10 .. 10, [[y(0) = 1]]);
            print(plots:-display(odeplot_cmd, size = [550, 550]));

            printf("The found function for row number %d is:\n", df);
            print(Fsol);

        else
            printf("The specified row (%d) is out of bounds for the DataFrame.\n", df);
        end if;

        return result;
     ########## EOF iteratief bwrekening ########################
    end if;

end proc:


# Test cases
V := {0, 1};
eq_template := diff(y(t), t) = 'a__0'*sin(t) + 'a__1'*y(t) + 'a__2'*y(t)^2 + 'b__0'*exp(-t);



 

{0, 1}

 

diff(y(t), t) = a__0*sin(t)+a__1*y(t)+a__2*y(t)^2+b__0*exp(-t)

(1)

 

 

# Iterative test
result := Odegenerator(V, t, y, 25);

diff(y(t), t) = a__0*sin(t)+a__1*y(t)+a__2*y(t)^2+b__0*exp(-t), odeadvisor(diff(y(t), t) = a__0*sin(t)+a__1*y(t)+a__2*y(t)^2+b__0*exp(-t))

 

diff(y(t), t) = sin(t)+y(t), odeadvisor(diff(y(t), t) = a__0*sin(t)+a__1*y(t)+a__2*y(t)^2+b__0*exp(-t)), [25], [1, 1, 0, 0, 0]

 

 

The found function for row number 25 is:

 

-(1/2)*cos(t)-(1/2)*sin(t)+c__1*exp(t)

 

module DataFrame () description "two-dimensional rich data container"; local columns, rows, data, binder; option object(BaseDataObject); end module

(2)

 

# Manual input test
Odegenerator(V, t, y, 0, [1, 1, 0, 0, 0]); #0 after y is rownumber = 0 and [1, 1, 0, 0, 0] are coeifficents

diff(y(t), t) = a__0*sin(t)+a__1*y(t)+a__2*y(t)^2+b__0*exp(-t), odeadvisor(diff(y(t), t) = a__0*sin(t)+a__1*y(t)+a__2*y(t)^2+b__0*exp(-t))

 

 

The found function is:

 

-(1/2)*cos(t)-(1/2)*sin(t)+c__1*exp(t)

 

The corresponding row number is: 25
The simplified ODE using the given coefficients is:

 

diff(y(t), t) = sin(t)+y(t), odeadvisor(diff(y(t), t) = a__0*sin(t)+a__1*y(t)+a__2*y(t)^2+b__0*exp(-t))

 

-(1/2)*cos(t)-(1/2)*sin(t)+c__1*exp(t)

(3)
 

 

 


Download ODEGENERATORFUNCTIE_opgepakt-uitgebreid_naar_MprimesDEF_14-1-2025.mw

How do I generate a plot within a plot as shown in my example below? The fundemental issue is plot structures like Histogram() etc are not images and so combining them in the way I imagine is non-trivial. I couldn't find a standard way to do this in the help section.

Plot_within_a_plot.mw

restart

NULL``

with(plots)

NULL

Consider the two plots p1 and p2.

NULL

p1 := plot(sin(x), size = [300, 300])

 

p2 := plot(sin(x), view = [0 .. Pi, .5 .. 1], size = [300, 300], axes = boxed)

 

NULL

How do I generate a plot within a plot as shown below, if I calculated the plots ahead of time? Is there a standard way to do this?

NULL

NULL

NULL

Download Plot_within_a_plot.mw

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