Items tagged with simplify simplify Tagged Items Feed

I am trying to simplify sums of a few LaguerreL polinomials of different n using the identities in the function advisor such as recurrsion relations. How does one go about in using the FunctionAdvisor identities when trying to simplify expressions containing orthogonal polynomials? 

 

 

I am trying to simplify equation 18 using equations 8 and 9. It should look a little like equation 21, but instead I get the results in equations 19 and 20.  I tried using different substituions, but algsubs gets the closest answer. A few terms are going to zero after the substitution.

When I substitute Z(X) then Zbar(X) terms vanish, and visa versa.


Initialize the metric and tetrad

 

restart; with(Physics); with(Tetrads)

0, "%1 is not a command in the %2 package", Tetrads, Physics

(1.1)

X = [zetabar, zeta, v, u]

X = [zetabar, zeta, v, u]

(1.2)

ds2 := Physics:-`*`(Physics:-`*`(2, dzeta), dzetabar)+Physics:-`*`(Physics:-`*`(2, du), dv)+Physics:-`*`(Physics:-`*`(2, H(zetabar, zeta, v, u)), (du+Physics:-`*`(Ybar(zetabar, zeta, v, u), dzeta)+Physics:-`*`(Y(zetabar, zeta, v, u), dzetabar)-Physics:-`*`(Physics:-`*`(Y(zetabar, zeta, v, u), Ybar(zetabar, zeta, v, u)), dv))^2)

2*dzeta*dzetabar+2*du*dv+2*H(zetabar, zeta, v, u)*(du+Ybar(zetabar, zeta, v, u)*dzeta+Y(zetabar, zeta, v, u)*dzetabar-Y(zetabar, zeta, v, u)*Ybar(zetabar, zeta, v, u)*dv)^2

(1.3)

PDEtools:-declare(ds2)

Ybar(zetabar, zeta, v, u)*`will now be displayed as`*Ybar

(1.4)

NULL

vierbien = Matrix([[1, 0, -Ybar(zetabar, zeta, v, u), 0], [0, 1, -Y(zetabar, zeta, v, u), 0], [Physics:-`*`(H(zetabar, zeta, v, u), Y(zetabar, zeta, v, u)), Physics:-`*`(H(zetabar, zeta, v, u), Ybar(zetabar, zeta, v, u)), 1-Physics:-`*`(Physics:-`*`(H(zetabar, zeta, v, u), Y(zetabar, zeta, v, u)), Ybar(zetabar, zeta, v, u)), H(zetabar, zeta, v, u)], [Y(zetabar, zeta, v, u), Ybar(zetabar, zeta, v, u), -Physics:-`*`(Y(zetabar, zeta, v, u), Ybar(zetabar, zeta, v, u)), 1]])

vierbien = (Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = -Ybar(zetabar, Zeta, v, u), (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = -Y(zetabar, Zeta, v, u), (2, 4) = 0, (3, 1) = H(zetabar, Zeta, v, u)*Y(zetabar, Zeta, v, u), (3, 2) = H(zetabar, Zeta, v, u)*Ybar(zetabar, Zeta, v, u), (3, 3) = 1-H(zetabar, Zeta, v, u)*Y(zetabar, Zeta, v, u)*Ybar(zetabar, Zeta, v, u), (3, 4) = H(zetabar, Zeta, v, u), (4, 1) = Y(zetabar, Zeta, v, u), (4, 2) = Ybar(zetabar, Zeta, v, u), (4, 3) = -Y(zetabar, Zeta, v, u)*Ybar(zetabar, Zeta, v, u), (4, 4) = 1}))

(1.5)

``

NULL

Setup(tetrad = rhs(vierbien = Matrix(%id = 18446744078408794830)), metric = ds2, mathematicalnotation = true, automaticsimplification = true, coordinatesystems = (X = [zetabar, zeta, v, u]), signature = "+++-")

