Applications, Examples and Libraries

Share your work here

The 2020 Maple Conference is coming up fast! It is running from November 2-6 this year, all remotely, and completely free.

The week will be packed with activities, and we have designed it so that it will be valuable for Maple users of all skill and experience levels. The agenda includes 3 keynote presentations, 2 live panel presentations, 8 Maplesoft recorded presentations, 3 Maple workshops, and 68 contributed recorded presentations.

There will be live Q&A’s for every presentation. Additionally, we are hosting what we’re calling “Virtual Tables” at every breakfast (8-9am EST) and almost every lunch (12-1 EST). These tables offer attendees a chance to discuss topics related to the conference streams of the day, as well as a variety of special topics and social discussions. You can review the schedule for these virtual tables here.

Attendance is completely free, and we’re confident that there will be something there for all Maple users. Whether you attend one session or all of them, we’d love to see you there!

You can register for the Maple Conference here.


In a recent question in Mapleprimes, a spacetime (metric) solution to Einstein's equations, from chapter 27 of the book of Exact Solutions to Einstein's equations [1] was discussed. One of the issues was about computing a tetrad for that solution [27, 37, 1] such that the corresponding Weyl scalars are in canonical form. This post illustrates how to do that, with precisely that spacetime metric solution, in two different ways: 1) automatically, all in one go, and 2) step-by-step. The step-by-step computation is useful to verify results and also to compute different forms of the tetrads or Weyl scalars. The computation below is performed using the latest version of the Maplesoft Physics Updates.

 

with(Physics)

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 851 and is the same as the version installed in this computer, created 2020, October 19, 13:47 hours Pacific Time.`

(1)

The starting point is this image of page 421 of the book of Exact Solutions to Einstein's equations, formulas (27.37)

 

Load the solution [27, 37, 1] from Maple's database of solutions to Einstein's equations

g_[[27, 37, 1]]

_______________________________________________________

 

`Systems of spacetime coordinates are:`*{X = (z, zb, r, u)}

 

`Default differentiation variables for d_, D_ and dAlembertian are:`*{X = (z, zb, r, u)}

 

`The `*`Robinson and Trautman (1962)`*` metric in coordinates `*[z, zb, r, u]

 

`Parameters: `*[P(z, zb, u), H(X)]

 

"`Comments: ` admits geodesic, shearfree, twistfree null congruence, rho=-1/r=rho_b"

 

`Resetting the signature of spacetime from `*`- - - +`*` to `*`+ + + -`*` in order to match the signature in the database of metrics`

 

_______________________________________________________

 

`Setting `*lowercaselatin_is*` letters to represent `*space*` indices`

 

Physics:-g_[mu, nu] = Matrix(%id = 18446744078276690638)

(2)

"CompactDisplay(?)"

H(X)*`will now be displayed as`*H

 

P(z, zb, u)*`will now be displayed as`*P

(3)

The assumptions on the metric's parameters are

Assume(P(z, zb, u) > 0, (H(X))::real, r >= 0)

 

The line element is as shown in the second line of the image above

g_[lineelement]

2*r^2*Physics:-d_(z)*Physics:-d_(zb)/P(z, zb, u)^2-2*Physics:-d_(r)*Physics:-d_(u)-2*H(X)*Physics:-d_(u)^2

(4)

Load Tetrads

with(Tetrads)

_______________________________________________________

 

`Setting `*lowercaselatin_ah*` letters to represent `*tetrad*` indices`

 

((`Defined as tetrad tensors `*`see <a href='http://www.maplesoft.com/support/help/search.aspx?term=Physics,tetrads`*`,' target='_new'>?Physics,tetrads`*`,</a> `*`&efr;`[a, mu]*`, `)*eta[a, b]*`, `*gamma[a, b, c]*`, `)*lambda[a, b, c]

 

((`Defined as spacetime tensors representing the NP null vectors of the tetrad formalism `*`see <a href='http://www.maplesoft.com/support/help/search.aspx?term=Physics,tetrads`*`,' target='_new'>?Physics,tetrads`*`,</a> `*l[mu]*`, `)*n[mu]*`, `*m[mu]*`, `)*conjugate(m[mu])

 

_______________________________________________________

(5)

The Petrov type of this spacetime solution is

PetrovType()

"II"

(6)

The null tetrad computed by the Maple system using a general algorithms is

Setup(tetrad = null)

e_[]

Physics:-Tetrads:-e_[a, mu] = Matrix(%id = 18446744078178770326)

(7)

 

According to the help page TransformTetrad , the canonical form of the Weyl scalars for each different Petrov type is

 

So for type II, when the tetrad is in canonical form, we expect only `&Psi;__2` and `&Psi;__3` different from 0. For the tetrad computed automatically, however, the scalars are

Weyl[scalars]

psi__0 = -P(z, zb, u)*(2*(diff(P(z, zb, u), z))*(diff(H(X), z))+P(z, zb, u)*(diff(diff(H(X), z), z)))/(r^2*(H(X)^2+1)^(1/2)), psi__1 = ((1/2)*I)*(-(diff(diff(H(X), r), z))*P(z, zb, u)^2*r+2*P(z, zb, u)^2*(diff(H(X), z))-(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))*r+(diff(diff(P(z, zb, u), u), z))*r*P(z, zb, u))/(P(z, zb, u)*r^2*(H(X)^2+1)^(1/4)), psi__2 = (1/6)*((diff(diff(H(X), r), r))*r^2+2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))-2*(diff(H(X), r))*r-2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)+2*H(X))/r^2, psi__3 = 0, psi__4 = 0

(8)

The question is, how to bring the tetrad `&efr;`[a, mu] (equation (7)) into canonical form. The plan for that is outlined in Chapter 7, by Chandrasekhar, page 388, of the book "General Relativity, an Einstein centenary survey", edited by S.W. Hawking and W.Israel. In brief, for Petrov type II, use a transformation ofClass[2] to make Psi[0] = `&Psi;__1` and `&Psi;__1` = 0, then a transformation of Class[1] making Psi[4] = 0, finally use a transformation of Class[3] making Psi[3] = 1. For an explanation of these transformations see the help page for TransformTetrad . This plan, however, is applicable if and only if the starting tetrad results in `&psi;__4` <> 0, which we see in (8) it is not the case, so we need, in addition, before applying this plan, to perform a transformation of Class[1] making `&psi;__4` <> 0.

 

In what follows, the transformations mentioned are first performed automatically, in one go, letting the computer deduce each intermediate transformation, by passing to TransformTetrad the optional argument canonicalform. Then, the same result is obtained by transforming the starting tetrad  one step at at time, arriving at the same Weyl scalars. That illustrates well both how to get the result exploiting advanced functionality but also how to verify the result performing each step, and also how to get any desired different form of the Weyl scalars.

 

Although it is possible to perform both computations, automatically and step-by-step, departing from the tetrad (7), that tetrad and the corresponding Weyl scalars (8) have radicals, making the readability of the formulas at each step less clear. Both computations, can be presented in more readable form without radicals departing from the tetrad shown in the book, that is

e_[a, mu] = (Matrix(4, 4, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = -1, (2, 1) = 0, (2, 2) = r/P(z, zb, u), (2, 3) = 0, (2, 4) = 0, (3, 1) = r/P(z, zb, u), (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = -1, (4, 4) = -H(X)}))

Physics:-Tetrads:-e_[a, mu] = Matrix(%id = 18446744078621688766)

(9)

"IsTetrad(?)"

`Type of tetrad: `*null

 

true

(10)

The corresponding Weyl scalars free of radicals are

"WeylScalars(?)"

psi__0 = P(z, zb, u)*(2*(diff(P(z, zb, u), z))*(diff(H(X), z))+P(z, zb, u)*(diff(diff(H(X), z), z)))/r^2, psi__1 = -(1/2)*(-(diff(diff(H(X), r), z))*P(z, zb, u)^2*r+2*P(z, zb, u)^2*(diff(H(X), z))-(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))*r+(diff(diff(P(z, zb, u), u), z))*r*P(z, zb, u))/(r^2*P(z, zb, u)), psi__2 = -(1/6)*(-(diff(diff(H(X), r), r))*r^2+2*(diff(H(X), r))*r-2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))+2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)-2*H(X))/r^2, psi__3 = 0, psi__4 = 0

(11)

So set this tetrad as the starting point

"Setup(?)"

[tetrad = {(1, 4) = -1, (2, 2) = r/P(z, zb, u), (3, 1) = r/P(z, zb, u), (4, 3) = -1, (4, 4) = -H(X)}]

(12)


All the transformations performed automatically, in one go

 

To arrive in one go, automatically, to a tetrad whose Weyl scalars are in canonical form as in (31), use the optional argument canonicalform:

T__5 := TransformTetrad(canonicalform)

WeylScalars(T__5)

psi__0 = 0, psi__1 = 0, psi__2 = -(1/6)*(-(diff(diff(H(X), r), r))*r^2+2*(diff(H(X), r))*r-2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))+2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)-2*H(X))/r^2, psi__3 = 1, psi__4 = 0

(13)

Note the length of T__5

length(T__5)

58242

(14)

That length corresponds to several pages long. That happens frequently, you get Weyl scalars with a minimum of residual invariance, at the cost of a more complicated tetrad.

 

The transformations step-by-step leading to the same canonical form of the Weyl scalars

 

Step 0

 

As mentioned above, to apply the plan outlined by Chandrasekhar, the starting point needs to be a tetrad with `&Psi;__4` <> 0, not the case of (9), so in this step 0 we use a transformation of Class[1] making `&psi;__4` <> 0. This transformation introduces a complex parameter E and to get `&psi;__4` <> 0 any value of E suffices. We use E = 1:

TransformTetrad(nullrotationwithfixedl_)

Matrix(%id = 18446744078634914990)

(15)

"`T__0` := eval(?,E=1)"

Matrix(%id = 18446744078634940646)

(16)

Indeed, for this tetrad, `&Psi;__4` <> 0:

WeylScalars(T__0)[-1]

psi__4 = ((diff(diff(H(X), r), r))*r^2*P(z, zb, u)+P(z, zb, u)^3*(diff(diff(H(X), z), z))+2*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^2+2*(diff(diff(H(X), r), z))*P(z, zb, u)^2*r+2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))*P(z, zb, u)+2*(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))*r-4*P(z, zb, u)^2*(diff(H(X), z))-2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)^2-2*(diff(H(X), r))*P(z, zb, u)*r-2*(diff(diff(P(z, zb, u), u), z))*r*P(z, zb, u)+2*H(X)*P(z, zb, u))/(r^2*P(z, zb, u))

(17)

Step 1

Next is a transformation of Class__2 to make `&Psi;__0` = 0, that in the case of Petrov type II also implies on `&Psi;__1` = 0.According to the the help page TransformTetrad , this transformation introduces a parameter B that, according to the plan outlined by Chandrasekhar in Chapter 7 page 388, is one of the two identical roots (out of the four roots) of the principalpolynomial. To see the principal polynomial, or, directly, its roots you can use the PetrovType  command:

PetrovType(principalroots = 'R')

"II"

(18)

The first two are the same and equal to -1

R[1 .. 2]

[-1, -1]

(19)

So the transformed tetrad T__1 is

T__1 := eval(TransformTetrad(T__0, nullrotationwithfixedn_), B = -1)

Matrix(%id = 18446744078641721462)

(20)

Check this result and the corresponding Weyl scalars to verify that we now have `&Psi;__0` = 0 and `&Psi;__1` = 0

IsTetrad(T__1)

`Type of tetrad: `*null

 

true

(21)

WeylScalars(T__1)[1 .. 2]

psi__0 = 0, psi__1 = 0

(22)

Step 2

Next is a transformation of Class__1 that makes `&Psi;__4` = 0. This transformation introduces a parameter E, that according to Chandrasekhar's plan can be taken equal to one of the roots of Weyl scalar `&Psi;__4`that corresponds to the transformed tetrad. So we need to proceed in three steps:

a. 

transform the tetrad introducing a parameter E in the tetrad's components

b. 

compute the Weyl scalars for that transformed tetrad

c. 

take `&Psi;__4` = 0 and solve for E

d. 

apply the resulting value of E to the transformed tetrad obtained in step a.

 

a.Transform the tetrad and for simplicity take E real

T__2 := eval(TransformTetrad(T__1, nullrotationwithfixedl_), conjugate(E) = E)

Matrix(%id = 18446744078624751238)

(23)

"IsTetrad(?)"

`Type of tetrad: `*null

 

true

(24)

b. Compute `&Psi;__4` for this tetrad

simplify(WeylScalars(T__2)[-1])

psi__4 = (r^2*P(z, zb, u)*(E-1)^2*(diff(diff(H(X), r), r))-2*r*P(z, zb, u)^2*(E-1)*(diff(diff(H(X), r), z))+P(z, zb, u)^3*(diff(diff(H(X), z), z))-2*P(z, zb, u)^2*(E-1)^2*(diff(diff(P(z, zb, u), z), zb))+2*r*P(z, zb, u)*(E-1)*(diff(diff(P(z, zb, u), u), z))-2*r*P(z, zb, u)*(E-1)^2*(diff(H(X), r))+4*P(z, zb, u)^2*(E+(1/2)*(diff(P(z, zb, u), z))-1)*(diff(H(X), z))+2*((P(z, zb, u)*(E-1)*(diff(P(z, zb, u), zb))-(diff(P(z, zb, u), u))*r)*(diff(P(z, zb, u), z))+H(X)*P(z, zb, u)*(E-1))*(E-1))/(r^2*P(z, zb, u))

(25)

c. Solve `&Psi;__4` = 0 discarding the case E = 0 which implies on no transformation

simplify(solve({rhs(psi__4 = (r^2*P(z, zb, u)*(E-1)^2*(diff(diff(H(X), r), r))-2*r*P(z, zb, u)^2*(E-1)*(diff(diff(H(X), r), z))+P(z, zb, u)^3*(diff(diff(H(X), z), z))-2*P(z, zb, u)^2*(E-1)^2*(diff(diff(P(z, zb, u), z), zb))+2*r*P(z, zb, u)*(E-1)*(diff(diff(P(z, zb, u), u), z))-2*r*P(z, zb, u)*(E-1)^2*(diff(H(X), r))+4*P(z, zb, u)^2*(E+(1/2)*(diff(P(z, zb, u), z))-1)*(diff(H(X), z))+2*((P(z, zb, u)*(E-1)*(diff(P(z, zb, u), zb))-(diff(P(z, zb, u), u))*r)*(diff(P(z, zb, u), z))+H(X)*P(z, zb, u)*(E-1))*(E-1))/(r^2*P(z, zb, u))) = 0, E <> 0}, {E}, explicit)[1])

{E = ((diff(diff(H(X), r), r))*r^2*P(z, zb, u)+(diff(diff(H(X), r), z))*P(z, zb, u)^2*r-2*(diff(H(X), r))*P(z, zb, u)*r-(diff(diff(P(z, zb, u), u), z))*r*P(z, zb, u)+(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))*r-2*P(z, zb, u)^2*(diff(H(X), z))-2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)^2+2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))*P(z, zb, u)+2*H(X)*P(z, zb, u)+(-P(z, zb, u)^4*((diff(diff(H(X), r), r))*r^2+2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))-2*(diff(H(X), r))*r-2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)+2*H(X))*(diff(diff(H(X), z), z))+P(z, zb, u)^4*(diff(diff(H(X), r), z))^2*r^2+(-2*r^2*(diff(diff(P(z, zb, u), u), z))*P(z, zb, u)^3+2*r^2*P(z, zb, u)^2*(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))-4*r*(diff(H(X), z))*P(z, zb, u)^4)*(diff(diff(H(X), r), z))-2*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^3*(diff(diff(H(X), r), r))*r^2+P(z, zb, u)^2*(diff(diff(P(z, zb, u), u), z))^2*r^2+(-2*r^2*P(z, zb, u)*(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))+4*r*(diff(H(X), z))*P(z, zb, u)^3)*(diff(diff(P(z, zb, u), u), z))+4*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^4*(diff(diff(P(z, zb, u), z), zb))+4*(diff(H(X), z))^2*P(z, zb, u)^4+4*P(z, zb, u)^2*(diff(P(z, zb, u), z))*((diff(H(X), r))*P(z, zb, u)*r-(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))*P(z, zb, u)-(diff(P(z, zb, u), u))*r-H(X)*P(z, zb, u))*(diff(H(X), z))+(diff(P(z, zb, u), u))^2*(diff(P(z, zb, u), z))^2*r^2)^(1/2))/(P(z, zb, u)*((diff(diff(H(X), r), r))*r^2+2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))-2*(diff(H(X), r))*r-2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)+2*H(X)))}

(26)

d. Apply this result to the tetrad (23). In doing so, do not display the result, just measure its length (corresponds to two+ pages)

T__3 := simplify(eval(T__2, {E = ((diff(diff(H(X), r), r))*r^2*P(z, zb, u)+(diff(diff(H(X), r), z))*P(z, zb, u)^2*r-2*(diff(H(X), r))*P(z, zb, u)*r-(diff(diff(P(z, zb, u), u), z))*r*P(z, zb, u)+(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))*r-2*P(z, zb, u)^2*(diff(H(X), z))-2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)^2+2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))*P(z, zb, u)+2*H(X)*P(z, zb, u)+(-P(z, zb, u)^4*((diff(diff(H(X), r), r))*r^2+2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))-2*(diff(H(X), r))*r-2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)+2*H(X))*(diff(diff(H(X), z), z))+P(z, zb, u)^4*(diff(diff(H(X), r), z))^2*r^2+(-2*r^2*(diff(diff(P(z, zb, u), u), z))*P(z, zb, u)^3+2*r^2*P(z, zb, u)^2*(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))-4*r*(diff(H(X), z))*P(z, zb, u)^4)*(diff(diff(H(X), r), z))-2*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^3*(diff(diff(H(X), r), r))*r^2+P(z, zb, u)^2*(diff(diff(P(z, zb, u), u), z))^2*r^2+(-2*r^2*P(z, zb, u)*(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))+4*r*(diff(H(X), z))*P(z, zb, u)^3)*(diff(diff(P(z, zb, u), u), z))+4*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^4*(diff(diff(P(z, zb, u), z), zb))+4*(diff(H(X), z))^2*P(z, zb, u)^4+4*P(z, zb, u)^2*(diff(P(z, zb, u), z))*((diff(H(X), r))*P(z, zb, u)*r-(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))*P(z, zb, u)-(diff(P(z, zb, u), u))*r-H(X)*P(z, zb, u))*(diff(H(X), z))+(diff(P(z, zb, u), u))^2*(diff(P(z, zb, u), z))^2*r^2)^(1/2))/(P(z, zb, u)*((diff(diff(H(X), r), r))*r^2+2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))-2*(diff(H(X), r))*r-2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)+2*H(X)))}[1]))

length(T__3)

12589

(27)

Check the scalars, we expect `&Psi;__0` = `&Psi;__1` and `&Psi;__1` = `&Psi;__4` and `&Psi;__4` = 0

WeylScalars(T__3); %[1 .. 2], %[-1]

psi__0 = 0, psi__1 = 0, psi__4 = 0

(28)

Step 3

Use a transformation of Class[3] making Psi[3] = 1. Such a transformation changes Psi[3]^` '` = A*exp(-I*Omega)*Psi[3], where we need to take A*exp(-I*Omega) = 1/`&Psi;__3`, and without loss of generality we can take Omega = 0.

