Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Dear Maple users

I can plot a pin diagram for the binomial distribution for say n = 20 and p = 0.3. It is one-dimensional, since only the number r of successes is relevant. Now I want to plot a diagram for the multinomial distribution for 3 categories. This means a two dimensional distribution. Let's say n = 20, p1 = 0.2, p2 = 0.5 (then p3 = 1 - p1 - p2 = 0.3). How do I make this plot? Pin diagram, but maybe even better: A Bar Chart. 

I hope someone can help.

Erik

Hi,

look at this Maple code.

short_list_prime_factorization_fun.mw

short_list_prime_factorization_fun.pdf

Have a good day

Matthew

I want to solve my PDE using Homotopy Perturbation Method. I have error while solving i dont know why it is showing error. If anyone knows the what mistake i have done in the code, kindly correct me. I want to find the equation of W(r,z) . dp/dz is a pressure terms which is independent of r. And the initial guess is taken as w0 := (-eta^2 + r^2)/2.  Help me to solve this.

 

 

restart;
PDEtools[declare](w(r, z));
               w(r, z) will now be displayed as w

N := 1;

w0 := (-eta^2 + r^2)/2:
w(r,z) := sum(p^i*w[i](r, z), i = 0 .. N)
                   w[0](r, z) + p w[1](r, z)

HPMEq := (1 - p)*diff(w(r, z), r $ 2) + p*(diff(w(r, z), r $ 2) + diff(w(r, z), r)/r - (1 + lambda)*(dp/dz + A2*M^2*w(r, z) + A1*w(r, z)/Da - m^2*UHS*BesselI(0, m*r)/BesselI(0, m*eta) + A3*sin(Phi))/A1);
                                                                /
                                                                |
        // d  / d            \\     / d  / d            \\\     |
(1 - p) ||--- |--- w[0](r, z)|| + p |--- |--- w[1](r, z)||| + p |
        \\ dr \ dr           //     \ dr \ dr           ///     \

  / d  / d            \\     / d  / d            \\
  |--- |--- w[0](r, z)|| + p |--- |--- w[1](r, z)||
  \ dr \ dr           //     \ dr \ dr           //

     / d            \     / d            \                       
     |--- w[0](r, z)| + p |--- w[1](r, z)|      /             /  
     \ dr           /     \ dr           /   1  |             |dp
   + ------------------------------------- - -- |(1 + lambda) |--
                       r                     A1 \             \dz

         2                            
   + A2 M  (w[0](r, z) + p w[1](r, z))

                                       2                    
     A1 (w[0](r, z) + p w[1](r, z))   m  UHS BesselI(0, m r)
   + ------------------------------ - ----------------------
                   Da                   BesselI(0, m eta)   

                  \
                \\|
                |||
   + A3 sin(Phi)|||
                ///


for i from 0 to N do
    equ[1][i] := coeff(HPMEq, p, i) = 0;
end do;
                     d  / d            \    
                    --- |--- w[0](r, z)| = 0
                     dr \ dr           /    

                           d                                   
                          --- w[0](r, z)      /             /  
 / d  / d            \\    dr              1  |             |dp
 |--- |--- w[1](r, z)|| + -------------- - -- |(1 + lambda) |--
 \ dr \ dr           //         r          A1 \             \dz

                                          2                    
          2              A1 w[0](r, z)   m  UHS BesselI(0, m r)
    + A2 M  w[0](r, z) + ------------- - ----------------------
                              Da           BesselI(0, m eta)   

                 \\    
                 ||    
    + A3 sin(Phi)|| = 0
                 //    


NULL;
cond[1][0] :=  D*w[0](0,z) = 0, w[0](eta,z) = 0;
for j to N do
    cond[1][j] := D*w[j](0,z) = 0,w[j](eta,z) = 0;
end do;
               D w[0](0, z) = 0, w[0](eta, z) = 0

               D w[1](0, z) = 0, w[1](eta, z) = 0


for i from 0 to N do
    dsolve({cond[1][i], equ[1][i]}, {w[i](r,z)});
    w[i](r,z) := rhs(%);
end do;
w(r,z) := evalf(simplify(sum(w[n](r,z), n = 0 .. N)));
convert(w(r,z), 'rational');
w(r,z) := subs(r = 0, w(r,z));
Error, invalid input: rhs expects 1 argument, but received 2
                    w[0](r, z) + w[1](r, z)

                    w[0](r, z) + w[1](r, z)

                    w[0](0, z) + w[1](0, z)


 

Hi,

check out this maple code

positive_odd_integer_factorization_data.pdf

positive_odd_integer_factorization_data.mw

that is all

Regards,

Matthew

