Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I am trying to figure out the width-at-half-maximum for a speical case of the difference of Guaussians.  In this scenario, I start with a standard formula for a Gaussian:

f(x, x0, S, Gmax) = -Gmax*(exp(S*(x - x0)^2*(-1/2)) - 1)*heaviside(x - x0)

 

where x0, is the location of the peak, S is the spread, and Gmax is the amplitude.  However, then I take a difference of two, assuming that x0 is 0 for both, that Gmax is unity for both, and the only thing free to vary between them is the spread.

fDOG(x, S_a, S_d) = f(x, 0, S_a, 1) - f(x, 0, S_d, 1)

 

Here I also assume that S_a > S_d, and that all values (including x) are real positive numbers.  In this case, I (believe) I always get a peak function that rises from y = 0 at x = 0 to some peak, and then falls back to y = 0 at infinity.

Differentiating fDOG and solving for y = 0, I can find the time of the peak of this function:

tpeak(S_a, S_d) = (sqrt(2)*sqrt(ln(S_a/S_d))/sqrt(S_a - S_d))

 

I can then find the amplitude at the peak by substituting tpeak for x in fDOG. However, what I would like to do now is is find the (two) points on x where y = fDOG(tpeak, S_a, S_d)/2.  Is this possible?

The goal here is to verify if the solution found by Maple is valid for the submitted ODE or not. Following the usual, 'odetest' and simply plugging the solution provided by Maple into the submitted ODE did not inspire confidence, so I am writing to see where I went wrong. The steps which were followed...

restart;
Equation := 2/(3*int(diff(y(x), x)*x^2/(x^2 - 1), x)^(3/2))
            + int(sqrt(2)*sqrt(y(x)), x) = 0:

ImpliciteSol := simplify(expand(dsolve(Equation)[1]));

     1/16*(-9*y(x)*(-y(x)*x^2)^(1/3)*6^(2/3)*x^2+16*_C1*x^(8/3)-24*x^2+6)/x^(8/3) = 0

yofx := simplify(expand(isolate(ImpliciteSol[1], y(x)))); # does not succeed

    (1/16*(-9*y(x)*(-y(x)*x^2)^(1/3)*6^(2/3)*x^2+16*_C1*x^(8/3)-24*x^2+6)/x^(8/3) = 0)[1] = 0

The goal here is to verify if the solution found by Maple is valid for the submitted ODE or not. Following the usual, 'odetest' and simply plugging the solution provided by Maple into the submitted ODE did not inspire confidence, so I am writing to see where I went wrong.

Hi

I'd like to know that why in the attachment "fsolve" does not work?

How can I evaluate the value of "A" in my file?

Many thanks in advance

NULL

restart:

N := 60: L := 10: a := 2*10^(-12):

eqn:=ns=1-((((N/A)+((A*L)^(L/(1-L))))^((1-L)/L))/(A*L))*(2+(a*exp((((N/A)+((A*L)^(L/(1-L)))))^(1/L)))/((A*L*(((N/A)+((A*L)^(L/(1-L))))^((L-1)/L)))+((a*exp((((N/A)+((A*L)^(L/(1-L)))))^(1/L)))))):

seq(fsolve(eqn,A),ns=[0.9603,0.9647,0.9691]):

 

NULL

Download A.mw

Hello everybody!

Im working on my great great (not great at all.. ) Dutch math book. Im really considering getting a copy of "Advanced Engineering Mathematics, by Robert Lopez". But hey, i worked through the first book, and now im at the half of the other second book. So i will finish it.

They left me with no clue on how to get the deal done, that is what is so perfect about this book i guess (i did a lot of books, but these Dutch books, yeah they do me like that) they will leave you in the dark, while they get all the grandeur because they know how to get it done, and you as the reader, well as a first timer, dont know how. Ive talked to a lot of students about this book. Yes it sucks. Classes full of students did agree on that, the majority did. So yeah, im trying to get a book delivered from the university library to a university libary closer to me, so i can get the book that does have good reviews.