Check first the value of `&Psi;__3` in the last tetrad computed

WeylScalars(T__3)[4]

psi__3 = (1/2)*(-2*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^3*(diff(diff(H(X), r), r))*r^2-P(z, zb, u)^4*(diff(diff(H(X), z), z))*(diff(diff(H(X), r), r))*r^2+P(z, zb, u)^4*(diff(diff(H(X), r), z))^2*r^2+4*(diff(P(z, zb, u), z))*(diff(H(X), r))*(diff(H(X), z))*P(z, zb, u)^3*r+2*(diff(H(X), r))*P(z, zb, u)^4*(diff(diff(H(X), z), z))*r-4*(diff(P(z, zb, u), zb))*(diff(P(z, zb, u), z))^2*(diff(H(X), z))*P(z, zb, u)^3+4*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^4*(diff(diff(P(z, zb, u), z), zb))-4*(diff(H(X), z))*P(z, zb, u)^4*(diff(diff(H(X), r), z))*r+2*(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))*P(z, zb, u)^2*(diff(diff(H(X), r), z))*r^2-2*(diff(P(z, zb, u), zb))*(diff(P(z, zb, u), z))*P(z, zb, u)^4*(diff(diff(H(X), z), z))+2*P(z, zb, u)^5*(diff(diff(H(X), z), z))*(diff(diff(P(z, zb, u), z), zb))-2*P(z, zb, u)^3*(diff(diff(P(z, zb, u), u), z))*(diff(diff(H(X), r), z))*r^2+4*(diff(H(X), z))^2*P(z, zb, u)^4-4*(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^2*r-4*H(X)*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^3+4*(diff(H(X), z))*P(z, zb, u)^3*(diff(diff(P(z, zb, u), u), z))*r+(diff(P(z, zb, u), u))^2*(diff(P(z, zb, u), z))^2*r^2-2*(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))*P(z, zb, u)*(diff(diff(P(z, zb, u), u), z))*r^2-2*H(X)*P(z, zb, u)^4*(diff(diff(H(X), z), z))+P(z, zb, u)^2*(diff(diff(P(z, zb, u), u), z))^2*r^2)^(1/2)/(r^2*P(z, zb, u))

(29)

So, the transformed tetrad T__4 to which corresponds Weyl scalars in canonical form, with `&Psi;__0` = `&Psi;__1` and `&Psi;__1` = `&Psi;__4` and `&Psi;__4` = 0 and `&Psi;__3` = 1, is

T__4 := simplify(eval(TransformTetrad(T__3, boostsn_l_plane), A = 1/rhs(psi__3 = (1/2)*(-2*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^3*(diff(diff(H(X), r), r))*r^2-P(z, zb, u)^4*(diff(diff(H(X), z), z))*(diff(diff(H(X), r), r))*r^2+P(z, zb, u)^4*(diff(diff(H(X), r), z))^2*r^2+4*(diff(P(z, zb, u), z))*(diff(H(X), r))*(diff(H(X), z))*P(z, zb, u)^3*r+2*(diff(H(X), r))*P(z, zb, u)^4*(diff(diff(H(X), z), z))*r-4*(diff(P(z, zb, u), zb))*(diff(P(z, zb, u), z))^2*(diff(H(X), z))*P(z, zb, u)^3+4*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^4*(diff(diff(P(z, zb, u), z), zb))-4*(diff(H(X), z))*P(z, zb, u)^4*(diff(diff(H(X), r), z))*r+2*(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))*P(z, zb, u)^2*(diff(diff(H(X), r), z))*r^2-2*(diff(P(z, zb, u), zb))*(diff(P(z, zb, u), z))*P(z, zb, u)^4*(diff(diff(H(X), z), z))+2*P(z, zb, u)^5*(diff(diff(H(X), z), z))*(diff(diff(P(z, zb, u), z), zb))-2*P(z, zb, u)^3*(diff(diff(P(z, zb, u), u), z))*(diff(diff(H(X), r), z))*r^2+4*(diff(H(X), z))^2*P(z, zb, u)^4-4*(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^2*r-4*H(X)*(diff(P(z, zb, u), z))*(diff(H(X), z))*P(z, zb, u)^3+4*(diff(H(X), z))*P(z, zb, u)^3*(diff(diff(P(z, zb, u), u), z))*r+(diff(P(z, zb, u), u))^2*(diff(P(z, zb, u), z))^2*r^2-2*(diff(P(z, zb, u), u))*(diff(P(z, zb, u), z))*P(z, zb, u)*(diff(diff(P(z, zb, u), u), z))*r^2-2*H(X)*P(z, zb, u)^4*(diff(diff(H(X), z), z))+P(z, zb, u)^2*(diff(diff(P(z, zb, u), u), z))^2*r^2)^(1/2)/(r^2*P(z, zb, u)))))

IsTetrad(T__4)

`Type of tetrad: `*null

 

true

(30)

WeylScalars(T__4)

psi__0 = 0, psi__1 = 0, psi__2 = -(1/6)*(-(diff(diff(H(X), r), r))*r^2+2*(diff(H(X), r))*r+2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)-2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))-2*H(X))/r^2, psi__3 = 1, psi__4 = 0

(31)

These are the same scalars computed in one go in (13)

psi__0 = 0, psi__1 = 0, psi__2 = -(1/6)*(-(diff(diff(H(X), r), r))*r^2+2*(diff(H(X), r))*r-2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))+2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)-2*H(X))/r^2, psi__3 = 1, psi__4 = 0

psi__0 = 0, psi__1 = 0, psi__2 = -(1/6)*(-(diff(diff(H(X), r), r))*r^2+2*(diff(H(X), r))*r-2*(diff(P(z, zb, u), z))*(diff(P(z, zb, u), zb))+2*(diff(diff(P(z, zb, u), z), zb))*P(z, zb, u)-2*H(X))/r^2, psi__3 = 1, psi__4 = 0

(32)

``


 

Download The_metric_[27_37_1]_in_canonical_form.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

When we plot a curve with the option  style=point  , symbols go evenly not along the length of this curve, but along the range of the independent variable. For this reason the plot often looks unattractive. Here are two examples. In the first example, the default option  adaptive=true  is used, in which Maple adds points in some places.

restart;
plot(surd(x,3), x=-2.5..2.5, style=point, scaling=constrained, symbol=solidcircle, symbolsize=8, numpoints=30, size=[800,300]);
plot(surd(x,3), x=-2.5..2.5, style=point, scaling=constrained, symbol=solidcircle, symbolsize=8, numpoints=30, adaptive=false, size=[800,300]);

                

                           


The  UniformPointPlot  procedure allows you to plot curves by symbols (as for  style=point), and these symbols go from each other at equal distances, measured along this curve. The procedure uses a well-known formula for the length of a curve in two and three dimensions. The procedure parameters are clear from the three examples below.

UniformPointPlot:=proc(F::{algebraic,list},eq::`=`,n::posint:=40,Opt::list:=[symbol=solidcircle, symbolsize=8, scaling=constrained])
local t, R, P, g, L, step, L1, L2;
uses plots;
Digits:=4:
t:=lhs(eq); R:=rhs(eq);
P:=`if`(type(F,algebraic),[t,F],F); 
g:=x->`if`(F::algebraic or nops(F)=2,evalf(Int(sqrt(diff(P[1],t)^2+diff(P[2],t)^2), t=lhs(R)..x, epsilon=0.001)),evalf(Int(sqrt(diff(P[1],t)^2+diff(P[2],t)^2+diff(P[3],t)^2), t=lhs(R)..x, epsilon=0.001))):
L:=g(rhs(R)); step:=L/(n-1);
L1:=[lhs(R),seq(fsolve(g-k*step, fulldigits),k=1..n-2),rhs(R)];
L2:=map(s->`if`(type(F,algebraic),[s,eval(F,t=s)],eval(F,t=s)), L1):
`if`(F::algebraic or nops(F)=2,plot(L2, style=point, Opt[]),pointplot3d(L2, Opt[]));
end proc:

   
Examples of use:

UniformPointPlot(surd(x,3), x=-2.5..2.5, 30);

                             

UniformPointPlot([5*cos(t),3*sin(t)], t=0..2*Pi, [color=red,symbol=solidcircle,scaling=constrained, symbolsize=8,  size=[800,400]]);

                             

UniformPointPlot([cos(t),sin(t),2-2*cos(t)], t=0..2*Pi, 41, [color=red,symbol=solidsphere, symbolsize=8,scaling=constrained, labels=[x,y,z]]);

                             
Here's another example of using the same technique as in the procedure. In this example, we are plotting Archimedean spiral uniformly colored with 7 rainbow colors:

f:=t->[t*cos(t),t*sin(t)]:
g:=t->evalf(Int(sqrt(diff(f(s)[1],s)^2+diff(f(s)[2],s)^2), s=0..t)):
h:=s->fsolve(s=g(t), t):
L:=evalf(g(2*Pi)): step:=L/7:
L1:=[0,seq(h(k*step), k=1..6),2*Pi]:
Colors:=convert~([Red,Orange,Yellow,Green,Blue,Indigo,Violet], string):
plots:-display(seq(plot([f(t)[], t=L1[i]..L1[i+1]], color=Colors[i], thickness=12), i=1..7), scaling=constrained, size=[500,400]);

                             

Uniform_Point_Plot.mw

Examples of mathematical models for the formation of spline curves based on polynomials of various orders that simulate certain trajectories are given.
Mathematical models of the formation of a spline curve, taking into account the extreme derivatives of the initial orders, are presented. The construction of the spline curves of the hermit and bezier of various orders, consisting of different segments, is considered. The presented models are systematic and universal, i.e. can be used to generate any polynomial curves with specified extreme derivatives of the vectors.

100_nodes_not_closed.mwExample_1.mwExample_2.mwExample_3.mwExample_4.mwExample_5.mwExample_6.mwExample_7.mw

«Формирования линий OC и бриджей по линии MAT для области с островами».OC_MAT_MA_bridge.mw

As an addition to the post.
Non-orientable surface in the sequence of orientable surfaces. In the picture we see the equations corresponding to the current surface plot.
Just entertainment.
surfaces.mw

We recently published a paper on multiscale-multidomain simulation of battery models.

https://iopscience.iop.org/article/10.1149/1945-7111/abb37b

Some challenges are listed at 

https://twitter.com/UT_MAPLE/status/1311356957941522438

Maple and symbolic math can play a critical role in solving many challenging problems. For example, consider a seemingly-trivial problem

uxx+uyy = 0

x = 0 and x = 1, ux = 0 for all y

y = 1, u = 0, for all x

y = 0, u =1, 0<=x<=0.5

y = 0, uy = 0, 0.5<x<=1

There is a singularity at (0.5,0) and most numerical methods will have trouble there. In these equations, uxx means the second derivative of u with respect to x.

Maple can help solve this problem with conformal mapping to achieve arbitrary precision. As of today, machine precision is not possible with any numerical method even with millions of Degrees of Freedom. The Maple code is given below. A FEM code is given below as well. Models like this can benefit from Maple adding parallel sparse direct and iterative solvers.


 

 

restart;

Digits:=15;

Digits := 15

(1)

 The domain is tranformed from Z = X+IY to w. The points tranformed are

Zdomain:=[[0,0],[1,0],[1,1],[0,1]];

Zdomain := [[0, 0], [1, 0], [1, 1], [0, 1]]

(2)

wdomain:=[0,1,1+a,a+2];

wdomain := [0, 1, 1+a, a+2]

(3)

eq1:=diff(Z(w),w)=-I*K1/sqrt(w)/sqrt(w-1)/sqrt(w-a-1)/sqrt(w-a-2);

eq1 := diff(Z(w), w) = -I*K1/(w^(1/2)*(w-1)^(1/2)*(w-a-1)^(1/2)*(w-a-2)^(1/2))

(4)

 a is not known apriori. The value of a should be found to make sure [1,1] in the Z coordinate is transformed to [1+a] in the w coordinate.

a:=sqrt(2)-1;

a := 2^(1/2)-1

(5)

 Value of K1 is found using the transformation of [1,0] to 1 in the w coordinate

eq11:=1=int(rhs(eq1),w=0..1);

eq11 := 1 = -K1*2^(1/2)*EllipticK(2^(1/2)/2)

(6)

K1:=solve(eq11,K1);

K1 := -(1/2)*(2^(1/2)/EllipticK(2^(1/2)/2))

(7)

 The height Y in the Z coordinate is found by integrating from 1 to 1+a in the w coordinate.

simplify(int(rhs(eq1),w=1..1+a));

(2*I)*2^(1/2)*EllipticK((2^(1/2)-1)/(2^(1/2)+1))/(EllipticK(2^(1/2)/2)*(2^(1/2)+1))

(8)

evalf(%);

1.00000000000000*I

(9)

 The choice of a = sqrt(2)-1 gives the height of 1 for Z coordinate.

eval(simplify(int(rhs(eq1),w=0..1+a)));

(2^(1/2)*EllipticK(2^(1/2)/2)+EllipticK(2^(1/2)/2)+(2*I)*2^(1/2)*EllipticK((2^(1/2)-1)/(2^(1/2)+1)))/(EllipticK(2^(1/2)/2)*(2^(1/2)+1))

