Steve Roper

180 Reputation

8 Badges

5 years, 270 days

MaplePrimes Activity


These are replies submitted by Steve Roper

@ecterrab Hi Edgardo,

That's interesting. I was expecting k_.k_ to be the square of the length of the vector, which would be a^2. I was expecting the angles theta and phi to have no impact.

Steve

@ecterrab Thank you Edgardo, you have given me a great deal to think about :-)

I completely agree with your comments on Mathematica.  The syntax is quite difficult to read, whereas the Maple document looks pretty much the same as a text book or paper.

Thanks to your help, I now have this:

Maxwell's Equations

NULL

Initialise

 

restart

with(Physics[Vectors])

[`&x`, `+`, `.`, ChangeBasis, ChangeCoordinates, Component, Curl, DirectionalDiff, Divergence, Gradient, Identify, Laplacian, Nabla, Norm, Setup, diff]

(1.1)

Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(1.2)

Maxwell's Equations

 

Maxwell_1 := Curl(E__field_(x, y, z, t)) = -(diff(B__flux_(x, y, z, t), t))

Physics:-Vectors:-Curl(E__field_(x, y, z, t)) = -(diff(B__flux_(x, y, z, t), t))

(2.1)

Maxwell_2 := Curl(H__field_(x, y, z, t)) = diff(D__flux_(x, y, z, t), t)

Physics:-Vectors:-Curl(H__field_(x, y, z, t)) = diff(D__flux_(x, y, z, t), t)

(2.2)

Maxwell_3 := Divergence(D__flux_(x, y, z, t)) = 0

Physics:-Vectors:-Divergence(D__flux_(x, y, z, t)) = 0

(2.3)

Maxwell_4 := Divergence(B__flux_(x, y, z, t)) = 0

Physics:-Vectors:-Divergence(B__flux_(x, y, z, t)) = 0

(2.4)

``

Constitutive Relations

 

Eq_1 := D__flux_(x, y, z, t) = epsilon*E__field_(x, y, z, t)

D__flux_(x, y, z, t) = varepsilon*E__field_(x, y, z, t)

(3.1)

Eq_2 := B__flux_(x, y, z, t) = mu*H__field_(x, y, z, t)

B__flux_(x, y, z, t) = mu*H__field_(x, y, z, t)

(3.2)

``

Solution

 

We need an expression for the Curl of H, so we start by taking the Curl of both sides of Maxwell_1:

Curl(Maxwell_1)

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -Physics:-Vectors:-Curl(diff(B__flux_(x, y, z, t), t))

(4.1)

Now substitute B for μH:

subs(Eq_2, Physics[Vectors][Curl](Physics[Vectors][Curl](E__field_(x, y, z, t))) = -Physics[Vectors][Curl](diff(B__flux_(x, y, z, t), t)))

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -Physics:-Vectors:-Curl(diff(mu*H__field_(x, y, z, t), t))

(4.2)

Now substitute the Curl of H with an expression in D:

subs(diff(Maxwell_2, t), Physics[Vectors][Curl](Physics[Vectors][Curl](E__field_(x, y, z, t))) = -Physics[Vectors][Curl](diff(mu*H__field_(x, y, z, t), t)))

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -mu*(diff(diff(D__flux_(x, y, z, t), t), t))

(4.3)

Now substitute E for D:

subs(isolate(Eq_1, E__field_(x, y, z, t)), Physics[Vectors][Curl](Physics[Vectors][Curl](E__field_(x, y, z, t))) = -mu*(diff(diff(D__flux_(x, y, z, t), t), t)))

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(D__flux_(x, y, z, t)/varepsilon)) = -mu*(diff(diff(D__flux_(x, y, z, t), t), t))

(4.4)

Let's see what happens if we expand this:

expand(Physics[Vectors][Curl](Physics[Vectors][Curl](D__flux_(x, y, z, t)/varepsilon)) = -mu*(diff(diff(D__flux_(x, y, z, t), t), t)))