The things i did learn from the Dutch math book did work great in statics and mechanics. That made short work of all the questions like a hot knife through butter.

THE ACTUAL QUESTION:
I cant prove this, because i dont know how. The translation says: a. Prove that the inverse of A exists for all values of p.

b. Determine the inverse of A

My take on it thusfar:

#Opdracht 9

#a.

with(LinearAlgebra)

A := `<,>`(`<|>`(1, 1, 1, 1), `<|>`(p, p+2, p+3, p+4), `<|>`(p^2, (p+2)^2, (p+3)^2, (p+4)^2), `<|>`(p^3, (p+2)^3, (p+3)^3, (p+4)^3))

Matrix(%id = 18446747008253355422)

(1)

``

``

``

#b.

B := MatrixInverse(A)

Matrix(%id = 18446747008306226350)

(2)

``

Thank you!

Greetings,

The Function

Download Mapleprimes_Question_Book_2_Paragraph_4.4_Question_9a.mw

Hi, please how do I delete only the 0*I of the complex expression: 0.*I - 3?

I tried this:  remove(`=`, [0.*I-3, 5, 7, -2], 0.*I);

But couldn't work.

I want to replace   expression that contains function whose first argument is always R0 with r0.

I can do it when the function is  f(R0) or f(R0,x) but I do not know how to tell Maple to do the replacement of the first argument, if the function has 0 or more arguments beyond R0.  This is what I tried

restart;

#this works
expr:=A+f(R0);
evalindets(expr, 'anyfunc(identical(R0))', Z-> subsop(1 = r0, Z ));

A+f(R0)

A+f(r0)

#this also works, when there is one argument after R0
expr:=A+f(R0,x);
evalindets(expr, 'anyfunc(identical(R0),anything)', Z-> subsop(1 = r0, Z ));

A+f(R0, x)

A+f(r0, x)

#but how to do it for any number of arguments after R0? This does not work
expr:=A+f(R0,x,y);
evalindets(expr, 'anyfunc(identical(R0),anything)', Z-> subsop(1 = r0, Z ));

A+f(R0, x, y)

A+f(R0, x, y)

#I do not want to keep adding anything to match the number of argument, as I do not know how many there could be
expr:=A+f(R0,x,y);
evalindets(expr, 'anyfunc(identical(R0),anything,anything)', Z-> subsop(1 = r0, Z ));

A+f(R0, x, y)

A+f(r0, x, y)

 

Download oct_11_2022_anyfunc.mw

I do not want to keep writing anything,anything,anything, for as many times as there could be more arguments.  I wan to say something like

evalindets(expr, 'anyfunc(identical(R0),anything_zero_or_more_arguments)', Z-> subsop(1 = r0, Z ));

Is there a better way to do this whole thing than what I am doing?

Update

Just after I posted this question, I found another structured type that worked

expr:=A+f(R0,x,y,z,h);
evalindets(expr, 'patfunc(identical(R0),anything)', Z-> subsop(1 = r0, Z ));

So patfunc works for zero or more argument after R0, which is what I wanted.

Given that types are core part of Maple, I find it so amazing that the help page "Definition of a Structured Type in Maple"  has so little examples and description of all these types in it. I can't figure what 80% of the types there do, since there are no examples.

Maplesoft should really do a better job on this page and add much much more examples and description. After all, strong typing is what is supposed to be the strength of Maple. But looking at this help page, it does not give one this impression at all.

After I refer to the Mersenne prime number table, I found the following result
5, 31, the number of digits is too large to be determined
13, 8191
17, 131071
19, 524287
If the following elements all yield composite numbers
So:
2, 3, 7, 127
The length of the sequence with only 2 only generators reaches 4.
Due to its particularity, it is guessed whether 2^(2^127-1)-1 is also a prime number,
and whether the sequence with 2 as the generator is an infinite sequence of prime numbers Woolen cloth? 
Then perfect numbers are also infinite.