[automaticsimplification = true, coordinatesystems = {X}, mathematicalnotation = true, metric = {(1, 1) = 2*H(X)*Y(X)^2, (1, 2) = 1+2*H(X)*Y(X)*Ybar(X), (1, 3) = -2*H(X)*Y(X)^2*Ybar(X), (1, 4) = 2*H(X)*Y(X), (2, 2) = 2*H(X)*Ybar(X)^2, (2, 3) = -2*H(X)*Ybar(X)^2*Y(X), (2, 4) = 2*H(X)*Ybar(X), (3, 3) = 2*H(X)*Y(X)^2*Ybar(X)^2, (3, 4) = 1-2*H(X)*Y(X)*Ybar(X), (4, 4) = 2*H(X)}, signature = `+ + + -`, tetrad = {(1, 1) = 1, (1, 3) = -Ybar(X), (2, 2) = 1, (2, 3) = -Y(X), (3, 1) = H(X)*Y(X), (3, 2) = H(X)*Ybar(X), (3, 3) = 1-H(X)*Y(X)*Ybar(X), (3, 4) = H(X), (4, 1) = Y(X), (4, 2) = Ybar(X), (4, 3) = -Y(X)*Ybar(X), (4, 4) = 1}]

(1.6)

``

Verification of Tetrad

 

I will try to verify the tetrad from (Kerr and Schild (1965)). However, the tetrad given in the paper seems to have the third tetrad with the wrong sign. I changed the sign and get the correct verification,

    e_[]

`𝔢`[a, mu] = (Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = -Ybar(X), (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = -Y(X), (2, 4) = 0, (3, 1) = H(X)*Y(X), (3, 2) = H(X)*Ybar(X), (3, 3) = 1-H(X)*Y(X)*Ybar(X), (3, 4) = H(X), (4, 1) = Y(X), (4, 2) = Ybar(X), (4, 3) = -Y(X)*Ybar(X), (4, 4) = 1}))

(2.1)

g_[]

g[mu, nu] = (Matrix(4, 4, {(1, 1) = 2*H(X)*Y(X)^2, (1, 2) = 1+2*H(X)*Y(X)*Ybar(X), (1, 3) = -2*H(X)*Y(X)^2*Ybar(X), (1, 4) = 2*H(X)*Y(X), (2, 1) = 1+2*H(X)*Y(X)*Ybar(X), (2, 2) = 2*H(X)*Ybar(X)^2, (2, 3) = -2*H(X)*Ybar(X)^2*Y(X), (2, 4) = 2*H(X)*Ybar(X), (3, 1) = -2*H(X)*Y(X)^2*Ybar(X), (3, 2) = -2*H(X)*Ybar(X)^2*Y(X), (3, 3) = 2*H(X)*Y(X)^2*Ybar(X)^2, (3, 4) = 1-2*H(X)*Y(X)*Ybar(X), (4, 1) = 2*H(X)*Y(X), (4, 2) = 2*H(X)*Ybar(X), (4, 3) = 1-2*H(X)*Y(X)*Ybar(X), (4, 4) = 2*H(X)}))

(2.2)

Physics:-`*`(e_[a, mu], e_[a, nu]) = g_[mu, nu]

Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[`~a`, nu] = Physics:-g_[mu, nu]

(2.3)

TensorArray(Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[`~a`, nu] = Physics:-g_[mu, nu])

Matrix(4, 4, {(1, 1) = 2*H(X)*Y(X)^2 = 2*H(X)*Y(X)^2, (1, 2) = 1+2*H(X)*Y(X)*Ybar(X) = 1+2*H(X)*Y(X)*Ybar(X), (1, 3) = -2*H(X)*Y(X)^2*Ybar(X) = -2*H(X)*Y(X)^2*Ybar(X), (1, 4) = 2*H(X)*Y(X) = 2*H(X)*Y(X), (2, 1) = 1+2*H(X)*Y(X)*Ybar(X) = 1+2*H(X)*Y(X)*Ybar(X), (2, 2) = 2*H(X)*Ybar(X)^2 = 2*H(X)*Ybar(X)^2, (2, 3) = -2*H(X)*Ybar(X)^2*Y(X) = -2*H(X)*Ybar(X)^2*Y(X), (2, 4) = 2*H(X)*Ybar(X) = 2*H(X)*Ybar(X), (3, 1) = -2*H(X)*Y(X)^2*Ybar(X) = -2*H(X)*Y(X)^2*Ybar(X), (3, 2) = -2*H(X)*Ybar(X)^2*Y(X) = -2*H(X)*Ybar(X)^2*Y(X), (3, 3) = 2*H(X)*Y(X)^2*Ybar(X)^2 = 2*H(X)*Y(X)^2*Ybar(X)^2, (3, 4) = 1-2*H(X)*Y(X)*Ybar(X) = 1-2*H(X)*Y(X)*Ybar(X), (4, 1) = 2*H(X)*Y(X) = 2*H(X)*Y(X), (4, 2) = 2*H(X)*Ybar(X) = 2*H(X)*Ybar(X), (4, 3) = 1-2*H(X)*Y(X)*Ybar(X) = 1-2*H(X)*Y(X)*Ybar(X), (4, 4) = 2*H(X) = 2*H(X)})

