Inacio Aprendanet

65 Reputation

6 Badges

16 years, 249 days

MaplePrimes Activity


These are questions asked by Inacio Aprendanet

Hello to everyone!

 

I was trying to implement the following proc:
 

``

restart; with(plots); with(plottools)

"AngleSpectrum  :=  proc( theta )  local A, B, C, a1,a2,col,k,n;  n := floor(2*Pi/theta):  for k from 1 to n do      a1 := theta*(k-1);   a2 := theta*(k);      if( k mod 2 = 0) then col := COLOR(RGB,.8,.3,.5);      else col := COLOR(RGB,.4,.3,.5) ; fi;      A[k] := plottools[pieslice]([0,0], 1, a1..a2, color = col  ):      C[k] := textplot( [ evalf(1.2*cos(a2)), evalf(1.2*sin(a2)),                   convert(a2, string)]):  od:  display( seq( {A[k], C[k]}, k = 1..n), scaling=constrained);  end proc:"

Error, unterminated loop

"AngleSpectrum  := proc( theta )  local A, B, C, a1,a2,col,k,n;  n := floor(2*Pi/theta):  for k from 1 to n do   a1 := theta*(k-1); a2 := theta*(k);  if( k mod 2 = 0) then col := COLOR(RGB,.8,.3,.5);      else col := COLOR(RGB,.4,.3,.5) ; fi;  A[k] := plottools[pieslice]([0,0], 1, a1..a2, color = col  ):  C[k] := textplot( [ evalf(1.2*cos(a2)), evalf(1.2*sin(a2)),   convert(a2, string)]):  od:  display( seq( {A[k], C[k]}, k = 1..n), scaling=constrained);  end proc:"

 

``


Can anyone help me to figure out my mistake?

Download proc.mw

I wish to express the Maxwell equations in potential fields deriving from a Lagrangian in cartesian coordinates, but expressed in vectorial form; But I am receiving an message error that I do not understand.

Field_A-MaplePrimes.mw
 

 

Initial Definitions:

 

``

I wish in this work to express the Maxwell equations deriving from the Lagrangian in the fields phiand "A,"

phi

(1.1)

but expressed in vectorial form;

 

restart; clear; with(Physics); with(Physics[Vectors]); with(Library)interface(imaginaryunit = I)

clear

 

I

(1.2)

Physics:-Coordinates(X = [t, x, y, z])

`Detected \`t\`, the time variable, in position 1. Changing the signature of the spacetime metric accordingly, to: + - - - `

 

`Default differentiation variables for d_, D_ and dAlembertian are: `*{X = (t, x, y, z)}

 

`Systems of spacetime Coordinates are: `*{X = (t, x, y, z)}

 

{X}

(1.3)

Physics:-Vectors:-Setup(math = true, Physics:-Vectors:-diff = X)

`* Partial match of  'math' against keyword 'mathematicalnotation'`

 

`* Partial match of  'Physics:-Vectors:-diff' against keyword 'differentiationvariables'`

 

`Default differentiation variables for d_, D_ and dAlembertian are: `*{X = (t, x, y, z)}

 

[differentiationvariables = [X], mathematicalnotation = true]

(1.4)

``

Some definitions

 

 

Defining the Maxwell tensor

 

Physics:-Define(F):``

`Defined objects with tensor properties`

(2.1)

 

Defining the field A with their components:

 

A[mu] = Vector(4, [phi(X), A__1(X), A__2(X), A__3(X)]); Define(%)

A[mu] = Vector[column](%id = 18446744074366759750)

 

`Defined objects with tensor properties`

 