(10)

evalf(%);

1.00000000000000+1.00000000000001*I

(11)

 integration from 0 to 1+a in the w coordinate gives 1,1 in the Z coordinate.

simplify(int(rhs(eq1),w=0..1/sqrt(2)));

EllipticF(2^(1/2)/(2+2^(1/2))^(1/2), 2^(1/2)/2)/EllipticK(2^(1/2)/2)

(12)

evalf(%);

.500000000000001

(13)

 Integrating w from 0 to wmid =1/sqrt(2) gives the point 0.5,0 in the Z coordinate

wmid:=1/sqrt(2);

wmid := 2^(1/2)/2

(14)

 Next w domain is transformed to Z2 domain Z2 = X2+IY2

Z2domain:=[[0,0],[1,0],[1,H],[0,H]];

Z2domain := [[0, 0], [1, 0], [1, H], [0, H]]

(15)

wdomain2:=[0,1/sqrt(2),1+a,a+2];

wdomain2 := [0, 2^(1/2)/2, 2^(1/2), 2^(1/2)+1]

(16)

eq2:=diff(Z2(w),w)=-I*K2/sqrt(w)/sqrt(w-wmid)/sqrt(w-1-a)/sqrt(w-a-2);

eq2 := diff(Z2(w), w) = -(2*I)*K2/(w^(1/2)*(4*w-2*2^(1/2))^(1/2)*(w-2^(1/2))^(1/2)*(w-2^(1/2)-1)^(1/2))

(17)

 K2 is found based on the transformation of wmid to [1,0] in Z2 coordinate.

eq21:=1=int(rhs(eq2),w=0..wmid);

eq21 := 1 = -2*K2*EllipticK(1/(((2+2^(1/2))^(1/2))))/(2^(1/2)+1)^(1/2)

(18)

K2:=solve(eq21,K2);

K2 := -(1/2)*((2^(1/2)+1)^(1/2)/EllipticK(1/(((2+2^(1/2))^(1/2)))))

(19)

 The corner 0,1 in the Z coordinate is mapped by integrating eq2 from 0 to 1 in the w coordinate

 

 

int(rhs(eq2),w=0..1);

1+EllipticF((2-2^(1/2))^(1/2), ((2^(1/2)+1)/(2+2^(1/2)))^(1/2))*I/EllipticK(1/(((2+2^(1/2))^(1/2))))

(20)

corner:=evalf(%);

corner := 1.+.559419351518322*I

(21)

 This is the point 1,0 in the original coordinate.

 The height in the Z2 coorinate is found by integrating eq2 from wmid to 1+a.

ytot:=int(rhs(eq2),w=wmid..1+a);

ytot := EllipticK(((2^(1/2)+1)/(2+2^(1/2)))^(1/2))*I/EllipticK(1/(((2+2^(1/2))^(1/2))))

(22)

evalf(%);

1.22004159128347*I

(23)

 The magnitude in the Y direction is given by the coefficient of I, the imaginary number

Ytot:=coeff(ytot,I);

Ytot := EllipticK(((2^(1/2)+1)/(2+2^(1/2)))^(1/2))/EllipticK(1/(((2+2^(1/2))^(1/2))))

(24)

 The analytial solution in the Z2 corordinate is a line in Y2 to satisfy simple zero flux conditions at X2 = 0 and X2 = 1.

phianal:=1+b*Y2;

phianal := 1+b*Y2

(25)

 The value of phi is zero at Y2 = Ytot (originally the cathode domain in the Z domain)

bc:=subs(Y2=Ytot,phianal)=0;

bc := 1+b*EllipticK(((2^(1/2)+1)/(2+2^(1/2)))^(1/2))/EllipticK(1/(((2+2^(1/2))^(1/2)))) = 0

(26)

b:=solve(bc,b);

b := -EllipticK(1/(((2+2^(1/2))^(1/2))))/EllipticK(((2^(1/2)+1)/(2+2^(1/2)))^(1/2))

(27)

 The analytical solution is given by

phianal;

1-EllipticK(1/(((2+2^(1/2))^(1/2))))*Y2/EllipticK(((2^(1/2)+1)/(2+2^(1/2)))^(1/2))

(28)

evalf(phianal);

1.-.819644188480505*Y2

(29)

 The potential at the corner is given by substituting the imaginary value of corner for Y2 in phinanal)

phicorner:=subs(Y2=Im(corner),phianal);

phicorner := 1-.559419351518322*EllipticK(1/(((2+2^(1/2))^(1/2))))/EllipticK(((2^(1/2)+1)/(2+2^(1/2)))^(1/2))

(30)

evalf(phicorner);

.541475179604475

(31)

local flux/current density calculation, written in terms of w is

curr:=b*rhs(eq2)/rhs(eq1);

curr := -(2^(1/2)+1)^(1/2)*2^(1/2)*EllipticK(2^(1/2)/2)*(w-1)^(1/2)/(EllipticK(((2^(1/2)+1)/(2+2^(1/2)))^(1/2))*(4*w-2*2^(1/2))^(1/2))

(32)

average flux/current density calculation for the anode

currave:=int((curr),w=0..wmid)/wmid;

currave := -(1/2)*((2^(1/2)+1)^(1/2)*(2^(1/2)-1)*EllipticK(2^(1/2)/2)*(2^(3/4)+2^(1/4)+arctanh(2^(3/4)/2))*2^(1/2)/EllipticK(2^(3/4)/2))

(33)

Digits:=25:

 The average current density at Y =0, local current density at X = 0,Y=0 and potential at X=1,Y=0 (Corner) can be used to study convergence of FEM and other numerical methods

evalf(currave),evalf(subs(w=0,curr)),evalf(phicorner);

-1.656507648777793388522396, -1.161311530233258689567781, .5414751796044734741869534

(34)

 


 

Download Conformalmapping.mws


 

This FEM code is for solving Laplace's equation with primary current distribution considered in Model 1.
This code is based on FEM weak-form. Biquadratic Lagrange shape functions (9nodes in an element) are used.

restart;

with(LinearAlgebra):

Lx:=1: #length in X

Ly:=1: #length in Y

nx:=10: #number of elements in X (even numbers only)

ny:=10: #number of elements in Y, to be kept same as nx in this version

hx:=Lx/nx: #element size x

hy:=Ly/ny: #element size y

Procedure to perform numerical integration on shape functions to obtain local matrices (can be replaced with analytical integration for this particular problem)
  -Shape functions are also used as weight functions in applying weak formulation. Numerical integration is done using Simpson's rule.
  -Local cartesian coordinates x,y are converted to natural coordinates zeta and eta. This transformation is not required for this simple geomerty but useful in general. zeta and eta are obtained by scaling x and y with hx/2 and hy/2, respectively, in this code.

 

localmatrices:=proc(a1,a2,a3,b1,b2,b3,q1,q2)
global Kx,Ky,Nx,Ny,zeta,eta,c;
local A,dAdzeta,dAdeta,y,x,J,terms,i,j,k,l,dx,dy,fx,fy,fxy,fyy,dzeta,deta,J1,J2;

A:=[(1-zeta)*zeta*(1-eta)*eta/4,-(1-(zeta)^2)*(1-eta)*eta/2,-(1+zeta)*zeta*(1-eta)*eta/4,(1-(eta)^2)*(1+zeta)*zeta/2,(1+zeta)*zeta*(1+eta)*eta/4,(1-(zeta)^2)*(1+eta)*eta/2,-(1-zeta)*zeta*(1+eta)*eta/4,-(1-(eta)^2)*(1-zeta)*(zeta)/2,(1-(zeta)^2)*(1-(eta)^2)]; #bi quadratic langrange shape functions

dAdzeta:=diff(A,zeta);

dAdeta:=diff(A,eta);

y:=[-a1,-a2,-a3,0,a3,a2,a1,0,0];x:=[-b1,0,b1,b2,b3,0,-b3,-b2,0];

J:=simplify(add(dAdzeta[i]*x[i],i=1..9)*add(dAdeta[i]*y[i],i=1..9)-add(dAdzeta[i]*y[i],i=1..9)*add(dAdeta[i]*x[i],i=1..9));

Nx:=[seq((simplify(add(dAdeta[i]*y[i],i=1..9))*dAdzeta[j]-simplify(add(dAdzeta[i]*y[i],i=1..9))*dAdeta[j])/simplify(J),j=1..9)];

Ny:=[seq((-dAdzeta[j]*simplify(add(dAdeta[i]*x[i],i=1..9))+dAdeta[j]*simplify(add(dAdzeta[i]*x[i],i=1..9)))/simplify(J),j=1..9)];

Kx:=Matrix(nops(A),nops(A),datatype=float[8]):

Ky:=Matrix(nops(A),nops(A),datatype=float[8]):
c:=Vector(nops(A),datatype=float[8]):

terms:=20:#number of terms for numerical integration
dzeta:=2/terms:
deta:=2/terms:

for i from 1 to nops(Nx) do #loop to obtain local matrices      

for j from 1 to nops(Ny) do
Kx[i,j]:=0;
Ky[i,j]:=0;

for k from 0 to terms do #outer loop double integration, integration in zeta

if k = 0 then fx[k]:= subs(zeta=-1,Nx[i]*Nx[j]*J); fy[k]:= subs(zeta=-1,Ny[i]*Ny[j]*J);  
elif k = terms then
fx[k]:= subs(zeta=-1+(k*dzeta),Nx[i]*Nx[j]*J);
fy[k]:= subs(zeta=-1+(k*dzeta),Ny[i]*Ny[j]*J);  
elif irem(k,2) = 0 then
fx[k]:= 2*subs(zeta=-1+(k*dzeta),Nx[i]*Nx[j]*J);
fy[k]:=     2*subs(zeta=-1+(k*dzeta),Ny[i]*Ny[j]*J);
else fx[k]:= 4*subs(zeta=-1+(k*dzeta),Nx[i]*Nx[j]*J);
fy[k]:=     4*subs(zeta=-1+(k*dzeta),Ny[i]*Ny[j]*J);  end if;

for l from 0 to terms do #inner loop double integration, integration in eta

if l = 0 then fxy[l]:= subs(eta=-1,fx[k]); fyy[l]:= subs(eta=-1,fy[k]);
elif l = terms then fxy[l]:= subs(eta=-1+(l*deta),fx[k]); fyy[l]:= subs(eta=-1+(l*deta),fy[k]);
elif irem(l,2) = 0 then fxy[l]:= 2*subs(eta=-1+(l*deta),fx[k]); fyy[l]:= 2*subs(eta=-1+(l*deta),fy[k]);
else fxy[l]:=4*subs(eta=-1+(l*deta),fx[k]); fyy[l]:=4*subs(eta=-1+(l*deta),fy[k]); end if;
Kx[i,j]:=Kx[i,j]+fxy[l];
Ky[i,j]:=Ky[i,j]+fyy[l];

end do;
    
end do;
Kx[i,j]:=Kx[i,j]*dzeta*deta/9;
Ky[i,j]:=Ky[i,j]*dzeta*deta/9;
end do;
end do:

end proc:

n:=nx*ny; #total number of elements

n := 100

(1)

Nx1:=nx*2+1: #number of nodes in x in one row

N:=Nx1*(2*ny+1); # total number of nodes/equations

N := 441

(2)

K:=Matrix(N,N,storage=sparse): # global K matrix

C:=Vector(N,storage=sparse): # global c matrix

L2G:=Matrix(n,9):  #mapping matrix - each row has node numbers for each element

l:=1:k:=1:
localmatrices(hy/2,hy/2,hy/2,hx/2,hx/2,hx/2,0,0): kx:=copy(Kx):ky:=copy(Ky):c0:=copy(c):

for i from 1 to n do #modifying,adding and assembling matrices to get global matrix
 
if i<=nx/2 then  
a1:=copy(kx); a2:=copy(ky); a3:=0; a1[1..3,1..9]:=IdentityMatrix(3,9); a2[1..3,1..9]:=Matrix(3,9,shape=zero); a4:=a1+a2; c:=copy(c0); c[1..3]:=1.0;

elif i=nx/2+1 then  a1:=copy(kx); a2:=copy(ky); a3:=0; a1[1,1..9]:=IdentityMatrix(1,9); a2[1,1..9]:=Matrix(1,9,shape=zero); a4:=a1+a2; c:=copy(c0); c[1]:=1.0;

elif i>nx*(ny-1) then a1:=copy(kx); a2:=copy(ky); a3:=0; a1[5..7,5..7]:=IdentityMatrix(3,3);
a1[5..7,1..4]:=ZeroMatrix(3,4);
a1[5..7,8..9]:=ZeroMatrix(3,2); a2[5..7,1..9]:=Matrix(3,9,shape=zero); a4:=a1+a2; c:=copy(c0); c[5..7]:=0;

else a1:=kx; a2:=ky; a3:=0;a4:=a1+a2; c:=c0;  end if;

L2G[i,1..9]:=Matrix([l,l+1,l+2,l+2+Nx1,l+2+Nx1*2,l+1+Nx1*2,l+Nx1*2,l+Nx1,l+1+Nx1]):

k:=k+1:
 
if k>nx then k:=1; l:=l+Nx1+3;

else l:=l+2; end if:

indx2:=L2G[i,1..9]:
indx2:=convert(indx2,list):

C[indx2]:=C[indx2]+c[1..9];
c[1..9];

for i1 from 1 to 9 do
indx1:=L2G[i,i1]:
K[indx1,indx2]:=K[indx1,indx2]+a4[i1,1..9]:
end do:

end do:

phi:=LinearSolve(K,C,method=SparseLU): #linear set of equations solved using Sparse LU solver

phi_at(1,0):=phi[Nx1];
 

phi_at(1, 0) := .546587799122513

(3)

dNdy:=copy(Ny):

dNdy_bottom_left:=subs(eta=-1,zeta=-1,dNdy):

current_at(0,0):=add(dNdy_bottom_left[i]*phi[L2G[1,i]],i=1..nops(Ny));

current_at(0, 0) := -1.15773815354626

(4)

if irem(nx/2,2)=0
then current_at(0,0.25):=add(dNdy_bottom_left[i]*phi[L2G[nx/4+1,i]],i=1..nops(Ny));
else
dNdy_bottom_center:=subs(eta=-1,zeta=0,dNdy):
current_at(0,0.25):=add(dNdy_bottom_center[i]*phi[L2G[(nx/2+1)/2,i]],i=1..nops(Ny));
end if;

dNdy_bottom_center := [0, -30, 0, 0, 0, -10, 0, 0, 40]

current_at(0, .25) := -1.26989097821724

(5)

 

 


 

Download FEM_2D.mws

DataFrames: An example from the 2020 U.S. Presidential election

(Or why DataFrames are more powerful and readable than spreadsheets.)

 

In this example of working with DataFrames, the goal is to use a spreadsheet from a website, which contains polling data, to estimate the probability each of the two candidates from the major parties will win the US Presidential election in November.  I first tried doing the calculations with a spreadsheet, but I discovered DataFrames was far more powerful. Warning: This worksheet uses live data. Hence the outcome at the end of the worksheet is likely to change daily. A more extensive example with even more common DataFrame operations should be available soon.

 

How the US Presidential election works - highly simplified version: In the US there are only two parties for which their candidate could win the election:  the Democratic party and Republican party. The Republican party is often referred to as the "Grand Old Party", or GOP. Each state executes its own election. The candidate who receives the most votes wins the states "electoral votes" (EV). The number of the electoral votes for each state is essentially proportional to the population of the state. A candidate who receives a total of 270 or more EVs out of 538, is declared the president of the US for the next term, which starts January 20 of 2021.

 

Creating DataFrame from web based data:

First I download the data from the website. It is a CSV spreadsheet.

 

restart; interface(displayprecision = 3); interface(rtablesize = [6, 8]); web_data := Import("https://www.electoral-vote.com/evp2020/Pres/pres_polls.csv")

_m2211970420352

Each row contains information about a poll conducted in one of the states.  The first poll starts on row 2, hence the number of polls are:

Npolls := upperbound(web_data, 1)-1

572

Now I want to create a new DataFrame containing only the most useful information. In web_data, many are the columns are not important. However I do want to keep the column label names from those columns I wish to retain.

 