In the attached file, (6) is stated as "false." However, it is possible to prove with pen and paper that term1 = term2. In (5), the limit function is sought but not determined.
What am I doing wrong?test1.mw
 

restart

term1 := (2*cos(2^n*x)+1)/(2*cos(x)+1)

(2*cos(2^n*x)+1)/(2*cos(x)+1)

(1)

term2 := product(2*cos(2^k*x)-1, k = 0 .. n-1)

product(2*cos(2^k*x)-1, k = 0 .. n-1)

(2)

term3 := term1*(2*cos(2^n*x)-1)/(2*cos(x)-1)

(2*cos(2^n*x)+1)*(2*cos(2^n*x)-1)/((2*cos(x)+1)*(2*cos(x)-1))

(3)

simplify(term3)

(1+2*cos(2^(1+n)*x))/(1+2*cos(2*x))

(4)

limit((1+2*cos(2^(1+n)*x))/(1+2*cos(2*x)), n = infinity)

limit((1+2*cos(2^(1+n)*x))/(1+2*cos(2*x)), n = infinity)

(5)

is(term1 = term2)

false

(6)

NULL


 

Download test1.mw

 

Why can't the sys0 extracted using the convertsys command be processed with collect? However, when I extract its amplitude and then perform collect again, it works. Why is this happening? Is there a good method to handle this? I feel that copying it out is inconvenient for subsequent modifications.

nature_frequency_question.mw

Hi,

have some Maple code to share.

prime_triplet_0_4_6.mw

prime_triplet_0_4_6.pdf

Enjoy

Matthew

ps Prime numbers are fun

see https://t5k.org/

 

We are a week away from the submission deadline for the Maple Conference!  
Presentation proposal applications are due July 25, 2025.

We are inviting submissions of presentation proposals on a range of topics related to Maple, including Maple in education, algorithms and software, and applications. We also encourage submission of proposals related to Maple Learn. You can find more information about the themes of the conference and how to submit a presentation proposal at the Call for Participation page.

We hope to see there.

I want to define a multivariate function f(x1,x2) and its gradient f1(x1,x2) in order to calculate

f(X)=f(X[0])+grad(f(X[0])*(X-X[0])

I try in this way:

with(LinearAlgebra);
f := x -> x[1]^2 + x[2]^2
f1 := x -> <diff(f(x), x[1]), diff(f(x), x[2])>
A := <2,3>
f(A)
     13
f1(A)
     Error, (in f1) invalid input: diff received 2, which is not valid for its 2nd argument
 

What is wrong and how could I define f1(x) in order to write f1(A) for the gradient of f calculated  at A?
Thanks

I intend to use LinearAlgebra package to do some calculations. I want to compute the basis for large Matrices. My discovery is that the linalg[kernel] command, which the document claims is deprecated, could do such computation significantly faster than the LinearAlgebra[NullSpace] command. For a 200 x 500 large random matrix, linalg[kernel] clocked 33 secs, while the LinearAlgebra[NullSpace] takes 200 secs, as shown in the worksheet NullSpace_vs_kernel.mw.

I wanna know what makes the difference, or is there a misuse for LinearAlgebra[NullSpace].

Hi,

Don't laugh.

Some of you are not familair with Wagstaff Prime Numbers

see Wolfram Math World

also, this Maple code is esentially, a loop and the isprime() function

for your edification

b

have a look

just wanted to contribute my two cents to the Maple community

good day

Hi everyone,

I am trying to solve a system of coupled ODEs numerically. My worksheet runs and produces results, but when I look at the graphs, it seems that the boundary conditions are not being satisfied correctly. Could anyone help me identify the issue and  fix my implementation?

BCs_help.mw

I need to export an image in high resolution in JPEG, JPG, and PDF formats. Right now, I'm using screenshots, which results in low clarity. Could you please help me with the correct syntax to generate a high-resolution, downloadable image in these formats? I'm attaching the file below:

q_new.mw

Hi

I'm trying to duplicate this graph in Maple. Any suggestions on how to place the textplot labels (n=0, n=1, etc.) to the right of 0.8, just like in the original graph?

how to place the textplot labels (n=0, n=1, etc.)

Thanks

S7MAA_Dveloppement_Limit.mw

I constructed a density function, and I am certain it shows me what I want.  The problem I am having is parsing the Elliptic functions. Is there a way to "get rid" of the ones I don't want or need.

I generated a plot of the function -- the plot tells me what I expected based on simulation. I need to know if there is a way to express the density function (y) as a function of t and without the elliptic functions..  Even a numerical solution would be fine.

I assume the denomenator term is correct. I also assume that I don't need complex values. My input file is below.

Basics.mw

2 3 4 5 6 7 8 Last Page 4 of 2217