I inadvertently discovered that the save command (and probably read, write, export and import commands too?) returns an error (something like "can't write ...") when the file length is too large (265 in my case).

Is this documented somewhere?
Is there a way to exceed this limit?
Assuming D=".../" and F="xxx.m", can we set the path of the directory D to some value and then use save something, F instead of save something cat(D, F) ?

Thanks in advance

I have a matrix and generate difference tables from it's diagonals. Works fine. Then I make a polynomial from the first row of the difference table. I have three polynomials. They are all acting inert, just will not evaluate.

I cannot see what the problem is.
 

restart

interface(rtablesize = 12)

[10, 10]

i) Recurrence relation

 

"Recurrence Relation for next column. . The matrix starts at 1,1 not 0,0 A(i,j)=A(i-1,j-1)*(j-2)+A(i,j-1)"
``

NULL``

Msize := 12

A := Matrix(Msize)

A[1, 1] := 1

1

for i from 2 to Msize do for j from i to Msize do A[i, j] := A[i, j-1]*(j-2)+A[i-1, j-1] end do end do

A

Matrix(%id = 36893489695842121836)

``

``

viia)  General formula for diagonals:-

Select diagonal  & Difference Table procedures

 

diag := proc (M::Matrix, dg::posint) local i, rd, c, dt; rd := LinearAlgebra:-RowDimension(M); dt := Matrix(rd, rd); for i from dg to rd do dt[1+i-dg, 1] := M[1+i-dg, i] end do; return dt end proc

proc (M::Matrix, dg::posint) local i, rd, c, dt; rd := LinearAlgebra:-RowDimension(M); dt := Matrix(rd, rd); for i from dg to rd do dt[1+i-dg, 1] := M[1+i-dg, i] end do; return dt end proc

diag(A, 5)

Matrix(%id = 36893489695866397388)

diftab := proc (M::Matrix) local i, j, cl, rd; rd := LinearAlgebra:-RowDimension(M); for i from rd by -1 to 1 do if M[i, 1] = 0 then rd := rd-1 else break end if end do; cl := rd; for i from 2 to cl do for j to rd-i do M[j, i] := M[j+1, i-1]-M[j, i-1] end do end do; print(M); return M end proc

proc (M::Matrix) local i, j, cl, rd; rd := LinearAlgebra:-RowDimension(M); for i from rd by -1 to 1 do if M[i, 1] = 0 then rd := rd-1 else break end if end do; cl := rd; for i from 2 to cl do for j to rd-i do M[j, i] := M[j+1, i-1]-M[j, i-1] end do end do; print(M); return M end proc

diftab(diag(A, 4))

Matrix(%id = 36893489695866348116)

gnrpoly := proc (M::Matrix) local i, p, rd, n; rd := LinearAlgebra:-RowDimension(M); for i from rd by -1 to 1 do if M[1, i] = 0 then rd := rd-1 else break end if end do; p := 0; for i from 0 to rd-1 do p := p+M[1, i+1]*binomial(n, i) end do; return p end proc

proc (M::Matrix) local i, p, rd, n; rd := LinearAlgebra:-RowDimension(M); for i from rd by -1 to 1 do if M[1, i] = 0 then rd := rd-1 else break end if end do; p := 0; for i from 0 to rd-1 do p := p+M[1, i+1]*binomial(n, i) end do; return p end proc

"for i from 0 to 3 do print("Diagonal  ",i);   eqn:=gnrpoly(diftab(diag(A,i+1)));    cat(poly,i):=unapply(factor(expand(eqn)),n);    print("--------------------------------------------------------------");  end do"

"--------------------------------------------------------------"

NULL

``

``

The equations do not evaluate. They are acting inert

poly1(n)

(1/2)*n*(1+n)

poly1(2)

(1/2)*n*(1+n)

poly2(n)

(1/24)*n*(3*n+5)*(n+2)*(n+1)

poly2(3)

(1/24)*n*(3*n+5)*(n+2)*(n+1)

poly3(n)