web_data_cols := [1, 3, 4, 5, 6]; column_labels := convert(web_data[1, web_data_cols], list)

["Day", "State", "EV", "Dem", "GOP"]

 

Because  the first poll in web_data is labeled 2, I would like to relabel all the polls starting from 1

row_labels := [seq(1 .. Npolls)]

 

Creating a DataFrame from a Matrix or another DataFrame:  (with row labels and column labels)

 

Now I can build the DataFrame that I will be working with:

 

poll_data := DataFrame(web_data[2 .. (), web_data_cols], 'columns' = column_labels, 'rows' = row_labels)

_m2211956910784

What each column means

* "Day" - day of the year in 2020 when the poll within the state was halfway completed. The larger the value, the more recent the poll.

* "State" - the state in the US where the poll was conducted. The candidate that receives the most votes "wins the state".

* "EV" - the number of electoral votes given to the candidate who receives the most votes within the state.

* "Dem" - the percentage of people who said they are going to vote for the candidate from the Democratic party.

* "GOP" - the percentage of people who said they are going to vote for the candidate from the Republican party.

Sorting:

By using the sort function, using the `>` operator, I can see which polls are the more recent. (If you run the worksheet yourself, the outcome will change as more polls are added to the website spreadsheet.)

poll_data := sort(poll_data, "Day", `>`)

_m2211960016288

 

Selecting Unique entries - by column values:

For the my simple analysis, I will use only the most recent poll, one from each state. Hence, using AreUnique, I can pull the first row that matches a state name. This new DataFrame called states.

 

states := poll_data[AreUnique(poll_data["State"])]

_m2211969565344

(Note, one of the "states" is the District of Columbia, D.C., which is why there are 51 rows.)

 

Removing a column: (and relabeling rows)

This next example isn't necessary, but shows some of the cool features of DataFrames.

 

Since there is only 1 entry per state, I'm going to remove the "State" column and relabel all the rows with the state names

state_names := convert(states["State"], list); states := DataFrame(Remove(states, "State"), 'rows' = state_names)

2

_m2211957755840

 

Indexing by row labels:


This allow me to to display information by individual states. What is the data for California, Maine and Alaska?

states[["California", "Maine", "Alaska"], () .. ()]

_m2211977321984

 

Mathematics with multiple-columns:

 

My preference is to work with fractions, rather than percentages. Hence I want all the values in the "Dem" and "GOP" to be divided by 100 (or multiplied by 1/100).  Treating each column like a vector, the multiplication is performed individually on each cell. This is what the tilda, "~", symbol performs.

states[["Dem", "GOP"]] := `~`[`*`](states[["Dem", "GOP"]], 1/100.); states

_m2211957755840

 

Mathematics: using a function to calculate a column

 

For the next action, I want to use the power of the Statistics package to create a "probability of winning the state" function.

 

For simplicity, I will assume the outcome of the voting in a state is purely random, but is conditional to popularity of each candidate as measured by the polls. I'll assume the likelihood of an outcome follows a normal (Gaussian) distribution with the peak being at point where the difference of the polling of the two candidates is zero. (Note, other than 2016, where there was an unusually larger percentage of undecided voters on election day, this simple model is reasonable accurate. For example, in 2012, of the states which appeared to be the "closest", the winner over-performed his polling in half of them, and under-performed in the other half with a mean difference of nearly zero.)  From previous elections, the standard deviation of differences between polling values and the actual outcome is at most 0.05, however, it does increase with the fraction of undecided voters.

 

To mathematically model this situation, I have chosen to use the "Cumulative Density Function" CDF in the Statistics package. It will calculate the probability that a candidate polling with fraction f1 wins the election if the other candidate is polling with fraction f2.  The variable u is the fraction of undecided voters. It is included in the calculation to increase the spread of the possible outcomes.

 

win_prob := Statistics:-CDF(Statistics:-RandomVariable(Normal(0., 0.5e-1+(1/4)*u)), f1-f2)

1/2+(1/2)*erf((1/2)*(f1-f2)*2^(1/2)/(0.5e-1+(1/4)*u))

 

Converting this expression into a function using the worst named function in Maple, unapply:

win_prob_f := unapply(evalf(win_prob), [f1, f2, u])

proc (f1, f2, u) options operator, arrow; .5000000000+.5000000000*erf(.7071067810*(f1-1.*f2)/(0.5e-1+.2500000000*u)) end proc

 

Now I can calculate a DataFrames column of the "win probability", in this case, for the candidate from the Democratic platy. By apply the function, individually, using the columns "Dem" and "GOP", I produce:

dem_win_prob := `~`[win_prob_f](states["Dem"], states["GOP"], `~`[`-`](1, `~`[`+`](states["Dem"], states["GOP"])))

_m2212010910496

Appending a column:

 

I can add this column to the end of the states with the label "DemWinProb":

 

states := Append(states, dem_win_prob, label = "DemWinProb")

_m2212009017568

 

Mathematics of adding the entries of a column:

 

How many electoral votes are available? add them up.

Total_EV := add(states["EV"])

538

 

While the number of EV a candidate wins is discrete, I can use the "win probability" from each state to estimate the total number of EV each of the candidates might win. This means adding up number of EV in each state times, individually, the probability of winning that state:

Dem_EV := round(add(`~`[`*`](states["EV"], states["DemWinProb"])))

354

Currently, the candidate from the Democratic party is likely to win more then 300 electoral vtes.

 

What about for the candidate from the Republican / "GOP" party?

gop_win_prob := `~`[win_prob_f](states["GOP"], states["Dem"], `~`[`-`](1, `~`[`+`](states["Dem"], states["GOP"]))); GOP_EV := round(add(`~`[`*`](states["EV"], gop_win_prob)))

184

Summing the two EV values, we obtain the total number of electoral votes.

Dem_EV+GOP_EV

538

  NULL

 

Download DataFrames_Example.mw

Hi,
Some people using the Windows platform have had problems installing MapleCloud packages, including the Maplesoft Physics Updates. This problem does not happen in Macintosh or Linux/Unix, also does not happen with all Windows computers but with some of them, and is not a problem of the MapleCloud packages themselves, but a problem of the installer of packages.

I understand that a solution to this problem will be presented within an upcoming Maple dot release.

Meantime, there is a solution by installing a helper library; after that, MapleCloud packages install without problems in all Windows machines. So whoever is having trouble installing MapleCloud packages in Windows and prefers not to wait until that dot release, instead wants to install this helper library, please email me at physics@maplesoft.com

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

HI,
 

This post concerns the simulation of a physical system whose behavior is governed by ODEs.
It is likely that some people will think that all which follows is nothing but embellishments  or a waste of time.
And in some sense they will be right.
I was thinking the same until I received some sharp remarks at the occasion of a few presentations of my works. 
So experience has proven me that doing a presentation in front of project managers with only 2D curves often leads to smiles, not to speak about those who raise their eyes to heaven in front of the poverty of the slides. 
Tired of this attitude, I decided to replace these 2D curves with a short film, which of course does not reveal more than what these 2D curves were already revealing, but which is pretty enough for the financing keeps going on.

For those of you who might regret this situation, just consider this work as a demonstration of the capabilities of Maple in 3D rendering.


PS: all the display outputs have been removed to avoid loading an unnecessary huge file.
      The two last commands must be uncommented to play the animation.

 

Download ODE_Movie.mw

 

Newton raphson method is used for optimization of functions and is based on taylor series expansion. Here is the code for a three level newton raphson method.
 

restart; with(Student[MultivariateCalculus]); ff := proc (xx) xx^3-2*xx+2 end proc; ii := 0; XX[ii] := 2; while ii < 25 do GR := Gradient(ff(xx), [xx] = [XX[ii]]); GR1 := evalf(GR[1]); HESS := Student[VectorCalculus]:-Hessian(ff(xx), [xx] = [XX[ii]]); HESS1 := evalf(HESS[1]); YY[ii] := XX[ii]-GR1[1]/HESS1[1]; GR := Gradient(ff(xx), [xx] = [YY[ii]]); GR1 := evalf(GR[1]); HESS := Student[VectorCalculus]:-Hessian(ff(xx), [xx] = [YY[ii]]); HESS1 := evalf(HESS[1]); ZZ[ii] := YY[ii]-GR1[1]/HESS1[1]; GR := Gradient(ff(xx), [xx] = [ZZ[ii]]); GR1 := evalf(GR[1]); HESS := Student[VectorCalculus]:-Hessian(ff(xx), [xx] = [ZZ[ii]]); HESS1 := evalf(HESS[1]); ii := ii+1; XX[ii] := ZZ[ii-1]-GR1[1]/HESS1[1]; printf("%a\n", XX[ii]) end do

.8180854533
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808
.8164965808

 

ff(.8164965808)

.911337892

(1)

with(Optimization); Minimize(xx^3-2*xx+2, xx = -2 .. 2)

[HFloat(0.9113378920963653), [xx = HFloat(0.8164965785244629)]]

(2)

NULL


 

Download THREE_LEVEL_NEWTON_RAPHSON_METHOD1.mw

In the present work we are going to demonstrate the importance of the study of vector analysis, with modeling and simulation criteria, using the MapleSim scientific software from MapleSoft. Nowadays, the majority of higher education centers direct their teaching of vector analysis in an abstract way and there are few or no teachers who carry out applications using modeling and simulation. (In spanish)

IPN_CICATA_2020.pdf

Expo_MapleSim_CICATA.zip

 

The strandbeest is a walking machine developed by Theo Jansen. Its cleverly designed legs consist of single-degree-of-freedom linkage mechanisms, actuated by the turning of a wind-powered crankshaft.

His working models are generally large - something of the order of the size of a bus. Look for videos on YouTube.  Commercially made small toy models are also available.  This one sells for under $10 and it's fun to assemble and works quite well. Beware that the kit consists of over 100 tiny pieces - so assembling it is not for the impatient type.

Here is a Maple worksheet that produces an animated strandbeest. Link lengths are taken from Theo Jansen's video (go to his site above and click on Explains) where he explains that he calculated the optimal link lengths by applying a genetic algorithm.

Here is a Maple animation of a single leg.  The yellow disk represents the crankshaft.

And here are two legs working in tandem:

Here is the complete beest, running on six legs. The crankshaft turns at a constant angular velocity.

The toy model noted above runs on twelve legs for greater stability.

Download the worksheet: strandbeest.mw

 

This may be of interest to anyone curious about why the effective area of an isotropic antenna is λ^2/4π.


 

Friis Transmission Equation

NULL

Initialise

   

NULL``

The Hertzian Dipole antenna

 

The Hertzian Dipole is a conceptual antenna that carries a constant current along its length.

 

 

By laying a number of these small current elements end to end, it is possible to model a physical antenna (such as a half-wave dipole for example).  But since we are only interested in obtaining an expression for the effective area of an Isotropic Antenna (in order to derive The Friis Transmission Equation) the Hertzian Dipole will be sufficient for our needs.``

NULL

``

Maxwell's Equations

 

Since the purpose of a radio antenna is to either launch or to receive radio waves, we know that both the antenna, and the space surrounding the antenna, must satisfy Maxwell's Equations. We define Maxwell's Equations in terms of vector functions using spherical coordinates:

 

Maxwell–Faraday equation:

Maxwell_1 := Curl(E_(r, theta, `&varphi;`, t)) = -mu*(diff(H_(r, theta, `&varphi;`, t), t))

Physics:-Vectors:-Curl(E_(r, theta, varphi, t)) = -mu*(diff(H_(r, theta, varphi, t), t))

(3.1)

Ampère's circuital law (with Maxwell's addition):

Maxwell_2 := Curl(H_(r, theta, `&varphi;`, t)) = J_(r, theta, `&varphi;`, t)+epsilon*(diff(E_(r, theta, `&varphi;`, t), t))

Physics:-Vectors:-Curl(H_(r, theta, varphi, t)) = J_(r, theta, varphi, t)+varepsilon*(diff(E_(r, theta, varphi, t), t))

(3.2)

Gauss' Law:

Maxwell_3 := Divergence(E_(r, theta, `&varphi;`, t)) = rho/epsilon

Physics:-Vectors:-Divergence(E_(r, theta, varphi, t)) = rho/varepsilon

(3.3)

Gauss' Law for Magnetism:

Maxwell_4 := Divergence(H_(r, theta, `&varphi;`, t)) = 0

Physics:-Vectors:-Divergence(H_(r, theta, varphi, t)) = 0

(3.4)

Where:

        E is the electric field strength [Volts/m]

        H is the magnetic field strength [Amperes/m]

        J is the current density (current per unit area) [Amperes/m2]

        ρ is the charge density (charge per unit volume) [Coulombs/m3]

        ε is Electric Permittivity

        μ is Magnetic Permeability

NULL

Helmholtz decomposition

 

The Helmholtz Decomposition Theorem states that providing a vector field, (F) satisfies appropriate smoothness and decay conditions, it can be decomposed as the sum of components derived from a scalar field, (Φ) called the "scalar potential", and a vector field (A) called the "vector potential".

 

F = -VΦ + V×A

 

And that the scalar (Φ) and vector (A) potentials can be calculated from the field (F) as follows (image from https://en.wikipedia.org/wiki/Helmholtz_decomposition):

 

Where:

        r is the vector from the origin to the observation point (P) at which we wish to know the scalar or vector potential.

        r' is the vector from the origin to the source of the scalar or vector potential (i.e. a point on the Hertzian Dipole antenna).

        V'·F(r')  is the Divergence of the vector field (F) at source position r'.

        V'×F(r')  is the Curl of the vector field (F) at source position r'.

 

 

Calculating the Scalar Potential for the magnetic Field, H

 

We know that the Divergence of the magnetic field (H) is zero:

Maxwell_4

Physics:-Vectors:-Divergence(H_(r, theta, varphi, t)) = 0

(4.1.1)

And so the magnetic field (H) must have a scalar vector potential of zero:

`&Phi;__H` := 0

0

(4.1.2)

 

Calculating the Vector Potential for the magnetic Field, H

 

We know that the Curl of the magnetic field (H) is equal to the sum of current density (J) and the rate of change of the electric filled (E):

Maxwell_2

Physics:-Vectors:-Curl(H_(r, theta, varphi, t)) = J_(r, theta, varphi, t)+varepsilon*(diff(E_(r, theta, varphi, t), t))

(4.2.1)

Since the Hertzian Dipole is a conductor, we need only concern ourselves with the current density (J) when calculating the vector potential (A). Integrating current density (J) over the volume of the antenna, is equivalent to integrating current along the length of the antenna (L).

 

We know that Maxwell's Equations can be solved for single frequency (monochromatic) fields, so we will excite our antenna with a single frequency current:

"`I__antenna`(t):=`I__0`*(e)^(j*omega*t);"

proc (t) options operator, arrow, function_assign; Physics:-`*`(I__0, exp(Physics:-`*`(I, omega, t))) end proc

(4.2.2)

We can simplify the integral for the vector potential (A) by recognising that:

 

1. 

Our observation point (P) will be a long way from the antenna and so (r) will be very large.

2. 