(2.4)

Physics:-`*`(e_[a, mu], e_[b, mu]) = eta_[a, b]

Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[b, `~mu`] = Physics:-Tetrads:-eta_[a, b]

(2.5)

NULL

TensorArray(Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[b, `~mu`] = Physics:-Tetrads:-eta_[a, b])

Matrix(4, 4, {(1, 1) = 0 = 0, (1, 2) = 1 = 1, (1, 3) = 0 = 0, (1, 4) = 0 = 0, (2, 1) = 1 = 1, (2, 2) = 0 = 0, (2, 3) = 0 = 0, (2, 4) = 0 = 0, (3, 1) = 0 = 0, (3, 2) = 0 = 0, (3, 3) = 0 = 0, (3, 4) = 1 = 1, (4, 1) = 0 = 0, (4, 2) = 0 = 0, (4, 3) = 1 = 1, (4, 4) = 0 = 0})

(2.6)

``

gamma_[4, 2, 1]

diff(Y(X), zeta)-(diff(Y(X), u))*Ybar(X)

(2.7)

SumOverRepeatedIndices(Physics:-`*`(Physics:-`*`(D_[nu](e_[4, mu]), e_[2, mu]), e_[1, `~nu`]))

diff(Y(X), zeta)-(diff(Y(X), u))*Ybar(X)

(2.8)

NULL

``

For equation 2.8 we get the following:

SumOverRepeatedIndices(Physics:-`*`(Physics:-`*`(Riemann[`~sigma`, rho, mu, nu], e_[4, `~rho`]), e_[4, `~nu`]))

(-Physics:-Riemann[`~sigma`, 4, 4, mu]*Y(X)^2+(Physics:-Riemann[`~sigma`, 4, 1, mu]+Physics:-Riemann[`~sigma`, 1, 4, mu])*Y(X)-Physics:-Riemann[`~sigma`, 1, 1, mu])*Ybar(X)^2+((Physics:-Riemann[`~sigma`, 2, 4, mu]+Physics:-Riemann[`~sigma`, 4, 2, mu])*Y(X)^2+(-Physics:-Riemann[`~sigma`, 2, 1, mu]+Physics:-Riemann[`~sigma`, 3, 4, mu]+Physics:-Riemann[`~sigma`, 4, 3, mu]-Physics:-Riemann[`~sigma`, 1, 2, mu])*Y(X)-Physics:-Riemann[`~sigma`, 3, 1, mu]-Physics:-Riemann[`~sigma`, 1, 3, mu])*Ybar(X)-Physics:-Riemann[`~sigma`, 2, 2, mu]*Y(X)^2+(-Physics:-Riemann[`~sigma`, 2, 3, mu]-Physics:-Riemann[`~sigma`, 3, 2, mu])*Y(X)-Physics:-Riemann[`~sigma`, 3, 3, mu]

(1)

 

Now we replicate eqn 2.16. These are the conditions for e[4,mu] to be geodesic and shear-free. The outputs are eqn 3.5.

 

gamma_[4, 1, 1] = 0

diff(Ybar(X), zeta)-(diff(Ybar(X), u))*Ybar(X) = 0

(2)

gamma_[4, 2, 2] = 0

diff(Y(X), zetabar)-(diff(Y(X), u))*Y(X) = 0

(3)

gamma_[1, 4, 4] = 0

(diff(Ybar(X), u))*Y(X)*Ybar(X)-Y(X)*(diff(Ybar(X), zeta))-Ybar(X)*(diff(Ybar(X), zetabar))-(diff(Ybar(X), v)) = 0

(4)

gamma_[2, 4, 4] = 0

(diff(Y(X), u))*Y(X)*Ybar(X)-Y(X)*(diff(Y(X), zeta))-(diff(Y(X), zetabar))*Ybar(X)-(diff(Y(X), v)) = 0

(5)

gamma_[3, 4, 4] = 0

0 = 0

(6)

gamma_[4, 4, 4] = 0

0 = 0

(7)

shearconditions := {diff(Y(X), zetabar)-(diff(Y(X), u))*Y(X) = 0, diff(Ybar(X), zeta)-(diff(Ybar(X), u))*Ybar(X) = 0, (diff(Y(X), u))*Y(X)*Ybar(X)-Y(X)*(diff(Y(X), zeta))-(diff(Y(X), zetabar))*Ybar(X)-(diff(Y(X), v)) = 0, (diff(Ybar(X), u))*Y(X)*Ybar(X)-Y(X)*(diff(Ybar(X), zeta))-Ybar(X)*(diff(Ybar(X), zetabar))-(diff(Ybar(X), v)) = 0}:

 