(1/48)*n*(n+1)*(n+3)^2*(n+2)^2

poly3(-1)

(1/48)*n*(n+1)*(n+3)^2*(n+2)^2

eqn

6*n+38*binomial(n, 2)+93*binomial(n, 3)+111*binomial(n, 4)+65*binomial(n, 5)+15*binomial(n, 6)

value(eval(eqn, n = 4))

6*n+38*binomial(n, 2)+93*binomial(n, 3)+111*binomial(n, 4)+65*binomial(n, 5)+15*binomial(n, 6)

eqn1 := expand(eqn)

(3/4)*n+2*n^2+(97/48)*n^3+(47/48)*n^4+(11/48)*n^5+(1/48)*n^6

eval(eqn1, [n = 4])

(3/4)*n+2*n^2+(97/48)*n^3+(47/48)*n^4+(11/48)*n^5+(1/48)*n^6

NULL


 

Download Q_10-10-22_gentrate_eqn.mw

convert(series(f(x),x,10),list) will produce a list with exponents rather than 0's. Is there a natural way to simply get a list with 0 padding? Also, can one make their own type converter?  (obviously I can make a procedure but talking about something in accordance with convert)

I have never use Maple before and have the following equation

ca, cb, Ka, Kb, Kw and Va are either constants or pre-determined (Va).  I know it should be easy to tabulate/calculate values of Vb for given values of [H+] (hydrogen ion concentration) but how easy would it be to determine values of [H+] for selected values of Vb?  Would it be easy to set up bearing in mind my lack of experience?

Hi everyone 

I would like to plot something in 3d. I have to functions both depending on the time. (x(t), z(t))

I can plot in 2d: (t, x(t)) or (t,z(t)) or (x(t), z(t)) 

Now I want to show the flight path (x(t), z(t)) over time t. So I thought a 3d plot would be suitable for this. 

The problem is that I dont know how to plot this. With plot3d I am only able to plot some planes. What I want to plot is the flight path in the 3d room with the axis x(t),z(t) and t.

Does anybody know how to do this?

thanks in advance!

L’éventail de la Geisha
restart:with(plots):with(geometry):
NULL;
_EnvHorizontalName := 'x':
_EnvVerticalName := 'y':

NULL;
EqBIS := proc(P, U, V) 
local a, eq1, M1, t, PU, PV, bissec1; 
description "P est le sommet de l'angle dont on chercche la bissectrice" ;
a := (P - U)/LinearAlgebra:-Norm(P - U, 2) + (P - V)/LinearAlgebra:-Norm(P - V, 2); 
M1 := P + a*t; eq1 := op(eliminate({x = M1[1], y = M1[2]}, t)); 
RETURN(op(eq1[2])); end proc:

with(plottools);
with(plots);


r1 := 1/2;
r2 := r1/2;
R := r1*(21 - 12*sqrt(3));
                            21      (1/2)
                       R := -- - 6 3     
                            2            

a := arc([0, 0], 2*r1, Pi/6 .. (5*Pi)/6);
b := arc([0, 0], r1, Pi/6 .. (5*Pi)/6);


with(geometry);
eq := EqBIS(<sqrt(3)/2, 1/2>, <0, 0>, <0, 1/2>);
line(bis, eq);
                         (1/2)                  
                eq := 2 3      y - 2 x + 4 y - 2

                              bis

OpT := 2*sqrt(r1*R);
line(lv, x = OpT);
intersection(Omega, bis, lv);
coordinates(Omega);
evalf(%);
                                (1/2)    
                      OpT := 2 3      - 3

                               lv

                             Omega

                 [                / (1/2)    \]
                 [   (1/2)      2 \3      - 1/]
                 [2 3      - 3, --------------]
                 [                     (1/2)  ]
                 [                2 + 3       ]

                  [0.464101616, 0.3923048456]

retarrt;
with(plots);
with(plottools);
[cos((5*Pi)/6), sin((5*Pi)/6)];
                        [  1  (1/2)  1]
                        [- - 3     , -]
                        [  2         2]