The length of the antenna (L) will be very small and so (r') will be very small.

 

Since |r|>>|r'|, we can substitute |r-r'| with r.

 

Because we have decided that the observation point at r will be a long way from the antenna, we must allow for the fact that the observed antenna current will be delayed.  The delay will be equal to the distance from the antenna to the observation point |r-r'| (which we have simplified to r), divided by the speed of light (c).  The time delay will therefore be approximately equal to r/c and so the observed antenna current becomes:

"`I__observed`(t):=`I__0`*(e)^(j*omega*(t-r/(c)));"

proc (t) options operator, arrow, function_assign; Physics:-`*`(I__0, exp(Physics:-`*`(I, omega, Physics:-Vectors:-`+`(t, -Physics:-`*`(r, Physics:-`^`(c, -1)))))) end proc

(4.2.3)

 

Since the length, L of the antenna will be very small, we can assume that the current is in phase at all points along its length.  Working in the Cartesian coordinate system, the final integral for the vector potential for the magnetic field is therefore:

A__H_ := (int(I__0*exp(I*omega*(t-r/c))*_k/r, z = -(1/2)*L .. (1/2)*L))/(4*Pi)

(1/4)*I__0*exp(I*omega*(t-r/c))*_k*L/(Pi*r)

(4.2.4)

 

We will now convert to the spherical coordinate system, which is more convenient when working with radio antenna radiation patterns:

The radial component of the observed current (and therefore vector potential), will be at a maximum when the observer is on the z-axis (that is when θ=0 or θ=π) and will be zero when the observer is in the x-y-plane:

A__Hr := (A__H_._k)*cos(theta)

(1/4)*I__0*exp(I*omega*t-I*omega*r/c)*L*cos(theta)/(Pi*r)

(4.2.5)

The angular component of the observed current (and therefore vector potential), in the θ direction will be zero when the observer is on the z-axis (that is when θ=0 or θ=π) and will be at a maximum when the observer is in the x-y-plane:

`A__H&theta;` := -(A__H_._k)*sin(theta)

-(1/4)*I__0*exp(I*omega*t-I*omega*r/c)*L*sin(theta)/(Pi*r)

(4.2.6)

Since the observed current (and therefore vector potential) flows along the z-axis, there will be no variation in the ϕ direction.  That is to say, that varying ϕ will have no impact on the observed vector potential.

`A__H&varphi;` := 0

0

(4.2.7)

And so the vector potential for the magnetic field (H) expressed using spherical coordinate system is:

A__H_ := A__Hr*_r+_theta*`A__H&theta;`+`A__H&varphi;`*`_&varphi;`

(1/4)*I__0*exp(I*omega*t-I*omega*r/c)*L*cos(theta)*_r/(Pi*r)-(1/4)*I__0*exp(I*omega*t-I*omega*r/c)*L*sin(theta)*_theta/(Pi*r)

(4.2.8)

NULLNULL

Calculating the Magnetic Field components

 

The Helmholtz Decomposition Theorem states that providing a vector field (F) satisfies appropriate smoothness and decay conditions, it can be decomposed as the sum of components derived from a scalar field (Φ) called "scalar potential", and a vector field (A) called the vector potential.

 

F = -VΦ + V×A

NULL

And so the magnetic field, H will be:

NULL

H_ = -(Gradient(`&Phi;__H`))+Curl(A__H_)

H_ = ((1/4)*I)*I__0*L*exp(I*omega*t-I*omega*r/c)*sin(theta)*omega*_phi/(c*Pi*r)+(1/4)*I__0*L*exp(I*omega*t-I*omega*r/c)*sin(theta)*_phi/(Pi*r^2)

(4.3.1)

We see that the magnetic field comprises two components, one is inversely proportional to the distance from the antenna (r) and the other falls off with r2.  Since we are interested in the far-field radiation pattern for the antenna, we can ignore the r2 component and so the expression for the magnetic field reduces to:

H_ := I*omega*I__0*L*exp(I*omega*(t-r/c))*sin(theta)*_phi/(4*Pi*c*r)

((1/4)*I)*omega*I__0*L*exp(I*omega*(t-r/c))*sin(theta)*_phi/(Pi*c*r)

(4.3.2)

We can further simplify by substituting ω/c for 2π/λ:``

H_ := (I*2)*Pi*L*I__0*exp(I*omega*t-(I*2)*Pi*r/lambda)*sin(theta)*_phi/(4*Pi*lambda*r)

((1/2)*I)*L*I__0*exp(I*omega*t-(2*I)*Pi*r/lambda)*sin(theta)*_phi/(lambda*r)

(4.3.3)

````

````

 

Calculating the Poynting Vector

 

We know that the magnitude of the Poynting Vector (S) can be calculated as the cross product of the electric field vector (E) and the magnetic field vector (H) :

        S = -E x H which is analogous to a resistive circuit where power is the product of voltage and current: P=V*I.

We also know that the impedance of free space (Z) can be calculated as the ratio of the electric field (E) and magnetic field (H) vectors: Z = E /H = "sqrt((mu)/(`&epsilon;`))."

This is analogous to a resistive circuit where resistance is the ratio of voltage and current: R=V/I.

 

This provides two more methods for calculating the Poynting Vector (S):

        S = -E·E/Z which is analogous to a resistive circuit where power, P=V2/R, and:

        S = -H·H*Z which is analogous to a resistive circuit where power, P=I2R.

 

Since we have obtained an expression for the magnetic field vector (H), we can derive an expression for the Poynting Vector (S):

S_ = -(H_.H_)*Z*_r

S_ = (1/4)*L^2*I__0^2*(exp(I*omega*t-(2*I)*Pi*r/lambda))^2*sin(theta)^2*Z*_r/(lambda^2*r^2)

(5.1)

We can separate out the time variable part to yield:

S_ := S__0*(exp(I*omega*t-(I*2)*Pi*r/lambda))^2*_r

S__0*(exp(I*omega*t-(2*I)*Pi*r/lambda))^2*_r

(5.2)

Where:

S__0 := L^2*I__0^2*sin(theta)^2*Z/(4*lambda^2*r^2)

(1/4)*L^2*I__0^2*sin(theta)^2*Z/(lambda^2*r^2)

(5.3)

And we can visualise this radiation pattern using Maple's plotting tools:

AntennaAxis := arrow(`<,>`(0, 0, -1), `<,>`(0, 0, 1), difference, color = "LightSteelBlue")``

AntennaPattern := plot3d(sin(theta)^2, phi = 0 .. 2*Pi, theta = 0 .. Pi, coords = spherical, scaling = constrained, size = [800, 800], labels = [x, y, z], title = ["The Electromagnetic radiation pattern of a Hertzian Dipole\n\nThe blue arrow represents the axis of the antenna", font = [Times, bold, 20]])
``

display(AntennaAxis, AntennaPattern, scaling = constrained, axes = frame)

 

So the Hertzian Dipole produces a electromagnetic radiation pattern with a pleasing doughnut shape :-)``

NULL``

Calculating Antenna Gain

 

We can calculate the total power radiated by the Hertzian Dipole by integrating the power flux density over all solid angles dΩ=sin(θ) dθ dφ.  Since we have expressed power flux density in terms of watts per square meter, we multiply the solid angle by r2 to convert the solid angle expressed in steradians into an area expressed in m2.

NULL

P__tx := int(int(S__0*r^2*sin(theta), theta = 0 .. Pi), phi = 0 .. 2*Pi)

(2/3)*L^2*I__0^2*Z*Pi/lambda^2

(6.1)

We can now use this power to calculate the power flux density that would be produced by an isotropic antenna by dividing the total transmitted power by the area of a sphere with radius r:

S__Isotropic := P__tx/(4*Pi*r^2)

(1/6)*L^2*I__0^2*Z/(lambda^2*r^2)

(6.2)

``

``

The Gain of the Hertzian Dipole is defined as the ratio between the maximum power flux density produced by the Hertzian Dipole and the maximum power flux density produced by the isotropic antenna:

G__HertzianDipole := S__0/S__Isotropic

(3/2)*sin(theta)^2

(6.3)

AntennaAxis := arrow(`<,>`(-1, 0), `<,>`(1, 0), difference, color = "LightSteelBlue")

Gain := polarplot(G__HertzianDipole, theta = -Pi .. Pi, axis[radial] = [color = "Blue"], angularorigin = top, angulardirection = clockwise, size = [800, 800], labels = [x, z], title = ["The Gain of a Hertzian Dipole over an isotropic antenna  \n\nThe blue arrow represents the axis of the antenna", font = [Times, bold, 20]])

display(AntennaAxis, Gain, scaling = constrained, axes = frame)

 

````

````

Calculating Radiation Resistance

 

The input impedance of the Hertzian Dipole will have both a real and a reactive part.  The reactive part will be associated with energy storage in the near field and will not contribute to the Poynting Vector in the far-field.  For an ideal antenna (with no resistive power loss) the real part will be responsible for the radiated power:

P__tx = I__0^2*R__rad

(2/3)*L^2*I__0^2*Z*Pi/lambda^2 = I__0^2*R__rad

(7.1)

R__rad := solve((2/3)*L^2*I__0^2*Z*Pi/lambda^2 = I__0^2*R__rad, R__rad)

(2/3)*L^2*Z*Pi/lambda^2

(7.2)

````

``

Calculating the power received by a Hertzian Dipole

 

If an electromagnetic field (E) is incident on the Hertzian Dipole antenna, it will generate an Electro-Motive Force (EMF) at the antenna terminals.  The EMF will be at a maximum when the transmitter is on the x-y-plane (that is when θ=π/2) and will be zero when the transmitter is on the z-axis.

 

For and incident E-field:

E := E__0*exp(I*omega*t)

E__0*exp(I*omega*t)

(8.1)

The z-axis component will be:

E__z := E*sin(theta)

E__0*exp(I*omega*t)*sin(theta)

(8.2)

The z-axis component of the E-field will create an EMF at the antenna terminals that will draw charge out of the receiver to each tip of the antenna. We can calculate the work done per unit charge by integrating the z-axis component of (E) over the length of the antenna (L):

V__emf := int(E__z, z = -(1/2)*L .. (1/2)*L)

E__0*exp(I*omega*t)*sin(theta)*L

(8.3)

In order to extract the maximum possible power from the antenna, we will form a conjugate match between the impedance of the antenna and the load.  This means that the load resistance must be the same as the radiation resistance of the antenna.  The voltage developed across the load resistance will therefore be half of the open circuit EMF:

V__pd := (1/2)*V__emf

(1/2)*E__0*exp(I*omega*t)*sin(theta)*L

(8.4)

And so the power delivered to the load will be:

P__rx := V__pd^2/R__rad

(3/8)*E__0^2*(exp(I*omega*t))^2*sin(theta)^2*lambda^2/(Pi*Z)

(8.5)

NULL

``

Calculating the Effective area of an Isotropic Antenna

 

We can also calculate the power received by the Hertzian Dipole by multiplying the power flux density arriving at the antenna with the effective area of an isotropic antenna and the gain of the Hertzian Dipole relative to an isotropic antenna:

P__rx = G__HertzianDipole*A__Isotropic*S__rx

(3/8)*E__0^2*(exp(I*omega*t))^2*sin(theta)^2*lambda^2/(Pi*Z) = (3/2)*sin(theta)^2*A__Isotropic*S__rx

(9.1)

We can express the incident power flux density in terms of electric field strength and wave impedance:

subs(S__rx = E^2/Z, (3/8)*E__0^2*(exp(I*omega*t))^2*sin(theta)^2*lambda^2/(Pi*Z) = (3/2)*sin(theta)^2*A__Isotropic*S__rx)

(3/8)*E__0^2*(exp(I*omega*t))^2*sin(theta)^2*lambda^2/(Pi*Z) = (3/2)*sin(theta)^2*A__Isotropic*E__0^2*(exp(I*omega*t))^2/Z

(9.2)

Rearranging, we obtain an expression for the effective area of the isotropic antenna:

A__Isotropic := solve((3/8)*E__0^2*(exp(I*omega*t))^2*sin(theta)^2*lambda^2/(Pi*Z) = (3/2)*sin(theta)^2*A__Isotropic*E__0^2*(exp(I*omega*t))^2/Z, A__Isotropic)

(1/4)*lambda^2/Pi

(9.3)

NULL

``

The Friis Transmission Equation

 

P__tx := 'P__tx'

We can calculate the power flux density that would be produced by an isotropic antenna at a distance r from the antenna by dividing the total transmitted power Ptx by the area of a sphere with radius r:

P__tx/(4*Pi*r^2)

(1/4)*P__tx/(Pi*r^2)

(10.1)

And so the power flux density that would be produced by an antenna with gain Gtx is:

S__tx := (1/4)*G__tx*P__tx/(Pi*r^2)

(1/4)*G__tx*P__tx/(Pi*r^2)

(10.2)

We can calculate the power received by an isotropic antenna by multiplying the power flux density incident onto the antenna with the effective area of an isotropic antenna:

S__tx*A__Isotropic

(1/16)*G__tx*P__tx*lambda^2/(Pi^2*r^2)

(10.3)

And so the power that would be received by an antenna with gain Grx is:

P__rx := (1/16)*G__rx*G__tx*P__tx*lambda^2/(Pi^2*r^2)

(1/16)*G__rx*G__tx*P__tx*lambda^2/(Pi^2*r^2)

(10.4)

The free space path loss is defined as the ratio between the received power and the transmitted power:

P__rx/P__tx

(1/16)*G__rx*G__tx*lambda^2/(Pi^2*r^2)

(10.5)

And so:

PathLoss := G__tx*G__rx*(lambda/(4*Pi*r))^2

(1/16)*G__rx*G__tx*lambda^2/(Pi^2*r^2)

(10.6)

````

````

NULL


 

Download Friis_Transmission_Equation.mw

Question about deflection and vibration of beams occur with some regularity in this forum.  Search for "beam" to see several pages of hits.

In this post I present a general approach to calculating the vibrational modes of a beam that applies to both single-span and multi-span beams.  The code is not perfectly polished, but it is sufficiently documented to enable the interested user to modify/extend it as needed.

Vibrational modes of multi-span Euler-Bernoulli beams

through Krylov-Dunction functions

Rouben Rostamian
2020-07-19

restart;

Note:  Maple defines the imaginary unit I = sqrt(-1). We want to use the
symbol I as the beam's cross-sectional moment of inertia.
Therefore we redefine the imaginary unit (for which we have no

use) as II and free up the symbol I for our use.

interface(imaginaryunit=II):

with(LinearAlgebra):

 

The Euler-Bernoulli beam equation
"rho*A*((&PartialD;)^2u)/((&PartialD;)^( )t^2)+E*I*((&PartialD;)^(4)u)/((&PartialD;)^( )x^(4))=0".

 

We wish to determine the natural modes of vibration of

a possibly multi-span Euler-Bernoulli beam.


Separate the variables by setting u(x, t) = X(x)*T(t).   We get
-
"(rho*A)/(E*I)*(T ' ')/(T)=(X^((4)))/(X)=mu^(4)  "
whence
"T ' ' +(E*I)/(rho*A)*mu^(4)*T =0,           X^((4))-mu^(4)*X=0".

Let omega = sqrt(I*E/(rho*A))*mu^2.  Then

T(t) = C__1*cos(omega*t)+C__2*sin(omega*t)

 and
"X(x)=`c__1`*cosh(mu*x)+`c__2`*sinh(mu*x)+`c__3`*sin(mu*x)+`c__4`*cos(mu*x)."

 

The idea behind the Krylov-Duncan technique is to express X(x) 

in terms an alternative (and equivalent) set of basis
functions K__1 through K__4,, as
X(x) = a__1*K__1(mu*x)+a__2*K__2(mu*x)+a__3*K__3(mu*x)+a__4*K__4(mu*x),

where the functions K__1 through K__4 are defined in the next section.

In some literature the symbols S, T, U, V, are used for these

functions but I find it more sensible to use the indexed function

notation.

The Krylov-Duncan approach is particularly effective in formulating
and finding a multi-span beam's natural modes of vibration.

 

 

The Krylov-Duncan functions

 

The K[i](x) defined by this proc evaluates to the ith

Krylov-Duncan function.

 

Normally the index i will be in the set{1, 2, 3, 4}, however the proc is

set up to accept any integer index (positive or negative).  The proc evaluates

the index modulo 4 to bring the index into the set {1, 2, 3, 4}.   For

instance, K[5](x) and K[-3](x)i are equivalent to K[1](x) .

K := proc(x)
        local n := op(procname);

        if not type(n, integer) then
                return 'procname'(args);
        else
                n := 1 + modp(n-1,4);  # reduce n modulo 4
        end if;

        if n=1 then
                (cosh(x) + cos(x))/2;
        elif n=2 then
                (sinh(x) + sin(x))/2;
        elif n=3 then
                 (cosh(x) - cos(x))/2;
        elif n=4 then
                (sinh(x) - sin(x))/2;
        else
                error "shouldn't be here!";
        end if;

end proc:

Here are the Krylov-Duncan basis functions:

seq(print(cat(`K__`,i)(x) = K[i](x)), i=1..4);

K__1(x) = (1/2)*cosh(x)+(1/2)*cos(x)

K__2(x) = (1/2)*sinh(x)+(1/2)*sin(x)

K__3(x) = (1/2)*cosh(x)-(1/2)*cos(x)

K__4(x) = (1/2)*sinh(x)-(1/2)*sin(x)