{F, A[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(2.2)

Physics:-CompactDisplay(phi(X), A__1(X), A__2(X), A__3(X))

phi(t, x, y, z)*`will now be displayed as`*phi

 

A__1(t, x, y, z)*`will now be displayed as`*A__1

 

A__2(t, x, y, z)*`will now be displayed as`*A__2

 

A__3(t, x, y, z)*`will now be displayed as`*A__3

(2.3)

 

Applying:

 

 

``

F[alpha, beta] := Physics:-Vectors:-`+`(Physics:-d_[beta](A[alpha]), -Physics:-d_[alpha](A[beta]));

Physics:-d_[beta](A[alpha], [X])-Physics:-d_[alpha](A[beta], [X])

(3.1)

``

 

NULL

NULL

Term 1:

 

 

eq1 := Physics:-d_[alpha](F[alpha, beta])

Physics:-d_[alpha](Physics:-d_[beta](A[`~alpha`], [X]), [X])-Physics:-dAlembertian(A[beta], [X])

(4.1)

Physics:-SumOverRepeatedIndices(Physics:-d_[alpha](Physics:-d_[beta](A[`~alpha`], [X]), [X])-Physics:-dAlembertian(A[beta], [X]))

Physics:-d_[beta](diff(phi(X), t), [X])-Physics:-d_[beta](diff(A__1(X), x), [X])-Physics:-d_[beta](diff(A__2(X), y), [X])-Physics:-d_[beta](diff(A__3(X), z), [X])-Physics:-dAlembertian(A[beta], [X])

(4.2)

Physics:-SubstituteTensorIndices(beta = 4, Physics:-d_[beta](diff(phi(X), t), [X])-Physics:-d_[beta](diff(A__1(X), x), [X])-Physics:-d_[beta](diff(A__2(X), y), [X])-Physics:-d_[beta](diff(A__3(X), z), [X])-Physics:-dAlembertian(A[beta], [X]))

diff(diff(phi(X), t), z)-(diff(diff(A__1(X), x), z))-(diff(diff(A__2(X), y), z))-(diff(diff(A__3(X), z), z))-Physics:-dAlembertian(A__3(X), [X])

(4.3)

``

Physics:-SubstituteTensorIndices(beta = 1, Physics:-d_[beta](diff(phi(X), t), [X])-Physics:-d_[beta](diff(A__1(X), x), [X])-Physics:-d_[beta](diff(A__2(X), y), [X])-Physics:-d_[beta](diff(A__3(X), z), [X])-Physics:-dAlembertian(A[beta], [X]))

diff(diff(phi(X), t), t)-(diff(diff(A__1(X), t), x))-(diff(diff(A__2(X), t), y))-(diff(diff(A__3(X), t), z))-Physics:-dAlembertian(phi(X), [X])

(4.4)

SubstituteTensorIndices(beta = 2, Physics[d_][beta](diff(phi(X), t), [X])-Physics[d_][beta](diff(A__1(X), x), [X])-Physics[d_][beta](diff(A__2(X), y), [X])-Physics[d_][beta](diff(A__3(X), z), [X])-Physics[dAlembertian](A[beta], [X]))

Error, (in dchange/info) the number of new and old independent variables must be the same. Found {x, y} as new, while {} as old

 

SubstituteTensorIndices(beta = 3, Physics[d_][beta](diff(phi(X), t), [X])-Physics[d_][beta](diff(A__1(X), x), [X])-Physics[d_][beta](diff(A__2(X), y), [X])-Physics[d_][beta](diff(A__3(X), z), [X])-Physics[dAlembertian](A[beta], [X]))

Error, (in dchange/info) the number of new and old independent variables must be the same. Found {x, y} as new, while {} as old

 

Physics:-SubstituteTensorIndices(beta = 4, Physics:-d_[beta](diff(phi(X), t), [X])-Physics:-d_[beta](diff(A__1(X), x), [X])-Physics:-d_[beta](diff(A__2(X), y), [X])-Physics:-d_[beta](diff(A__3(X), z), [X])-Physics:-dAlembertian(A[beta], [X]))

diff(diff(phi(X), t), z)-(diff(diff(A__1(X), x), z))-(diff(diff(A__2(X), y), z))-(diff(diff(A__3(X), z), z))-Physics:-dAlembertian(A__3(X), [X])

(4.5)

``

What is the origin of the two error messages above? I did some wrong definition? Why this works in t and z but not in x and y?

 

NULL


 

Download Field_A-MaplePrimes.mw

 

 

 

Hello,

 I am trying to solve an differential equation in Maple, but I have no response from Maple.Can someone give a look for me? The coefficients a and b cannot be zero.

 Thanks a lot.

 

Download edo_solução_A_U.mw

Hello;

 

I wish to express a tensorial equation or expression a simplified vector form.

 

In the worksheet attached, I was trying to express Maxwell Equations in the familiar vector form from the tensorial form, using the F[mu,nu] tensor.

 

But I cannot achieve the familiar tensor form. If someone can give a hand, it would help me a lot.

 

HowtoExpressCompactForm.mw

 

 

1 2 3 4 Page 1 of 4