Now we can define the rotation coefficients associated with rotation and expansion z = theta - i omega

 

gamma_[2, 4, 1] = Z(X)

-(diff(Y(X), zeta))+(diff(Y(X), u))*Ybar(X) = Z(X)

(8)

gamma_[1, 4, 2] = Zbar(X)

-(diff(Ybar(X), zetabar))+(diff(Ybar(X), u))*Y(X) = Zbar(X)

(9)

PDEtools:-declare(Z(X), Zbar(X))

Zbar(zetabar, zeta, v, u)*`will now be displayed as`*Zbar

(10)

Zdefinitions := {-(diff(Y(X), zeta))+(diff(Y(X), u))*Ybar(X) = Z(X), -(diff(Ybar(X), zetabar))+(diff(Ybar(X), u))*Y(X) = Zbar(X)}

{-(diff(Y(X), zeta))+(diff(Y(X), u))*Ybar(X) = Z(X), -(diff(Ybar(X), zetabar))+(diff(Ybar(X), u))*Y(X) = Zbar(X)}

(11)

We now show that the tetrad vectors are propogated parallel along each curve of the congruence of null geodesics which have e[4,~mu] as tangents.

 

   

We now use the tetrad form of the Ricci tensor. In order to use this in Maple we need to create a Ricci Tensor Tetrad function.

 

RicciT := proc (a, b) options operator, arrow; SumOverRepeatedIndices(Ricci[mu, nu]*e_[a, `~mu`]*e_[b, `~nu`]) end proc

proc (a, b) options operator, arrow; Physics:-SumOverRepeatedIndices(Physics:-`*`(Physics:-`*`(Physics:-Ricci[mu, nu], Physics:-Tetrads:-e_[a, `~mu`]), Physics:-Tetrads:-e_[b, `~nu`])) end proc

(12)

SlashD := proc (f, a) options operator, arrow; SumOverRepeatedIndices(D_[b](f)*e_[a, `~b`]) end proc

proc (f, a) options operator, arrow; Physics:-SumOverRepeatedIndices(Physics:-`*`(Physics:-D_[b](f), Physics:-Tetrads:-e_[a, `~b`])) end proc

(13)

SlashD(f(X), 1)

diff(f(X), zeta)-Ybar(X)*(diff(f(X), u))

(14)

SlashD(f(X), 2)

diff(f(X), zetabar)-Y(X)*(diff(f(X), u))

(15)

SlashD(f(X), 3)

(1+H(X)*Y(X)*Ybar(X))*(diff(f(X), u))-H(X)*((diff(f(X), zeta))*Y(X)+Ybar(X)*(diff(f(X), zetabar))+diff(f(X), v))

(16)

SlashD(f(X), 4)

-Y(X)*Ybar(X)*(diff(f(X), u))+(diff(f(X), zeta))*Y(X)+Ybar(X)*(diff(f(X), zetabar))+diff(f(X), v)

(17)

NULL

The geodesic and shear free condition given by Lemma 1 in (Goldberg and Sachs (1962)). Kerr uses the fourth tetrad instead of the third so we need to modify the Ricci tensor conditions. The equations (2) - (5) enforce the first Lemma.

 

   

 

Notice that none of the previous Ricci conditions can be used to solve for H.  We can use the remaining field equations to find the partial differential equations necessary to derive the metric.

 

  simplify(RicciT(1, 2), shearconditions) = 0