and here is what they look like.  All grow exponentially for large x
but are significantly different near the origin.

plot([K[i](x) $i=1..4], x=-Pi..Pi,
        color=["red","Green","blue","cyan"],
        thickness=2,
        legend=['K[1](x)', 'K[2](x)', 'K[3](x)', 'K[4](x)']);

The cyclic property of the derivatives: 
We have diff(K__i(x), x) = `K__i-1`.  Let's verify that:

diff(K[i](x),x) - K[i-1](x) $i=1..4;

0, 0, 0, 0

The fourth derivative of each K__i  function equals itself. This is a consequence of the cyclic property:

diff(K[i](x), x$4) - K[i](x) $ i=1..4;

0, 0, 0, 0

The essential property of the Krylov-Duncan basis function is that their

zeroth through third derivatives at x = 0 form a basis for R^4:

seq((D@@n)(K[1])(0), n=0..3);
seq((D@@n)(K[2])(0), n=0..3);
seq((D@@n)(K[3])(0), n=0..3);
seq((D@@n)(K[4])(0), n=0..3);

1, 0, 0, 0

0, 1, 0, 0

0, 0, 1, 0

0, 0, 0, 1

As noted earlier, in the case of a single-span beam, the modal  shapes

are expressed as
X(x) = a__1*K__1(mu*x)+a__2*K__2(mu*x)+a__3*K__3(mu*x)+a__4*K__4(mu*x).

Then, due to the cyclic property of the derivatives of the Krylov-Duncan

functions, we see that:
"X '(x) = mu*(`a__1`*`K__4`(mu*x)+`a__2`*`K__1`(mu*x)+`a__3`*`K__2`(mu*x)+`a__4`*`K__3`(mu*x))".
X*('`&InvisibleTimes;`')(x) = mu^2*(a__1*K__3(mu*x)+a__2*K__4(mu*x)+a__3*K__1(mu*x)+a__4*K__2(mu*x)).
"X ' ' '(x) = mu^(3)*(`a__1`*`K__2`(mu*x)+`a__2`*`K__3`(mu*x)+`a__3`*`K__4`(mu*x)+`a__4`*`K__1`(mu*x))".
Let us note, in particular, that
X(0) = a__1,
"X '(0)=mu*`a__2`",
X*('`&InvisibleTimes;`')(0) = mu^2*a__3,
"X ' ' '(0)=mu^(3)*`a__4`".

 

A general approach for solving multi-span beams

 

In a multi-span beam, we write X__i(x) for the deflection of the ith span, where

0 < x and x < L__i and where L__i is the span's length.  The x coordinate indicates the

location within the span, with x = 0 corresponding to the span's left endpoint.

Thus, each span has its own x coordinate system.

 
We assume that the interface of the two adjoining spans is supported on springs

which (a) resist transverse displacement proportional to the displacement (constant of

proportionality of k__d  (d for displacement), and (b) resist rotation proportional to the
slope (constant of proportionality of k__t  (t for torsion or twist). The spans are numbered

from left to right. The interface conditions between spans i and i+1 are

 

1. 

The displacements at the interface match:
X__i(L__i) = `X__i+1`(0).

2. 

The slopes at the interface match
X*`'i`(L__i) = X*`'i+1`(0).

3. 

The difference of the moments just to the left and just to the right of the
support is due to the torque exerted by the torsional spring:
"E*I*(X ' `'i+1`(0)-X ' `'i `(`L__i`))=-`k__t` * X `'i+1`(0),"

4. 

The difference of the shear forces just to the left and just to the right of the
support is due to the force exerted by the linear spring:

"E*I*(X ' ' `'i+1`(0)-X ' ' '(`L__i`))= -`k__d` * `X__i+1`(0).  "

The special case of a pinned support corresponds to k__t = 0 and k__d = infinity.
In that case, condition 3 above implies that X*'`'i+1`(0) = X'*`'i`(L__i),
and condition 4 implies that `X__i+1`(0) = 0.


Let us write the displacements X__i and `X__i+1` in terms of the Krylov-Duncan

functions as:

 

"`X__i`(x)=`a__i,1`*`K__1`(mu*x)+`a__i,2`*`K__2`(mu*x)+`a__i,3`*`K__3`(mu*x)+`a__i,4`*`K__4`(mu*x),  "
"`X__i+1`(x)=`a__i+1,1`*`K__1`(mu*x)+`a__I+1,2`*`K__2`(mu*x)+`a__i+1,3`*`K__3`(mu*x)+`a__i+1,4`*`K__4`(mu*x)."


Then applying the cyclic properties of the Krylov-Duncan functions described

earlier, the four interface conditions translate to the following system of four
equations involving the eight coefficients `a__i,1`, `a__i,2`, () .. (), `a__i+13`, `a__i+1,4`.

"`a__i,1`*`K__1`(mu*`L__i`)+ `a__i,2`*`K__2`(mu*`L__i`)+`a__i,3`*`K__3`(mu*`L__i`)+`a__i,4`*`K__4`(mu*`L__i`)=`a__i+1,1`,"
mu*(`a__i,1`*K__4(mu*L__i)+`a__i,2`*K__1(mu*L__i)+`a__i,3`*K__2(mu*L__i)+`a__i,4`*K__3(mu*L__i)) = mu*`a__i+1,2`,
mu^2*(`a__i,1`*K__3(mu*L__i)+`a__i,2`*K__4(mu*L__i)+`a__i,3`*K__1(mu*L__i)+`a__i,4`*K__2(mu*L__i)-`a__i+1,3`) = -k__t*mu*`a__i+1,2`/(I*E)
mu^3*(`a__i,1`*K__2(mu*L__i)+`a__i,2`*K__3(mu*L__i)+`a__i,3`*K__4(mu*L__i)+`a__i,4`*K__1(mu*L__i)-`a__i+1,4`) = -k__d*`a__i+1,1`/(I*E)

which we write as a matrix equation
(Matrix(4, 8, {(1, 1) = K__1(mu*L__i), (1, 2) = K__2(mu*L__i), (1, 3) = K__3(mu*L__i), (1, 4) = K__4(mu*L__i), (1, 5) = -1, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = K__4(mu*L__i), (2, 2) = K__1(mu*L__i), (2, 3) = K__2(mu*L__i), (2, 4) = K__3(mu*L__i), (2, 5) = 0, (2, 6) = -1, (2, 7) = 0, (2, 8) = 0, (3, 1) = K__3(mu*L__i), (3, 2) = K__4(mu*L__i), (3, 3) = K__1(mu*L__i), (3, 4) = K__2(mu*L__i), (3, 5) = 0, (3, 6) = -I*k__t/(mu*E), (3, 7) = -1, (3, 8) = 0, (4, 1) = K__2(mu*L__i), (4, 2) = K__3(mu*L__i), (4, 3) = K__4(mu*L__i), (4, 4) = K__1(mu*L__i), (4, 5) = -I*k__d/(mu^3*E), (4, 6) = 0, (4, 7) = 0, (4, 8) = -1}))*(Vector(8, {(1) = `a__i,1`, (2) = `a__i,2`, (3) = `a__i,3`, (4) = `a__i,4`, (5) = `a__i+1,1`, (6) = `a__i+1,2`, (7) = `a__i+1,3`, (8) = `a__i+1,4`})) = (Vector(8, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 0, (8) = 0})).

That 4*8 coefficient matrix plays a central role in solving

for modal shapes of multi-span beams.  Let's call it M__interface.

Note that the value of I*E enters that matrix only in combinations with
k__d and k__t.  Therefore we introduce the new symbols

K__d = k__d/(I*E),    K__t = k__t/(I*E).

 

The following proc generates the matrix `#msub(mi("M"),mi("interface"))`.  The parameters K__d and K__t 

are optional and are assigned the default values of infinity and zero, which

corresponds to a pinned support.

 

The % sign in front of each Krylov function makes the function inert, that is, it
prevents it from expanding into trig functions.  This is so that we can

see, visually, what our expressions look like in terms of the K functions.  To

force the evaluation of those inert function, we will apply Maple's value function,

as seen in the subsequent demos.

M_interface := proc(mu, L, {Kd:=infinity, Kt:=0})
        local row1, row2, row3, row4;
        row1 := %K[1](mu*L), %K[2](mu*L), %K[3](mu*L), %K[4](mu*L), -1,  0, 0, 0;
        row2 := %K[4](mu*L), %K[1](mu*L), %K[2](mu*L), %K[3](mu*L),  0, -1, 0, 0;
        row3 := %K[3](mu*L), %K[4](mu*L), %K[1](mu*L), %K[2](mu*L),  0, Kt/mu, -1, 0;
        if Kd = infinity then
                row4 := 0, 0, 0, 0, 1, 0, 0, 0 ;
        else
                row4 := %K[2](mu*L), %K[3](mu*L), %K[4](mu*L), %K[1](mu*L), Kd/mu^3, 0, 0, -1;
        end if:
                return < <row1> | <row2> | <row3> | <row4> >^+;
end proc:

Here is the interface matrix for a pinned support:

M_interface(mu, L);

Matrix(4, 8, {(1, 1) = %K[1](L*mu), (1, 2) = %K[2](L*mu), (1, 3) = %K[3](L*mu), (1, 4) = %K[4](L*mu), (1, 5) = -1, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = %K[4](L*mu), (2, 2) = %K[1](L*mu), (2, 3) = %K[2](L*mu), (2, 4) = %K[3](L*mu), (2, 5) = 0, (2, 6) = -1, (2, 7) = 0, (2, 8) = 0, (3, 1) = %K[3](L*mu), (3, 2) = %K[4](L*mu), (3, 3) = %K[1](L*mu), (3, 4) = %K[2](L*mu), (3, 5) = 0, (3, 6) = 0, (3, 7) = -1, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 1, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0})

And here is the interface matrix for a general springy support:

M_interface(mu, L, 'Kd'=a, 'Kt'=b);

Matrix(4, 8, {(1, 1) = %K[1](L*mu), (1, 2) = %K[2](L*mu), (1, 3) = %K[3](L*mu), (1, 4) = %K[4](L*mu), (1, 5) = -1, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = %K[4](L*mu), (2, 2) = %K[1](L*mu), (2, 3) = %K[2](L*mu), (2, 4) = %K[3](L*mu), (2, 5) = 0, (2, 6) = -1, (2, 7) = 0, (2, 8) = 0, (3, 1) = %K[3](L*mu), (3, 2) = %K[4](L*mu), (3, 3) = %K[1](L*mu), (3, 4) = %K[2](L*mu), (3, 5) = 0, (3, 6) = b/mu, (3, 7) = -1, (3, 8) = 0, (4, 1) = %K[2](L*mu), (4, 2) = %K[3](L*mu), (4, 3) = %K[4](L*mu), (4, 4) = %K[1](L*mu), (4, 5) = a/mu^3, (4, 6) = 0, (4, 7) = 0, (4, 8) = -1})

Note:  In Maple's Java interface, inert quantities are shown in gray.


Note:  The L in this matrix is the length of the span to the left of the interface.
Recall that it is L__i , not `L__i+1`, in the derivation that leads to that matrix.

In a beam consisting of N spans, we write the ith span's deflection X__i(x) as
"`X__i`(x)=`a__i 1`*`K__1`(mu*x)+`a__i 2`*`K__2`(mu*x)+`a__i 3`*`K__3`(mu*x)+`a__i 4`*`K__4`(mu*x)."

Solving the beam amounts to determining the 4*N unknowns `a__i j`, i = 1 .. N, j = 1 .. 4.

which we order as

 

`a__1,1`, `a__1,2`, `a__1,3`, `a__1,4`, `a__2,1`, `a__2,2`, () .. (), `a__N,1`, `a__N,2`, `a__N,3`, `a__N,4`

At each of the N-1 interface supports we have a set of four equations as derived
above, for a total of 4*(N-1) equations.  Additionally, we have four user-supplied

boundary conditions -- two at the extreme left and two at the extreme right of the

overall beam.  Thus, altogether we have 4*N equations which then we solve for the
4*N
 unknown coefficients a__ij.   

The user-supplied boundary conditions at the left end are two equations, each in the
form of a linear combination of the coefficients a__11, a__12, a__13, a__14.  We write M__left for the
2*4 coefficient matrix of that set of equations.  Similarly, the user-supplied boundary
conditions at the right end are two equations, each in the form of a linear combination
of the coefficients a__N1, a__N2, a__N3, a__N4.  We write M__right for the 2*4 coefficient matrix of
that set of equations.   Putting these equations together with those obtained at the interfaces,

we get a linear set of equations represented by a (4*N*4)*N matrix Mwhich can be assembled

easily from the matrices M__left, M__right, and M__interface.  In the case of a 4-span beam the

assembled 16*16matrix Mlooks like this:

The pattern generalizes to any number of spans in the obvious way.

For future use, here we record a few frequently occurring M__left and M__right matrices.

M_left_pinned := <
        1, 0, 0, 0;
        0, 0, 1, 0 >;

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

M_right_pinned := (mu,L) -> <
        %K[1](mu*L), %K[2](mu*L), %K[3](mu*L), %K[4](mu*L);
        %K[3](mu*L), %K[4](mu*L), %K[1](mu*L), %K[2](mu*L) >;  

proc (mu, L) options operator, arrow; `<,>`(`<|>`(%K[1](L*mu), %K[2](L*mu), %K[3](L*mu), %K[4](L*mu)), `<|>`(%K[3](L*mu), %K[4](L*mu), %K[1](L*mu), %K[2](L*mu))) end proc

M_left_clamped := <
        1, 0, 0, 0;
                0, 1, 0, 0 >;

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

M_right_clamped := (mu,L) -> <
        %K[1](mu*L), %K[2](mu*L), %K[3](mu*L), %K[4](mu*L);
        %K[4](mu*L), %K[1](mu*L), %K[2](mu*L), %K[3](mu*L) >;

proc (mu, L) options operator, arrow; `<,>`(`<|>`(%K[1](L*mu), %K[2](L*mu), %K[3](L*mu), %K[4](L*mu)), `<|>`(%K[4](L*mu), %K[1](L*mu), %K[2](L*mu), %K[3](L*mu))) end proc

M_left_free := <
        0, 0, 1, 0;
                0, 0, 0, 1 >;

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

M_right_free := (mu,L) -> <
        %K[3](mu*L), %K[4](mu*L), %K[1](mu*L), %K[2](mu*L);
        %K[2](mu*L), %K[3](mu*L), %K[4](mu*L), %K[1](mu*L) >;

proc (mu, L) options operator, arrow; `<,>`(`<|>`(%K[3](L*mu), %K[4](L*mu), %K[1](L*mu), %K[2](L*mu)), `<|>`(%K[2](L*mu), %K[3](L*mu), %K[4](L*mu), %K[1](L*mu))) end proc

The following proc builds the overall matrixM in the general case.  It takes
two or three arguments.  The first two arguments are the 2*4 matrices
which are called M__left and M__right in the discussion above.  If the beam
consists of a single span, that's all the information that need be supplied.
There is no need for the third argument.

 

In the case of a multi-span beam, in the third argument we supply the
list of the interface matrices M__interface , as in [M__1, M__2, () .. ()], listed in order
of the supports,  from left to right.   An empty list is also
acceptable and is interpreted as having no internal supports,
i.e., a single-span beam.

build_matrix := proc(left_bc::Matrix(2,4), right_bc::Matrix(2,4), interface_matrices::list)
        local N, n, i, M;

        # n is the number of internal supports
        n := 0;

        # adjust n if a third argument is supplied
        if _npassed = 3 then
                n := nops(interface_matrices);
                if n > 0 then
                        for i from 1 to n do
                                if not type(interface_matrices[i], 'Matrix(4,8)') then
                                        error "expected a 4x8 matrix for element %1 in the list of interface matrices", i;
                                end if;
                        end do;
                end if;
        end if;

        N := n + 1;                     # number of spans

        M := Matrix(4*N);
        M[1..2, 1..4] := left_bc;
        for i from 1 to n do
                M[4*i-1..4*i+2, 4*i-3..4*i+4] := interface_matrices[i];
        end do;
        M[4*N-1..4*N, 4*N-3..4*N] := right_bc;
                
        return M;
end proc:

For instance, for a single-span cantilever beam of length L we get the following M matrix:

build_matrix(M_left_clamped, M_right_free(mu,L));

Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (3, 1) = %K[3](L*mu), (3, 2) = %K[4](L*mu), (3, 3) = %K[1](L*mu), (3, 4) = %K[2](L*mu), (4, 1) = %K[2](L*mu), (4, 2) = %K[3](L*mu), (4, 3) = %K[4](L*mu), (4, 4) = %K[1](L*mu)})

