zenterix

400 Reputation

5 Badges

2 years, 363 days

MaplePrimes Activity


These are questions asked by zenterix

In the code below, I define an expression, then turn it into a function of omega_d.

Consider the results (5) and (6) below.

I take the derivative of the function relative to omega_d, set the derivative to zero and ask Maple to solve for the critical point (ie, the omega_d at which the derivative is zero).

I get the correct result in (5), ie three different critical points. But when I simplify this result, Maple returns only one of the critical points.

Why?

restart

expr := f/sqrt((`ω__0`^2-`ω__d`^2)^2+`γ__b`^2*`ω__d`^2)

f/((omega__0^2-omega__d^2)^2+gamma__b^2*omega__d^2)^(1/2)

(1)

A := unapply(expr, `ω__d`)

proc (omega__d) options operator, arrow; f/((omega__0^2-omega__d^2)^2+gamma__b^2*omega__d^2)^(1/2) end proc

(2)

diff(A(`ω__d`), `ω__d`)

-(1/2)*f*(-4*(omega__0^2-omega__d^2)*omega__d+2*gamma__b^2*omega__d)/((omega__0^2-omega__d^2)^2+gamma__b^2*omega__d^2)^(3/2)

(3)

simplify(diff(A(`ω__d`), `ω__d`))

-f*omega__d*(gamma__b^2-2*omega__0^2+2*omega__d^2)/(omega__d^4+(gamma__b^2-2*omega__0^2)*omega__d^2+omega__0^4)^(3/2)

(4)

solve(diff(A(`ω__d`), `ω__d`) = 0, `ω__d`)

0, (1/2)*(-2*gamma__b^2+4*omega__0^2)^(1/2), -(1/2)*(-2*gamma__b^2+4*omega__0^2)^(1/2)

(5)

simplify(solve(diff(A(`ω__d`), `ω__d`) = 0, `ω__d`))

0

(6)

NULL


This was a problem for me just now because I used the command in (6) first and just could not figure out what the heck was going on. I did the calculations by hand to check, and then finally found out it was this simplify command.

Download simplifysolve.mw

Why doesn't evalf work on the data structures below?
 

M1 := Matrix([[m__1, m__2]])

Matrix(%id = 36893488151929448556)

(1)

M := [M1, M1]

[Matrix(%id = 36893488151929448556), Matrix(%id = 36893488151929448556)]

(2)

m__1 := 1; m__2 := 2

M

[Matrix(%id = 36893488151929448556), Matrix(%id = 36893488151929448556)]

(3)

evalf(M)

[Matrix(%id = 36893488151929440844), Matrix(%id = 36893488151929440964)]

(4)

evalf(M[1])

Matrix(%id = 36893488151929437108)

(5)

evalf(op(M))

Matrix(%id = 36893488151929432292), Matrix(%id = 36893488151929432412)

(6)

evalf(op(M[1]))

1., 2., {(1., 1.) = m__1, (1., 2.) = m__2}, datatype = anything, storage = rectangular, order = Fortran_order, shape = []

(7)

NULL


 

Download evalf.mw

Why does sqrt(-2) give as a result only i*sqrt(2)?

Why does the result not also include -i*sqrt(2)?

Suppose we have the following simple Matrix

T := <1,2;3,4>;

How do we replace an entry with another expression?

I know that for a list L := [1,2,3] we can do, for example subsop(2=500,L) to replace the entry at index 2.

This creates a new list since lists are immutable.

As far as I can tell, a Matrix is mutable.

However, I wish to change an entry in a Matrix without mutating it.

My actual use case is the following.

I use LinearAlgebra:-Eigenvectors to obtain a Matrix of eigenvectors. Some of the entries are huge expressions with many variables. I would like to sub in placeholders where these huge expressions are so I can visualize the Matrix better, but without modifying the original Matrix.

In the Programming Guide, Ch. 3 "Maple Expressions", subsection 3.13 "Other Expressions" there is a section called "Composition".

There is the following snippet

In particular, although the inverses of the circular functions are commonly denoted by a power-like notation in written mathematics, in Maple, for example, sin^(-1) denotes the reciprocal of the sin function, while sin@@(-1) denotes the arcsine (arcsin).

I opened a new worksheet to check this. I found the results confusing.

1/sin

1/sin

(1)

arcsin(x)

arcsin(x)

(2)

sin^(-1)

1/sin

(3)

sin^(-1)(x)

1/sin

(4)

(sin^(-1))(x)

1/sin(x)

(5)

sin@@(-1)

arcsin

(6)

sin@@(-1)*x

arcsin*x

(7)

sin@@(-1)

arcsin

(8)

sin@@(-1)(x)

arcsin

(9)

(sin@@(-1))(x)

arcsin(x)

(10)

NULL

 

Consider (1) and (2). 

(1) is in accordance with the quoted snippet: sin^(-1) is the reciprocal of the sine function. But when we use this same expression as a function call, the function that is called is arcsine. Does this make sense to be this way?

Next, consider (3), (4), and (5), which I expected to be the same expressions as (1), (2) and (2), respectively. The only difference is that (1) and (2) use 2D math and (3), (4), and (5) use Maple input.

Both results using Maple input give as output the reciprocal of sine.

Why is there this difference between the 2D version and the Maple input version?

Consider (4) and (5). Why is it that we need to add parentheses for the argument x to be applied to the function?

Finally, what is the reasoning behind the syntax sin@@(-1) denoting arcsine?

@@ represents repeated composition. sin@@3 represents the function sin(sin(sin))). 

Is sin@@(-1) equal to arcsine simply by convention or is there some logical reason?

Download Repeated_Composition.mw

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