Question: How to collect coefficients?

How to collect coefficients of eta^j, j=0,1 from (7)?

restart

with(LinearAlgebra)

with(plots)

with(Physics)

interface(showassumed = 0)

Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(1)

quantumOperators := {H, Id, Mqu, Mqu1, Theta, X, X1}

{H, Id, Mqu, Mqu1, Theta, X, X1}

(2)

Setup(quantumoperators = quantumOperators)

[quantumoperators = {H, Id, Mqu, Mqu1, Theta, X, X1}]

(3)

assume(x::real); assume(t::real)

alias(q = q(x, t), qb = qb(x, t), r = r(x, t), rb = rb(x, t), psi = psi(x, t), phi = phi(x, t), g = g(x, t), gb = gb(x, t), H = H(x, t), X = X(x, t), X1 = X1(x, t), Theta = Theta(x, t), eta = eta(t), Mqu = Mqu(x, t))

q, qb, r, rb, psi, phi, g, gb, H, X, X1, Theta, eta, Mqu

(4)

``

NULL

D1 := (Id*eta-H).X

eta*Physics:-`*`(Id, X)-Physics:-`*`(H, X)

(5)

D2 := diff(D1, x); D3 := subs({diff(X, x) = Mqu}, D2)

eta*Physics:-`*`(Id, diff(X, x))-Physics:-`*`(diff(H, x), X)-Physics:-`*`(H, diff(X, x))

 

eta*Physics:-`*`(Id, Mqu)-Physics:-`*`(diff(H, x), X)-Physics:-`*`(H, Mqu)

(6)

D3+D1 = D1*Mqu1

eta*Physics:-`*`(Id, Mqu)-Physics:-`*`(diff(H, x), X)-Physics:-`*`(H, Mqu)+eta*Physics:-`*`(Id, X)-Physics:-`*`(H, X) = Physics:-`*`(eta*Physics:-`*`(Id, X)-Physics:-`*`(H, X), Mqu1)

(7)

collect(coeff, eta, 1)

1

(8)

collect(coeff, eta, 0)

0

(9)
 

NULL

Download coefff.mw

Please Wait...