a := arc([0, 0], 2*r1, Pi/6 .. (5*Pi)/6);
b := arc([0, 0], r1, Pi/6 .. (5*Pi)/6);
NULL;
A:=[cos(Pi/6), sin(Pi/6)];
B:=[cos(5*Pi/6), sin(5*Pi/6)];
Oo:=[0,0];
Op:=[0,1/2];
poly:=[A,B,Oo];
R := r1*(21 - 12*sqrt(3))
                            [1  (1/2)  1]
                       A := [- 3     , -]
                            [2         2]

                           [  1  (1/2)  1]
                      B := [- - 3     , -]
                           [  2         2]

                          Oo := [0, 0]

                                [   1]
                          Op := [0, -]
                                [   2]

                [[1  (1/2)  1]  [  1  (1/2)  1]        ]
        poly := [[- 3     , -], [- - 3     , -], [0, 0]]
                [[2         2]  [  2         2]        ]

                            21      (1/2)
                       R := -- - 6 3     
                            2            


Omega := [2*sqrt(3) - 3, 2*(sqrt(3) - 1)/(2 + sqrt(3))];
Omega1 := [3 - 2*sqrt(3), 2*(sqrt(3) - 1)/(2 + sqrt(3))];

                     [                / (1/2)    \]
                     [   (1/2)      2 \3      - 1/]
            Omega := [2 3      - 3, --------------]
                     [                     (1/2)  ]
                     [                2 + 3       ]

                     [                 / (1/2)    \]
                     [    (1/2)      2 \3      - 1/]
           Omega1 := [-2 3      + 3, --------------]
                     [                      (1/2)  ]
                     [                 2 + 3       ]


r3 := 3/16;
EF := sqrt(r3);

                                  3 
                            r3 := --
                                  16

                               1  (1/2)
                         EF := - 3     
                               4       

r := (150 - 72*sqrt(3))/193*1/2;
alpha := -5/3*r + 1/2*1/2;
p := sqrt(3)/3*1/2 - sqrt(3)/18*r;
                          75    36   (1/2)
                     r := --- - --- 3     
                          193   193       

                             307   60   (1/2)
                  alpha := - --- + --- 3     
                             772   193       

               1  (1/2)   1   (1/2) /75    36   (1/2)\
          p := - 3      - -- 3      |--- - --- 3     |
               6          18        \193   193       /

p2 := textplot([[A[], "A"], [B[], "B"], [Oo[], "O"]], align = ["above", "right"]);
display(a, b, p2, polygonplot(poly, thickness = 3, color = blue, transparency = 0.3), circle(Omega, R, color = blue, filled = true), circle(Omega1, R, color = blue, filled = true), circle([0, 3/4], 1/4, color = yellow, filled = true), circle([EF, 1/2 + r3], r3, color = green, filled = true), circle([-EF, 1/2 + r3], r3, color = green, thickness = 5), circle([p, 3/4 + alpha], r, color = red, thickness = 5), circle([-p, 3/4 + alpha], r, color = red, thickness = 5), axes = none, scaling = constrained, size = [500, 500]);
how to put color inside circles ? Thabk you.

There are a couple of warnings in the Maple Code Editor that are unneccessary. Those are valid parameters of in Maple functions.

Would it be possible to have those removed in future editions?

Info: Line 794: These names were used as global names but were not declared: enabled
Info: Line 837: These names were used as global names but were not declared: itemList
Info: Line 847: These names were used as global names but were not declared: nolist
Info: Line 854: These names were used as global names but were not declared: selectedindex
Info: Line 905: These names were used as global names but were not declared: nolist
Info: Line 910: These names were used as global names but were not declared: itemList
Info: Line 911: These names were used as global names but were not declared: selectedindex
Info: Line 961: These names were used as global names but were not declared: enabled
Info: Line 992: These names were used as global names but were not declared: unit_free

First 150 151 152 153 154 155 156 Last Page 152 of 2097