Physics:-diff(Physics:-Vectors:-Divergence(D__flux_(x, y, z, t)), x)*_i/varepsilon+Physics:-diff(Physics:-Vectors:-Divergence(D__flux_(x, y, z, t)), y)*_j/varepsilon+Physics:-diff(Physics:-Vectors:-Divergence(D__flux_(x, y, z, t)), z)*_k/varepsilon-(diff(diff(D__flux_(x, y, z, t), y), y))/varepsilon-(diff(diff(D__flux_(x, y, z, t), x), x))/varepsilon-(diff(diff(D__flux_(x, y, z, t), z), z))/varepsilon = -mu*(diff(diff(D__flux_(x, y, z, t), t), t))

(4.5)

This is impressive!  Maple knows that V×(V×D) = V(V·D) - V2D

Now we can use Maxwell_3 to arrive at an expression in V2D because we know that V·D=0:``

simplify(Physics[Vectors][Curl](Physics[Vectors][Curl](D__flux_(x, y, z, t)/varepsilon)) = -mu*(diff(diff(D__flux_(x, y, z, t), t), t)), {Maxwell_3})

(-(diff(diff(D__flux_(x, y, z, t), x), x))-(diff(diff(D__flux_(x, y, z, t), y), y))-(diff(diff(D__flux_(x, y, z, t), z), z)))/varepsilon = -mu*(diff(diff(D__flux_(x, y, z, t), t), t))

(4.6)

Now we have an expression that looks like a wave, we can substitute D for E:

subs(Eq_1, (-(diff(diff(D__flux_(x, y, z, t), x), x))-(diff(diff(D__flux_(x, y, z, t), y), y))-(diff(diff(D__flux_(x, y, z, t), z), z)))/varepsilon = -mu*(diff(diff(D__flux_(x, y, z, t), t), t)))

(-(diff(diff(varepsilon*E__field_(x, y, z, t), x), x))-(diff(diff(varepsilon*E__field_(x, y, z, t), y), y))-(diff(diff(varepsilon*E__field_(x, y, z, t), z), z)))/varepsilon = -mu*(diff(diff(varepsilon*E__field_(x, y, z, t), t), t))

(4.7)

simplify((-(diff(diff(varepsilon*E__field_(x, y, z, t), x), x))-(diff(diff(varepsilon*E__field_(x, y, z, t), y), y))-(diff(diff(varepsilon*E__field_(x, y, z, t), z), z)))/varepsilon = -mu*(diff(diff(varepsilon*E__field_(x, y, z, t), t), t)))

-(diff(diff(E__field_(x, y, z, t), x), x))-(diff(diff(E__field_(x, y, z, t), y), y))-(diff(diff(E__field_(x, y, z, t), z), z)) = -mu*varepsilon*(diff(diff(E__field_(x, y, z, t), t), t))

(4.8)

Loose the "-" sign:

diff(diff(E__field_(x, y, z, t), x), x)+diff(diff(E__field_(x, y, z, t), y), y)+diff(diff(E__field_(x, y, z, t), z), z) = mu*varepsilon*(diff(diff(E__field_(x, y, z, t), t), t))

diff(diff(E__field_(x, y, z, t), x), x)+diff(diff(E__field_(x, y, z, t), y), y)+diff(diff(E__field_(x, y, z, t), z), z) = mu*varepsilon*(diff(diff(E__field_(x, y, z, t), t), t))

(4.9)

Finaly, we can use the inert operator "%" to make expression look more concise like this:

subs(Laplacian(E__field_(x, y, z, t)) = %Laplacian(E__field_(x, y, z, t)), diff(diff(E__field_(x, y, z, t), x), x)+diff(diff(E__field_(x, y, z, t), y), y)+diff(diff(E__field_(x, y, z, t), z), z) = mu*varepsilon*(diff(diff(E__field_(x, y, z, t), t), t)))

%Laplacian(E__field_(x, y, z, t)) = mu*varepsilon*(diff(diff(E__field_(x, y, z, t), t), t))