H(X)*(diff(diff(Y(X), zeta), zetabar))*Ybar(X)-H(X)*Ybar(X)*Y(X)*(diff(diff(Ybar(X), u), zetabar))-H(X)*Ybar(X)^2*(diff(diff(Y(X), u), zetabar))-H(X)*Y(X)^2*(diff(diff(Ybar(X), u), zeta))-2*H(X)*Y(X)*Ybar(X)*(diff(diff(Y(X), u), zeta))+H(X)*Y(X)^2*Ybar(X)*(diff(diff(Ybar(X), u), u))-H(X)*Y(X)*(diff(diff(Ybar(X), u), v))+H(X)*Y(X)*Ybar(X)^2*(diff(diff(Y(X), u), u))-H(X)*(diff(diff(Y(X), u), v))*Ybar(X)+H(X)*(diff(Ybar(X), zetabar))^2+(-3*H(X)*Y(X)*(diff(Ybar(X), u))-(diff(H(X), u))*Y(X)*Ybar(X)+(diff(H(X), zeta))*Y(X)+(diff(H(X), zetabar))*Ybar(X)+diff(H(X), v))*(diff(Ybar(X), zetabar))+H(X)*(diff(Y(X), zeta))^2+(-4*H(X)*(diff(Y(X), u))*Ybar(X)-(diff(H(X), u))*Y(X)*Ybar(X)+(diff(H(X), zeta))*Y(X)+(diff(H(X), zetabar))*Ybar(X)+diff(H(X), v))*(diff(Y(X), zeta))+2*H(X)*Y(X)^2*(diff(Ybar(X), u))^2-Y(X)*(-(diff(H(X), u))*Y(X)*Ybar(X)+(diff(H(X), zeta))*Y(X)+(diff(H(X), zetabar))*Ybar(X)+diff(H(X), v))*(diff(Ybar(X), u))+2*(H(X)*(diff(Y(X), u))*Ybar(X)+(1/2)*(diff(H(X), u))*Y(X)*Ybar(X)-(1/2)*(diff(H(X), zeta))*Y(X)-(1/2)*(diff(H(X), zetabar))*Ybar(X)-(1/2)*(diff(H(X), v)))*(diff(Y(X), u))*Ybar(X) = 0

(18)

-(diff(H(X), zetabar))*Ybar(X)*Z(X)-Y(X)*(diff(H(X), zeta))*Z(X)-H(X)*(diff(Y(X), zeta))^2+Z(X)*((diff(H(X), u))*Y(X)*Ybar(X)+2*H(X)*Z(X)-(diff(H(X), v))) = 0

-(diff(H(X), zetabar))*Ybar(X)*Z(X)-(diff(H(X), zeta))*Y(X)*Z(X)-H(X)*(diff(Y(X), zeta))^2-Z(X)*(-(diff(H(X), u))*Y(X)*Ybar(X)-2*H(X)*Z(X)+diff(H(X), v)) = 0

(19)

Zbar(X)*(-(diff(H(X), v))-(diff(H(X), zetabar))*Ybar(X)-(diff(H(X), zeta))*Y(X)+(diff(H(X), u))*Y(X)*Ybar(X)+H(X)*(diff(Ybar(X), zetabar)+2*Zbar(X))) = 0

-Zbar(X)*(-(diff(H(X), u))*Y(X)*Ybar(X)+(diff(H(X), zeta))*Y(X)+(diff(H(X), zetabar))*Ybar(X)-H(X)*(diff(Ybar(X), zetabar))-2*H(X)*Zbar(X)+diff(H(X), v)) = 0

(20)

Physics:-`*`(SlashD(H(X), 4), Z(X)+Zbar(X)) = Physics:-`*`(H(X), SlashD(Z(X), 4)+SlashD(Zbar(X), 4))

-(-(diff(H(X), v))-(diff(H(X), zeta))*Y(X)+Ybar(X)*((diff(H(X), u))*Y(X)-(diff(H(X), zetabar))))*(Z(X)+Zbar(X)) = H(X)*(-Y(X)*Ybar(X)*(diff(Z(X), u))+Ybar(X)*(diff(Z(X), zetabar))+Y(X)*(diff(Z(X), zeta))+diff(Z(X), v)-Y(X)*Ybar(X)*(diff(Zbar(X), u))+Ybar(X)*(diff(Zbar(X), zetabar))+Y(X)*(diff(Zbar(X), zeta))+diff(Zbar(X), v))

(21)

``

NULL

NULL


Download Deriving_the_Kerr_Metric.mw

Hello all,

 

I'm experiencing an aggravating issue when substituting numerical values into a symbolic expression.  I'm using Maple 14.  I believe the issue may be related to floating point precision.  Either way, it's ruining my life.  If anyone has a solution or a work-around, I'd be most grateful.  The following code reproducibly produces the anomolay on my machine:

 

vx := Vector( 4, symbol=x ):

# A numerator and a denominator. They're equal.
num := (x[1]*x[3]+x[1]*x[4]+x[2]*x[3]+x[2]*x[4])^2:
den := ((x[1]+x[2])^2*(x[3]+x[4])^2):

# Prints true...
evalb(num=den);

# This equals zero
y := 0.1 - 0.1*num/den;