For a two-span beam with with span lengths of L__1 and L__2, and all three
supports pinned,  we get the following M matrix:

build_matrix(M_left_pinned, M_right_pinned(mu,L[2]), [M_interface(mu, L[1])]);

Matrix(%id = 18446884696906262398)

The matrix M represents a homogeneous linear system (i.e., the right-hand side vector

is zero.)  To obtain a nonzero solution, we set the determinant of M equal to zero.

That gives us a generally transcendental equation in the single unknown mu.  Normally

the equation has infinitely many solutions.  We call these `&mu;__n `, n = 1, 2, () .. () 

Remark: In the special case of pinned supports at the interfaces, that is, when
Kd = infinity, Kt = 0, the matrix M depends only on the span lengths "`L__1`, `L__2`. ..., `L__N`".
It is independent of the parameters rho, A, E, I that enter the Euler-Bernoulli
equations.  The frequencies `&omega;__n` = sqrt(I*E/(rho*A))*`&mu;__n`^2, however, depend on those parameters.

This proc plots the calculated modal shape corresponding to the eigenvalue mu.
The params argument is a set of equations which define the  numerical values

of all the parameters that enter the problem's description, such as the span

lengths.

 

It is assumed that in a multi-span beam, the span lengths are named "L[1], L[2]," etc.,
and in a single-span beam, the length is named L.

plot_beam := proc(M::Matrix,mu::realcons, params::set)
        local null_space, N, a_vals, i, j, A, B, P;
        eval(M, params);
        eval(%, :-mu=mu);
        value(%);  #print(%);
        null_space := NullSpace(%);  #print(%);
        if nops(null_space) <> 1 then
                error "Calculation failed. Increasing Digits and try again";
        end if;

        N := Dimension(M)[1]/4;  # number of spans
        a_vals := convert([seq(seq(a[i,j], j=1..4), i=1..N)] =~ null_space[1], list);

        if N = 1 then
                eval(add(a[1,j]*K[j](mu*x), j=1..4), a_vals);
                P[1] := plot(%, x=0..eval(L,params));
        else
                A := 0;
                B := 0;
                for i from 1 to N do
                        B := A + eval(L[i], params);
                        eval(add(a[i,j]*K[j](mu*x), j=1..4), a_vals);
                        eval(%, x=x-A):
                        P[i] := plot(%, x=A..B);
                        A := B;
                end do;
                unassign('i');
        end if;
        plots:-display([P[i] $i=1..N]);

end proc:

 

A single-span pinned-pinned beam

 

Here we calculate the natural modes of vibration of a single span

beam, pinned at both ends.  The modes are of the form
"X(x) = `a__11``K__1`(mu*x) + `a__12`*`K__2`(mu*x)+`a__13``K__3`(mu*x) + `a__14`*`K__4`(mu*x)."

The matrix M is:

M := build_matrix(M_left_pinned, M_right_pinned(mu,L));

Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (2, 4) = 0, (3, 1) = %K[1](L*mu), (3, 2) = %K[2](L*mu), (3, 3) = %K[3](L*mu), (3, 4) = %K[4](L*mu), (4, 1) = %K[3](L*mu), (4, 2) = %K[4](L*mu), (4, 3) = %K[1](L*mu), (4, 4) = %K[2](L*mu)})

The characteristic equation:

Determinant(M);
eq := simplify(value(%)) = 0;

-%K[2](L*mu)^2+%K[4](L*mu)^2

-sinh(L*mu)*sin(L*mu) = 0

solve(eq, mu, allsolutions);

Pi*_Z1/L, I*Pi*_Z2/L

We conclude that the eigenvalues are `&mu;__n` = n*Pi/L, n = 1, 2, 3, () .. ().

 

A non-trivial solution of the system M*A = 0 is in the null-space of M:

eval(value(M), mu=n*Pi/L) assuming n::integer;
N := NullSpace(%);

Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (2, 4) = 0, (3, 1) = (1/2)*cosh(n*Pi)+(1/2)*(-1)^n, (3, 2) = (1/2)*sinh(n*Pi), (3, 3) = (1/2)*cosh(n*Pi)-(1/2)*(-1)^n, (3, 4) = (1/2)*sinh(n*Pi), (4, 1) = (1/2)*cosh(n*Pi)-(1/2)*(-1)^n, (4, 2) = (1/2)*sinh(n*Pi), (4, 3) = (1/2)*cosh(n*Pi)+(1/2)*(-1)^n, (4, 4) = (1/2)*sinh(n*Pi)})

{Vector[column](%id = 18446884696899531350)}

Here are the weights that go with the Krylov functions:

a_vals := convert([a[1,j] $j=1..4] =~ N[1], set);

{a[1, 1] = 0, a[1, 2] = -1, a[1, 3] = 0, a[1, 4] = 1}

and here is the deflection:

add(a[1,j]*K[j](mu*x), j=1..4);
eval(%, a_vals);       # plug in the a_vals calculated above
eval(%, mu=n*Pi/L);    # assert that n is an integer

a[1, 1]*((1/2)*cosh(mu*x)+(1/2)*cos(mu*x))+a[1, 2]*((1/2)*sinh(mu*x)+(1/2)*sin(mu*x))+a[1, 3]*((1/2)*cosh(mu*x)-(1/2)*cos(mu*x))+a[1, 4]*((1/2)*sinh(mu*x)-(1/2)*sin(mu*x))

-sin(mu*x)

-sin(n*Pi*x/L)

We see that the shape functions are simple sinusoids.

 

 

A single-span free-free beam

 

Here we calculate the natural modes of vibration of a single span

beam, free at both ends.  The modes are of the form
X(x) = a__11*K__1(mu*x)+a__12*K__2(mu*x)+a__13*K__3(mu*x)+a__14*K__4(mu*x).

The reasoning behind the calculations is very similar to that in the

previous section, therefore we don't comment on many details.

M := build_matrix(M_left_free, M_right_free(mu,L));

Matrix(4, 4, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 1, (1, 4) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 1, (3, 1) = %K[3](L*mu), (3, 2) = %K[4](L*mu), (3, 3) = %K[1](L*mu), (3, 4) = %K[2](L*mu), (4, 1) = %K[2](L*mu), (4, 2) = %K[3](L*mu), (4, 3) = %K[4](L*mu), (4, 4) = %K[1](L*mu)})

The characteristic equation:

Determinant(M);
simplify(value(%)) = 0;
eq_tmp := isolate(%, cos(L*mu));

%K[3](L*mu)^2-%K[2](L*mu)*%K[4](L*mu)

1/2-(1/2)*cosh(L*mu)*cos(L*mu) = 0

cos(L*mu) = 1/cosh(L*mu)

Let lambda = L*mu.  Then the characteristic equation takes the form

eq := algsubs(L*mu=lambda, eq_tmp);

cos(lambda) = 1/cosh(lambda)

Here are the graphs of the two sides of the characteristic equation:

plot([lhs,rhs](eq), lambda=0..4*Pi, color=["red","Green"]);

The first three roots are:

lambda__1, lambda__2, lambda__3 :=
        fsolve(eq, lambda=Pi/2..4*Pi, maxsols=3);

4.730040744, 7.853204624, 10.99560783

params := { L=1 };

{L = 1}

mu__1, mu__2, mu__3 := (lambda__1, lambda__2, lambda__3) /~ eval(L, params);

4.730040744, 7.853204624, 10.99560783

plots:-display([
        plot_beam(M, mu__1, params),
        plot_beam(M, mu__2, params),
        plot_beam(M, mu__3, params)],
        color=["red","Green","blue"],
        legend=[mode1, mode2, mode3]);

 

 

A single-span clamped-free cantilever

 

We have a cantilever beam of length L.  It is clamped at the

left end, and free at the right end.

M := build_matrix(M_left_clamped, M_right_free(mu,L));

Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (3, 1) = %K[3](L*mu), (3, 2) = %K[4](L*mu), (3, 3) = %K[1](L*mu), (3, 4) = %K[2](L*mu), (4, 1) = %K[2](L*mu), (4, 2) = %K[3](L*mu), (4, 3) = %K[4](L*mu), (4, 4) = %K[1](L*mu)})

Determinant(M);
simplify(value(%)) = 0;
eq_tmp := isolate(%, cos(L*mu));

%K[1](L*mu)^2-%K[2](L*mu)*%K[4](L*mu)

1/2+(1/2)*cosh(L*mu)*cos(L*mu) = 0

cos(L*mu) = -1/cosh(L*mu)

Let lambda = L*mu.  Then the characteristic equation takes the form

eq := algsubs(L*mu=lambda, eq_tmp);

cos(lambda) = -1/cosh(lambda)

Here are the graphs of the two sides of the characteristic equation:

plot([lhs,rhs](eq), lambda=0..3*Pi, color=["red","Green"]);

lambda__1, lambda__2, lambda__3 :=
        fsolve(eq, lambda=Pi/2..3*Pi, maxsols=3);

1.875104068, 4.694091132, 7.854757438

params := { L=1 };

{L = 1}

mu__1, mu__2, mu__3 := (lambda__1, lambda__2, lambda__3) /~ eval(L, params);

1.875104068, 4.694091132, 7.854757438

plots:-display([
        plot_beam(M, mu__1, params),
        plot_beam(M, mu__2, params),
        plot_beam(M, mu__3, params)],
        color=["red","Green","blue"],
        legend=[mode1, mode2, mode3]);

 

 

A dual-span pinned-pinned-free cantilever beam

 

We have a two-span beam of span lengths L__1 and L__2, with the left end of the
first span pinned, the right end of the second span free, and the interface

between the spans on a pinned support.  .

M := build_matrix(
        M_left_pinned,
        M_right_free(mu,L[2]),
                [ M_interface(mu,L[1])] );

Matrix(8, 8, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = %K[1](L[1]*mu), (3, 2) = %K[2](L[1]*mu), (3, 3) = %K[3](L[1]*mu), (3, 4) = %K[4](L[1]*mu), (3, 5) = -1, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (4, 1) = %K[4](L[1]*mu), (4, 2) = %K[1](L[1]*mu), (4, 3) = %K[2](L[1]*mu), (4, 4) = %K[3](L[1]*mu), (4, 5) = 0, (4, 6) = -1, (4, 7) = 0, (4, 8) = 0, (5, 1) = %K[3](L[1]*mu), (5, 2) = %K[4](L[1]*mu), (5, 3) = %K[1](L[1]*mu), (5, 4) = %K[2](L[1]*mu), (5, 5) = 0, (5, 6) = 0, (5, 7) = -1, (5, 8) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 1, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = %K[3](L[2]*mu), (7, 6) = %K[4](L[2]*mu), (7, 7) = %K[1](L[2]*mu), (7, 8) = %K[2](L[2]*mu), (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = %K[2](L[2]*mu), (8, 6) = %K[3](L[2]*mu), (8, 7) = %K[4](L[2]*mu), (8, 8) = %K[1](L[2]*mu)})

The characteristic equation:

Determinant(M);
eq_tmp1 := simplify(value(%)) = 0;

%K[4](L[1]*mu)^2*%K[4](L[2]*mu)*%K[2](L[2]*mu)-%K[4](L[1]*mu)^2*%K[1](L[2]*mu)^2-%K[4](L[1]*mu)*%K[1](L[1]*mu)*%K[4](L[2]*mu)*%K[1](L[2]*mu)+%K[4](L[1]*mu)*%K[1](L[1]*mu)*%K[3](L[2]*mu)*%K[2](L[2]*mu)+%K[4](L[2]*mu)*%K[1](L[2]*mu)*%K[3](L[1]*mu)*%K[2](L[1]*mu)-%K[4](L[2]*mu)*%K[2](L[2]*mu)*%K[2](L[1]*mu)^2+%K[1](L[2]*mu)^2*%K[2](L[1]*mu)^2-%K[3](L[2]*mu)*%K[2](L[2]*mu)*%K[3](L[1]*mu)*%K[2](L[1]*mu)

(1/4)*(-cos(L[1]*mu)*sinh(L[2]*mu)*cos(L[2]*mu)+cos(L[1]*mu)*sin(L[2]*mu)*cosh(L[2]*mu)+2*sin(L[1]*mu)*cosh(L[2]*mu)*cos(L[2]*mu)+2*sin(L[1]*mu))*sinh(L[1]*mu)+(1/4)*sin(L[1]*mu)*cosh(L[1]*mu)*(sinh(L[2]*mu)*cos(L[2]*mu)-sin(L[2]*mu)*cosh(L[2]*mu)) = 0

That equation does not seem to be amenable to simplification.  The special case of L__1 = L__2, however,

is much nicer:

eval(eq_tmp1, {L[1]=L, L[2]=L}):
eq_tmp2 := simplify(%*4);

(4*cosh(L*mu)*cos(L*mu)+2)*sinh(L*mu)*sin(L*mu)+cos(L*mu)^2-cosh(L*mu)^2 = 0

Let L*mu = lambda:

eq_tmp3 := algsubs(L*mu=lambda, eq_tmp2);

(4*cosh(lambda)*cos(lambda)+2)*sinh(lambda)*sin(lambda)+cos(lambda)^2-cosh(lambda)^2 = 0

That expression grows like cosh(lambda)^2, so we divide through by that to obtain

a better-behaved equation

eq := eq_tmp3/cosh(lambda)^2;

((4*cosh(lambda)*cos(lambda)+2)*sinh(lambda)*sin(lambda)+cos(lambda)^2-cosh(lambda)^2)/cosh(lambda)^2 = 0

plot(lhs(eq), lambda=0..2*Pi);

Here are the first three roots:

lambda__1, lambda__2, lambda__3 :=
         fsolve(eq, lambda=1e-3..2*Pi, maxsols=3);

1.505915458, 3.413100675, 4.437274304

params := { L[1]=1, L[2]=1 };

{L[1] = 1, L[2] = 1}

mu__1, mu__2, mu__3 := (lambda__1, lambda__2, lambda__3) /~ eval(L[1], params);

1.505915458, 3.413100675, 4.437274304

plots:-display([
        plot_beam(M, mu__1, params),
        plot_beam(M, mu__2, params),
        plot_beam(M, mu__3, params)],
        color=["red","Green","blue"],
        legend=[mode1, mode2, mode3]);

 

 

A dual-span clamped-pinned-free cantilever beam

 

We have a two-span beam of span lengths L__1 and L__2, with the left end of the
first span clamped, the right end of the second span free, and the interface

between the spans on a pinned support.  This is different from the previous

case only in the nature of the left boundary condition.

M := build_matrix(
        M_left_clamped,
        M_right_free(mu,L[2]),
        [ M_interface(mu,L[1])] );

Matrix(8, 8, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = %K[1](L[1]*mu), (3, 2) = %K[2](L[1]*mu), (3, 3) = %K[3](L[1]*mu), (3, 4) = %K[4](L[1]*mu), (3, 5) = -1, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (4, 1) = %K[4](L[1]*mu), (4, 2) = %K[1](L[1]*mu), (4, 3) = %K[2](L[1]*mu), (4, 4) = %K[3](L[1]*mu), (4, 5) = 0, (4, 6) = -1, (4, 7) = 0, (4, 8) = 0, (5, 1) = %K[3](L[1]*mu), (5, 2) = %K[4](L[1]*mu), (5, 3) = %K[1](L[1]*mu), (5, 4) = %K[2](L[1]*mu), (5, 5) = 0, (5, 6) = 0, (5, 7) = -1, (5, 8) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 1, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = %K[3](L[2]*mu), (7, 6) = %K[4](L[2]*mu), (7, 7) = %K[1](L[2]*mu), (7, 8) = %K[2](L[2]*mu), (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = %K[2](L[2]*mu), (8, 6) = %K[3](L[2]*mu), (8, 7) = %K[4](L[2]*mu), (8, 8) = %K[1](L[2]*mu)})

The characteristic equation:

Determinant(M);
eq_tmp1 := simplify(value(%)) = 0;

%K[2](L[1]*mu)*%K[4](L[1]*mu)*%K[4](L[2]*mu)*%K[1](L[2]*mu)-%K[2](L[1]*mu)*%K[4](L[1]*mu)*%K[3](L[2]*mu)*%K[2](L[2]*mu)+%K[2](L[1]*mu)*%K[3](L[1]*mu)*%K[4](L[2]*mu)*%K[2](L[2]*mu)-%K[2](L[1]*mu)*%K[3](L[1]*mu)*%K[1](L[2]*mu)^2-%K[1](L[1]*mu)*%K[4](L[1]*mu)*%K[4](L[2]*mu)*%K[2](L[2]*mu)+%K[1](L[1]*mu)*%K[4](L[1]*mu)*%K[1](L[2]*mu)^2-%K[3](L[1]*mu)^2*%K[4](L[2]*mu)*%K[1](L[2]*mu)+%K[3](L[1]*mu)^2*%K[3](L[2]*mu)*%K[2](L[2]*mu)

(1/4)*((-cos(L[1]*mu)*sin(L[2]*mu)-sin(L[1]*mu)*cos(L[2]*mu))*cosh(L[2]*mu)+cos(L[1]*mu)*sinh(L[2]*mu)*cos(L[2]*mu)-sin(L[1]*mu))*cosh(L[1]*mu)+(1/4)*(sinh(L[1]*mu)*cos(L[1]*mu)*cos(L[2]*mu)+sin(L[2]*mu))*cosh(L[2]*mu)+(1/4)*sinh(L[1]*mu)*cos(L[1]*mu)-(1/4)*sinh(L[2]*mu)*cos(L[2]*mu) = 0

That equation does not seem to be amenable to simplification.  The special case of L__1 = L__2, however,

is much nicer:

eval(eq_tmp1, {L[1]=L, L[2]=L}):
eq_tmp2 := simplify(%*4);

-2*cosh(L*mu)*cos(L*mu)*(sin(L*mu)*cosh(L*mu)-sinh(L*mu)*cos(L*mu)) = 0

Let L*mu = lambda:

eq_tmp3 := algsubs(L*mu=lambda, eq_tmp2);

-2*cosh(lambda)*cos(lambda)*(sin(lambda)*cosh(lambda)-sinh(lambda)*cos(lambda)) = 0

That expression grows like cosh(lambda)^2, so we divide through by that to obtain

a better-behaved equation

eq := eq_tmp3/cosh(lambda)^2;

-2*cos(lambda)*(sin(lambda)*cosh(lambda)-sinh(lambda)*cos(lambda))/cosh(lambda) = 0

plot(lhs(eq), lambda=0..2*Pi);

Here are the first three roots:

lambda__1, lambda__2, lambda__3 :=
         fsolve(eq, lambda=1e-3..2*Pi, maxsols=3);

1.570796326, 3.926602312, 4.712388980

params := { L[1]=1, L[2]=1 };

{L[1] = 1, L[2] = 1}

mu__1, mu__2, mu__3 := (lambda__1, lambda__2, lambda__3) /~ eval(L[1], params);

1.570796326, 3.926602312, 4.712388980

plots:-display([
        plot_beam(M, mu__1, params),
        plot_beam(M, mu__2, params),
        plot_beam(M, mu__3, params)],
        color=["red","Green","blue"],
        legend=[mode1, mode2, mode3]);

 

 

A triple-span free-pinned-pinned-free beam

 

We have a triple-span beam with span lengths of L__1, L__2, L__3.  The beam is supported

on two internal pinned supports.  The extreme ends of the beam are free.

The graphs of the first three modes agree with those

in Figure 3.22 on page 70 of the 2007 article of
Henrik Åkesson, Tatiana Smirnova, Thomas Lagö, and Lars Håkansson.

In the caption of Figure 2.12 on page 28 the span lengths are given
as "`L__1`="3.5, "`L__2`="5.0, "`L__3`="21.5.

interface(rtablesize=12):

M := build_matrix(
        M_left_free,
        M_right_free(mu,L[3]),
        [ M_interface(mu,L[1]), M_interface(mu,L[2])] );

Matrix(12, 12, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 1, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (1, 11) = 0, (1, 12) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 1, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 0, (2, 11) = 0, (2, 12) = 0, (3, 1) = %K[1](L[1]*mu), (3, 2) = %K[2](L[1]*mu), (3, 3) = %K[3](L[1]*mu), (3, 4) = %K[4](L[1]*mu), (3, 5) = -1, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (3, 9) = 0, (3, 10) = 0, (3, 11) = 0, (3, 12) = 0, (4, 1) = %K[4](L[1]*mu), (4, 2) = %K[1](L[1]*mu), (4, 3) = %K[2](L[1]*mu), (4, 4) = %K[3](L[1]*mu), (4, 5) = 0, (4, 6) = -1, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (4, 11) = 0, (4, 12) = 0, (5, 1) = %K[3](L[1]*mu), (5, 2) = %K[4](L[1]*mu), (5, 3) = %K[1](L[1]*mu), (5, 4) = %K[2](L[1]*mu), (5, 5) = 0, (5, 6) = 0, (5, 7) = -1, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (5, 11) = 0, (5, 12) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 1, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (6, 9) = 0, (6, 10) = 0, (6, 11) = 0, (6, 12) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = %K[1](L[2]*mu), (7, 6) = %K[2](L[2]*mu), (7, 7) = %K[3](L[2]*mu), (7, 8) = %K[4](L[2]*mu), (7, 9) = -1, (7, 10) = 0, (7, 11) = 0, (7, 12) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = %K[4](L[2]*mu), (8, 6) = %K[1](L[2]*mu), (8, 7) = %K[2](L[2]*mu), (8, 8) = %K[3](L[2]*mu), (8, 9) = 0, (8, 10) = -1, (8, 11) = 0, (8, 12) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = %K[3](L[2]*mu), (9, 6) = %K[4](L[2]*mu), (9, 7) = %K[1](L[2]*mu), (9, 8) = %K[2](L[2]*mu), (9, 9) = 0, (9, 10) = 0, (9, 11) = -1, (9, 12) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = 0, (10, 6) = 0, (10, 7) = 0, (10, 8) = 0, (10, 9) = 1, (10, 10) = 0, (10, 11) = 0, (10, 12) = 0, (11, 1) = 0, (11, 2) = 0, (11, 3) = 0, (11, 4) = 0, (11, 5) = 0, (11, 6) = 0, (11, 7) = 0, (11, 8) = 0, (11, 9) = %K[3](L[3]*mu), (11, 10) = %K[4](L[3]*mu), (11, 11) = %K[1](L[3]*mu), (11, 12) = %K[2](L[3]*mu), (12, 1) = 0, (12, 2) = 0, (12, 3) = 0, (12, 4) = 0, (12, 5) = 0, (12, 6) = 0, (12, 7) = 0, (12, 8) = 0, (12, 9) = %K[2](L[3]*mu), (12, 10) = %K[3](L[3]*mu), (12, 11) = %K[4](L[3]*mu), (12, 12) = %K[1](L[3]*mu)})

params := { L[1]=3.5, L[2]=5.0, L[3]=21.5 };

{L[1] = 3.5, L[2] = 5.0, L[3] = 21.5}

The characteristic equation

simplify(Determinant(M)):
value(%):
eq := simplify(eval(%, params));

(1/8)*(((2*sin(5.*mu)*sinh(5.*mu)*cos(3.5*mu)+sin(3.5*mu)*(cos(5.*mu)*sinh(5.*mu)-sin(5.*mu)*cosh(5.*mu)))*cosh(3.5*mu)-sinh(3.5*mu)*(cos(5.*mu)*sinh(5.*mu)-sin(5.*mu)*cosh(5.*mu))*cos(3.5*mu)+2*sinh(5.*mu)*sin(5.*mu))*cos(21.5*mu)+sin(21.5*mu)*(((cos(5.*mu)*sinh(5.*mu)-sin(5.*mu)*cosh(5.*mu))*cos(3.5*mu)-cos(5.*mu)*cosh(5.*mu)*sin(3.5*mu)+sin(3.5*mu))*cosh(3.5*mu)+sinh(3.5*mu)*(cos(5.*mu)*cosh(5.*mu)-1)*cos(3.5*mu)+cos(5.*mu)*sinh(5.*mu)-sin(5.*mu)*cosh(5.*mu)))*cosh(21.5*mu)-(1/8)*sinh(21.5*mu)*(((cos(5.*mu)*sinh(5.*mu)-sin(5.*mu)*cosh(5.*mu))*cos(3.5*mu)-cos(5.*mu)*cosh(5.*mu)*sin(3.5*mu)+sin(3.5*mu))*cosh(3.5*mu)+sinh(3.5*mu)*(cos(5.*mu)*cosh(5.*mu)-1)*cos(3.5*mu)+cos(5.*mu)*sinh(5.*mu)-sin(5.*mu)*cosh(5.*mu))*cos(21.5*mu)+(1/8)*(2*sin(5.*mu)*sinh(5.*mu)*cos(3.5*mu)+sin(3.5*mu)*(cos(5.*mu)*sinh(5.*mu)-sin(5.*mu)*cosh(5.*mu)))*cosh(3.5*mu)-(1/8)*sinh(3.5*mu)*(cos(5.*mu)*sinh(5.*mu)-sin(5.*mu)*cosh(5.*mu))*cos(3.5*mu)+(1/4)*sinh(5.*mu)*sin(5.*mu)

plot(eq, mu=0..0.4);

That graphs grows much too fast to be useful.  We moderate it by dividing through
the fastest growing cosh term:

plot(eq/cosh(21.5*mu), mu=0..0.4);

Here are the first three roots:

mu__1, mu__2, mu__3 := fsolve(eq, mu=1e-3..0.4, maxsols=3);

0.8148236435e-1, .2065743153, .3465175842

plots:-display([
        plot_beam(M, mu__1, params),
        plot_beam(M, mu__2, params),
        plot_beam(M, mu__3, params)],
        color=["red","Green","blue"],
        legend=[mode1, mode2, mode3]);

 

 

A triple-span free-spring-spring-free beam

 

We have a triple-span beam with span lengths of L__1, L__2, L__3.  The beam is supported

on two internal springy supports.  The extreme ends of the beam are free.
The numerical data is from the worksheet posted on July 29, 2020 at
https://www.mapleprimes.com/questions/230085-Elasticfoundation-Multispan-EulerBernoulli-Beamthreespan#comment271586

The problem is pretty much the same as the one in the previous section, but the

pinned supports have been replaced by spring supports.

This section's calculations require a little more precision than

Maple's default of 10 digits:

Digits := 15;

15

interface(rtablesize=12):

M := build_matrix(M_left_free, M_right_free(mu,L[3]),
                        [ M_interface(mu, L[1], 'Kd'=kd/(E*I), 'Kt'=kt/(E*I)),
                           M_interface(mu, L[2], 'Kd'=kd/(E*I), 'Kt'=kt/(E*I)) ]);

Matrix(12, 12, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 1, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (1, 11) = 0, (1, 12) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 1, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 0, (2, 11) = 0, (2, 12) = 0, (3, 1) = %K[1](L[1]*mu), (3, 2) = %K[2](L[1]*mu), (3, 3) = %K[3](L[1]*mu), (3, 4) = %K[4](L[1]*mu), (3, 5) = -1, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (3, 9) = 0, (3, 10) = 0, (3, 11) = 0, (3, 12) = 0, (4, 1) = %K[4](L[1]*mu), (4, 2) = %K[1](L[1]*mu), (4, 3) = %K[2](L[1]*mu), (4, 4) = %K[3](L[1]*mu), (4, 5) = 0, (4, 6) = -1, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (4, 11) = 0, (4, 12) = 0, (5, 1) = %K[3](L[1]*mu), (5, 2) = %K[4](L[1]*mu), (5, 3) = %K[1](L[1]*mu), (5, 4) = %K[2](L[1]*mu), (5, 5) = 0, (5, 6) = -I*kt/(E*mu), (5, 7) = -1, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (5, 11) = 0, (5, 12) = 0, (6, 1) = %K[2](L[1]*mu), (6, 2) = %K[3](L[1]*mu), (6, 3) = %K[4](L[1]*mu), (6, 4) = %K[1](L[1]*mu), (6, 5) = -I*kd/(E*mu^3), (6, 6) = 0, (6, 7) = 0, (6, 8) = -1, (6, 9) = 0, (6, 10) = 0, (6, 11) = 0, (6, 12) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = %K[1](L[2]*mu), (7, 6) = %K[2](L[2]*mu), (7, 7) = %K[3](L[2]*mu), (7, 8) = %K[4](L[2]*mu), (7, 9) = -1, (7, 10) = 0, (7, 11) = 0, (7, 12) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = %K[4](L[2]*mu), (8, 6) = %K[1](L[2]*mu), (8, 7) = %K[2](L[2]*mu), (8, 8) = %K[3](L[2]*mu), (8, 9) = 0, (8, 10) = -1, (8, 11) = 0, (8, 12) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = %K[3](L[2]*mu), (9, 6) = %K[4](L[2]*mu), (9, 7) = %K[1](L[2]*mu), (9, 8) = %K[2](L[2]*mu), (9, 9) = 0, (9, 10) = -I*kt/(E*mu), (9, 11) = -1, (9, 12) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = %K[2](L[2]*mu), (10, 6) = %K[3](L[2]*mu), (10, 7) = %K[4](L[2]*mu), (10, 8) = %K[1](L[2]*mu), (10, 9) = -I*kd/(E*mu^3), (10, 10) = 0, (10, 11) = 0, (10, 12) = -1, (11, 1) = 0, (11, 2) = 0, (11, 3) = 0, (11, 4) = 0, (11, 5) = 0, (11, 6) = 0, (11, 7) = 0, (11, 8) = 0, (11, 9) = %K[3](L[3]*mu), (11, 10) = %K[4](L[3]*mu), (11, 11) = %K[1](L[3]*mu), (11, 12) = %K[2](L[3]*mu), (12, 1) = 0, (12, 2) = 0, (12, 3) = 0, (12, 4) = 0, (12, 5) = 0, (12, 6) = 0, (12, 7) = 0, (12, 8) = 0, (12, 9) = %K[2](L[3]*mu), (12, 10) = %K[3](L[3]*mu), (12, 11) = %K[4](L[3]*mu), (12, 12) = %K[1](L[3]*mu)})

Calculate the determinant of M.  The result is quite large, so we terminate the command
with a colon so that not to have to look at the result.  If we bothered to peek,  however, we
will see that the determinant has a factor of 1/mu^8.  But that quite obvious by looking at the
entries of the matrix shown above. Two of its rows have 1/mu in them and another two have
1/mu^3. When multiplied, they produce the overall factor of 1/mu^8.

DET := Determinant(M):

Here are the parameters that the determinant depends on:

indets(DET, name);   # the parameters that make up M

{E, I, kd, kt, mu, L[1], L[2], L[3]}

So we provide values for those parameters:

params := {
        L[1]=3.5, L[2]=5.0, L[3]=21.5,
    kd=4.881e9, kt=1.422e4,
    E = 2.05e11, I = 1.1385e-7 };

{E = 0.205e12, I = 0.11385e-6, kd = 0.4881e10, kt = 0.1422e5, L[1] = 3.5, L[2] = 5.0, L[3] = 21.5}

Here is the characteristic equation.  We multiply it by mu^8 to remove the singularity at mu = 0.

mu^8 * value(DET):
eq := eval(%, params):

plot(eq, mu=0..0.6);

We can't see anything useful in that graph.  Let's limit the vertical range:

plot(eq, mu=0..0.6, view=-1e8..1e8);

mu__1, mu__2, mu__3 := fsolve(eq, mu=1e-3..0.6, maxsols=3);

0.843267855136311e-1, .211829475814118, .355117213056777

plots:-display([
        plot_beam(M, mu__1, params),
        plot_beam(M, mu__2, params),
        plot_beam(M, mu__3, params)],
        color=["red","Green","blue"],
        legend=[mode1, mode2, mode3]);

Digits := 10;  # restore the default

10

 

 

 

 

 

 

Download krylov-duncan.mw

 

First 16 17 18 19 20 21 22 Last Page 18 of 76