(4.10)

Now we need to use pdsolve to find a solution!

NULL

NULL

NULL

 

You are quite right about equation lables.  It makes it possible to insert and delete and re-execute individual statements. Using %, I often found that it was necessary to re-execute the whole workbook with !!!.

And the intert "%" operator helped with the final substitution in (4.10) :-)


I haven't had time to experiment with pdsolve yet.  Presumably it will be necessary to solve for waves propagating allong the x,y and z axies seperately before re-combining?

Download Maxwells_Equations.mw

 

 

@ecterrab Thank you Edgardo, you make it look so easy :-)

Can I ask how that works please?  Why does subs need a little help in this case in order to substitute the LHS of Maxwell_2 with the RHS?

I have attached the updated worksheet and now have some new questions.  The first is how to substitute using the left-hand side of the equation rather than the right and the second is how to invoke vector identities such as ∇×(∇×F)=∇(∇·F)-∇2F?

Maxwell's Equations

``

Initialise

 

restart

with(Physics[Vectors])

[`&x`, `+`, `.`, ChangeBasis, ChangeCoordinates, Component, Curl, DirectionalDiff, Divergence, Gradient, Identify, Laplacian, Nabla, Norm, Setup, diff]

(1.1)

Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(1.2)

Maxwell's Equations

 

Maxwell_1 := Curl(E__field_(x, y, z, t)) = -(diff(B__flux_(x, y, z, t), t))

Physics:-Vectors:-Curl(E__field_(x, y, z, t)) = -(diff(B__flux_(x, y, z, t), t))

(2.1)

Maxwell_2 := Curl(H__field_(x, y, z, t)) = diff(D__flux_(x, y, z, t), t)

Physics:-Vectors:-Curl(H__field_(x, y, z, t)) = diff(D__flux_(x, y, z, t), t)

(2.2)

Maxwell_3 := Divergence(D__flux_(x, y, z, t)) = 0

Physics:-Vectors:-Divergence(D__flux_(x, y, z, t)) = 0

(2.3)

Maxwell_4 := Divergence(B__flux_(x, y, z, t)) = 0

Physics:-Vectors:-Divergence(B__flux_(x, y, z, t)) = 0

(2.4)

NULL

Constitutive Relations

 

Eq_1 := D__flux_(x, y, z, t) = epsilon*E__field_(x, y, z, t)

D__flux_(x, y, z, t) = varepsilon*E__field_(x, y, z, t)

(3.1)

Eq_2 := B__flux_(x, y, z, t) = mu*H__field_(x, y, z, t)

B__flux_(x, y, z, t) = mu*H__field_(x, y, z, t)

(3.2)

NULL

Solution

 

We need an expression for the Curl of H, so we start by taking the Curl of both sides of Maxwell_1:

Curl(Maxwell_1)

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -Physics:-Vectors:-Curl(diff(B__flux_(x, y, z, t), t))

(4.1)

Now substitute B for μH:

subs(Eq_2, %)

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -Physics:-Vectors:-Curl(diff(mu*H__field_(x, y, z, t), t))

(4.2)

Now substitute the Curl of H with an expression in D:NULL

subs(diff(Maxwell_2, t), %)

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -mu*(diff(diff(D__flux_(x, y, z, t), t), t))

(4.3)

It worked.  Thank you Edgardo!

 

Now substitute E for D:

subs(Eq_1, %)

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -mu*(diff(diff(varepsilon*E__field_(x, y, z, t), t), t))

(4.4)

Hmmm, that didn't work.  Is there a way to ask subs to substitute using the left-hand side of the equation rather than the right?

 

And once we have managed to substitute V×V×E for V×V×D, we will need to find a way to use

Because we know from Maxwell_3 that V·D=0 and so we should end up with an expression for V2D

 

 

``

NULL

NULL


 

Download Maxwells_Equations.mw

Once again, thank you for your help Edgardo!

 

1 2 Page 2 of 2