# Prints 0...
simplify(y);

# Prints 0...
simplify(subs(x[3]=1,x[4]=3,0.1-0.1*num/den));

# Prints 0...
simplify(subs(x[3]=1,x[4]=3,y));

# Prints 0.1 x 10^-10 !?!?
simplify(subs(x[3]=1,x[4]=2,y));

 

Hi all.

I try to get the real part from the complex expression. But it turns out to not be the simplest result:

A:=I*sin(k*Pi*(x-h*cos(theta))/a)*sin(l*Pi*(y-h*sin(theta))/b)*exp(-I*k[0]*h)*sin(k*Pi*x/a)*sin(l*Pi*y/b)

convert(exp(-I*k[0]*h), sin);

simplify(Re(A));

Maple results in:

Re(sin(k*Pi*(-x+h*cos(theta))/a)*sin(l*Pi*(-y+h*sin(theta))/b)*exp(-I*k[0]*h)*sin(k*Pi*x/a)*sin(l*Pi*y/b))

while the simplified result should be:

sin(k*Pi*(x-h*cos(theta))/a)*sin(l*Pi*(y-h*sin(theta))/b)*sin(k*Pi*x/a)*sin(l*Pi*y/b)*sin(k[0]*h)

 

I wander how to get the simplifyed result in maple. Thanks

there is a solution of equation,so the equation can be divided by the solution,but because the equation is complex,it can't be simplify by the soution,can anyone give me some help?thanks a lot.


I am trying to do a substitution as shown in the attached document. I know variants of this question have been asked before but dont quiet get what to do. It is problem with algsubs and how it handles denominators I think. Can get substiturion to work for simple fractions but more complicated ones fail. Would appreciate any guidance here.

restart 

``

``

CR := proc (a, b, c, d) options operator, arrow; (a-c)*(b-d)/((a-d)*(b-c)) end proc

proc (a, b, c, d) options operator, arrow; (a-c)*(b-d)/((a-d)*(b-c)) end proc

(1)

eqns := CR(a, b, c, d)

(a-c)*(b-d)/((a-d)*(b-c))

(2)

e1 := CR(b, a, c, d)

(b-c)*(a-d)/((b-d)*(a-c))

(3)

simplify(e1, {(a-c)*(b-d)/((a-d)*(b-c)) = lambda})

(a*b-a*c-b*d+c*d)/(a*b-a*d-b*c+c*d)

(4)

e1

(b-c)*(a-d)/((b-d)*(a-c))

(5)

``

lambda

lambda

(6)

applyrule((a-c)*(b-d)/((a-d)*(b-c)) = lambda, e1)

(b-c)*(a-d)/((b-d)*(a-c))

(7)

alias(lambda = (a-c)*(b-d)/((a-d)*(b-c)))

lambda

(8)

e1

(b-c)*(a-d)/((b-d)*(a-c))

(9)

``

NULL

``

f := a/b

a/b

(10)

``

f := algsubs(a/b = alpha, f)

alpha

(11)

f

alpha

(12)

algsubs((a-c)*(b-d)/((a-d)*(b-c)) = lambda, e1)

Error, (in algsubs) cannot compute degree of pattern in a

 

``

 

Download UHG5_substitution.mw

Why this simplifes:

z1:=n*(Int(cos(x)^(n-2), x))-(Int(cos(x)^(n-2), x));

simplify(z1);

But when adding an extra term to z1, it no longer simplfies the above any more:

z2 := cos(x)^(n-1)*sin(x)+n*(Int(cos(x)^(n-2), x))-(Int(cos(x)^(n-2), x));

simplify(z2);

You can see the second term, which is z1, was not simplfied any more.

Why? And how would one go about simplifying z2 such that the second term gets simplfies as with z1, but while using z2 expression. It seems simplify stopped at first term and did not look ahead any more?

Maple 18.02, windows.

Hi,

I use the VectorCalculus package to calcutate derivative formula for geometric functions, and met difficulity simplifying the result expression.

For example, I define some vectors P, S, V like below:

P:=<Px, Py, Pz>, S:=<Sx, Sy, Sz>, V:=<Vx, Vy, Vz>

then define an intermediate variable Q:=P - S,

then define a function d:= sqrt(DotProduct(Q, Q)-(DotProuct(Q,V))^2)

by calculating the function's derivative w.r.t Px I got a very complex result expression:

dpx:=1/2 * (2Px - 2Sx - 2 ( (Px - Sx) Vx + (Py - Sy) Vy + (Pz - Sz)Vz )Vx ) / (sqrt( (Px-Sx)^2 + (Py-Sy)^2 + (Pz-Sz)^2 - .....)

 

Apparently this expression can be simplified by substituting its sub-expression with pre-defined variables like Q and d.

I know I can use subs, eval, and subsalg to do it manually:

subs(1/(sqrt( (Px-Sx)^2 + (Py-Sy)^2 + (Pz-Sz)^2 - .....) = 1/dv, dfdpx)

subs((Px - Sx) Vx + (Py - Sy) Vy + (Pz - Sz)Vz = dotproduct_q_v, dfdpx)

and I can get a simplified expression like this:

(qx-dotproduct_q_v*vx)/d

 

But it's like my brain does the simplification first, and Maple only does the text substitution for me.

Is there any way to do it automatically?

 

Thanks,

-Kai

 

Hello,

 

How can one simplify following expression:

After applying 'simplify' command I am getting this:

Powers are not distributed between bases.

How to force Maple simplify it further to

 

Thank you.

 

restart:
tmp:=Vector(
[
1+(-s[2]-s[4]+2*w[1]/(1+1/exp(mu[p]))^2+(2*(-w[1]+1))/(1+1/(exp(mu[p])*exp(eta[p2])))^2)*s[1]^3+(-s[2]+s[3])*s[1]^2-s[2]*s[1],

(s[2]+s[4]-2*w[1]/(1+1/exp(mu[p]))^2-(2*(-w[1]+1))/(1+1/(exp(mu[p])*exp(eta[p2])))^2)*s[1]^3
]
);

tmp := Vector(2, {(1) = 1+(-s[2]-s[4]+2*w[1]/(1+1/exp(mu[p]))^2+(-2*w[1]+2)/(1+1/(exp(mu[p])*exp(eta[p2])))^2)*s[1]^3+(-s[2]+s[3])*s[1]^2-s[2]*s[1], (2) = (s[2]+s[4]-2*w[1]/(1+1/exp(mu[p]))^2-(-2*w[1]+2)/(1+1/(exp(mu[p])*exp(eta[p2])))^2)*s[1]^3})

(1)

rule3:=w[1]/(1+1/exp(mu[p]))^2+(-w[1]+1)/(1+1/(exp(mu[p])*exp(eta[p2])))^2 = s[3];

w[1]/(1+1/exp(mu[p]))^2+(-w[1]+1)/(1+1/(exp(mu[p])*exp(eta[p2])))^2 = s[3]

(2)

applyrule(rule3,tmp[1]);

1+(-s[2]-s[4]+2*w[1]/(1+1/exp(mu[p]))^2+2*(-w[1]+1)/(1+1/(exp(mu[p])*exp(eta[p2])))^2)*s[1]^3+(-s[2]+s[3])*s[1]^2-s[2]*s[1]

(3)

 

``

 

Download problem.mw

 

This is part of a large simplifcation where lots of terms are being substituted. In two of those terms, it did not simplify as we would expect.

I think the main thing is trying to find a way to factor out the "2".

 

I could do this

> rule3:=w[1]/(1+1/exp(mu[p]))^2+(-w[1]+1)/(1+1/(exp(mu[p])*exp(eta[p2])))^2 = s[3];
>rule3:=2*rule3;

> rule3ne:=-(w[1]/(1+1/exp(mu[p]))^2+(-w[1]+1)/(1+1/(exp(mu[p])*exp(eta[p2])))^2) = -s[3];
> rule3ne:=2*rule3ne;

> applyrule(rule3,tmp[1]);
> applyrule(rule3ne,tmp[2]);

For this example, this works.

But I hope for a more generic approach.

 

Thanks,

 

casper

 

 

 

@ecterrab 

I figured I'd start a new thread for odd things I come across whilst using the new physics package. 

I have found this, and am not sure if it is expected. 

 


restart

with(Physics):

Setup(mathematicalnotation = true):

``

Setup(Commutator(Psigma[i], Psigma[j]) = Physics:-`*`(Physics:-`*`(I, ep_[i, j, k]), Psigma[k]), AntiCommutator(Psigma[i], Psigma[j]) = Physics:-`*`(2, kd_[i, j]));

[algebrarules = {%AntiCommutator(Physics:-Psigma[i], Physics:-Psigma[j]) = 2*Physics:-KroneckerDelta[i, j], %Commutator(Physics:-Psigma[i], Physics:-Psigma[j]) = I*Physics:-LeviCivita[i, j, k]*Physics:-Psigma[k]}]

(1)

NULL

Psigma[1].Psigma[1]

Physics:-Psigma[1]^2

(2)

Simplify(%)

Physics:-Psigma[1]^2

(3)

Simplify(Physics:-Psigma[1]^2)

1

(4)

``


Download Simplify2.mw

Hello,
Maple does not cancel out a variable.

Why is that?

Is there a way to solve this? 

(I pasted my code on the bottom of this message)

 

Thanks for your help/advice,

Stephan

restart:
M(x):=piecewise(x<=l,1/2*(q*x^2)/(EI)-3/8*(q*l*x)/(EI),l<x,1/2*(q*x^2)/(EI)-13/8*(q*l*x)/(EI)+5/4*(q*l^2)/(EI)):
M(x):=M(x)*(-EI);
# simplify() does not work.....?
M(x):=simplify(%) assuming EI>0;
# Wiht EI cancelled out by hand it schould look like:
M(x):=piecewise(x<=l,1/2*(q*x^2)-3/8*(q*l*x),l<x,1/2*(q*x^2)-13/8*(q*l*x)+5/4*(q*l^2));

 

Hi all

kx,ky is the wavenumber, how can I get the 4 cases of piecewise function according to kx=0,kx≠0 and ky=0,ky≠0. Thanks

J := `assuming`([4*(int(int(JJ*exp(-I*(kx*x+ky*y))*sin(2*l*pi*x/a)*sin(2*k*pi*y/b), x = 0 .. a, AllSolutions), y = 0 .. b, AllSolutions))/(a*b)], [k::posint, l::posint, a > 0, b > 0, JJ > 0])

The following MWE shows what I mean:

with(Physics):Setup(mathematical=true):

Setup(noncommutativeprefix={MX,MY,MZ});

test:=proc()

    local eq;

    eq:=-Commutator(MX,MY)-Commutator(MZ,MY);

    eq:=simplify(subs(MX=-MZ,eq));

    return eq;

end proc:

 

test();  # yields -[-MZ,MY] - [MZ,MY]

 

%  # yields 0

 

 

Any ideas how I can solve this? I would like to return the simplified version.

kappa := Vector(7, [1,w[1]*(1-phi+phi*(1-1/(1+exp(-mu[p]-tau[p3]))))+(1-w[1])*
(1-phi+phi*(1-1/(1+exp(-mu[p]-tau[p3]-eta[p2])))),w[1]*phi/(1+exp(-mu[p]-tau[
p3]))+(1-w[1])*phi/(1+exp(-mu[p]-tau[p3]-eta[p2])),w[1]*(1-phi+phi*(1-1/(1+exp
(-mu[p])))*(1-phi)+phi^2*(1-1/(1+exp(-mu[p])))*(1-1/(1+exp(-mu[p]-tau[p3]))))+
(1-w[1])*(1-phi+phi*(1-1/(1+exp(-mu[p]-eta[p2])))*(1-phi)+phi^2*(1-1/(1+exp(-
mu[p]-eta[p2])))*(1-1/(1+exp(-mu[p]-tau[p3]-eta[p2])))),w[1]*phi^2*(1-1/(1+exp
(-mu[p])))/(1+exp(-mu[p]-tau[p3]))+(1-w[1])*phi^2*(1-1/(1+exp(-mu[p]-eta[p2]))
)/(1+exp(-mu[p]-tau[p3]-eta[p2])),w[1]*(phi/(1+exp(-mu[p]))*(1-phi)+phi^2/(1+
exp(-mu[p]))*(1-1/(1+exp(-mu[p]-tau[p3]))))+(1-w[1])*(phi/(1+exp(-mu[p]-eta[p2
]))*(1-phi)+phi^2/(1+exp(-mu[p]-eta[p2]))*(1-1/(1+exp(-mu[p]-tau[p3]-eta[p2]))
)),w[1]*phi^2/(1+exp(-mu[p]))/(1+exp(-mu[p]-tau[p3]))+(1-w[1])*phi^2/(1+exp(-
mu[p]-eta[p2]))/(1+exp(-mu[p]-tau[p3]-eta[p2]))]);

Download kappa.txt

Here is the expression, I am trying to simplify, given a set of rules. NEW_Cole.mw

I have tried different substitutions, using simplify with side rules, applyrule, eval, subs, algsubs.

But none seem to be working as the way I want them to be.

 

Is there a better way?

 

Thanks!

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