Items tagged with physics

Feed
Also available: physics

I posted a similar question about typesetting:-delayDotProduct. I used two different methods to solve the same vector calculus problem and came up with two seperate problems, though both are using the with(Physics[Vectors]) package. Below is my code showing the error.

Thanks for any help you all can give on this.

Cheers,

Dave
 

``

Problem 3-1

 

basis issue

 

restart; with(Physics[Vectors]): Setup(mathematicalnotation=true);
Coordinates(cartesian); Coordinates(X = [x,y,z,t])

[mathematicalnotation = true]

 

Coordinates(cartesian)

 

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

(1.1.1)

D1:=D1_(t,x,y,z);
B:=B_(t,x,y,z);
E:=E_(t,x,y,z);
j__p:=j__p_(t,x,y,z);

D1_(t, x, y, z)

 

B_(t, x, y, z)

 

E_(t, x, y, z)

 

j__p_(t, x, y, z)

(1.1.2)

f1:=epsilon=epsilon__0+rho/(B_.B_);

epsilon = epsilon__0+rho/Physics:-Vectors:-Norm(B_)^2

(1.1.3)

f2:=Nabla.D1=0;
f3:=Nabla.(epsilon*E)=0;

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

 

epsilon*Physics:-Vectors:-Divergence(E_(t, x, y, z)) = 0

(1.1.4)

poisson equation and assume sigma is sigma__p

f4:=epsilon__0*(Nabla.E)=sigma__p(t);

epsilon__0*Physics:-Vectors:-Divergence(E_(t, x, y, z)) = sigma__p(t)

(1.1.5)

f5:=diff(sigma__p(t),t)+Nabla.j__p=0;
f6:=j__p=n*e(v__i_p-v__e_p);
f7:=j__p=n/(B_.B_)*(m__i+m__e)*diff(E,t);
f8:=j__p=rho/(B.B)*diff(E,t);

diff(sigma__p(t), t)+Physics:-Vectors:-Divergence(j__p_(t, x, y, z)) = 0

 

j__p_(t, x, y, z) = n*e(v__i_p-v__e_p)

 

j__p_(t, x, y, z) = n*(m__i+m__e)*(diff(E_(t, x, y, z), t))/Physics:-Vectors:-Norm(B_)^2

 

j__p_(t, x, y, z) = rho*(diff(E_(t, x, y, z), t))/Physics:-Vectors:-Norm(B_(t, x, y, z))^2

(1.1.6)

f9:=diff(f2,t);
f10:=diff(f3,t);
f11:=diff(f4,t);

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

 

epsilon*Physics:-Vectors:-Divergence(diff(E_(t, x, y, z), t)) = 0

 

epsilon__0*Physics:-Vectors:-Divergence(diff(E_(t, x, y, z), t)) = diff(sigma__p(t), t)

(1.1.7)

f12:=isolate(f11,diff(sigma__p(t),t));
f13:=subs(f12,f5);
f14:=subs(f8,f13);
f15:=isolate(f14,Nabla.diff(E_(t,x,y,z),t));

diff(sigma__p(t), t) = epsilon__0*Physics:-Vectors:-Divergence(diff(E_(t, x, y, z), t))

 

epsilon__0*Physics:-Vectors:-Divergence(diff(E_(t, x, y, z), t))+Physics:-Vectors:-Divergence(j__p_(t, x, y, z)) = 0

 

epsilon__0*Physics:-Vectors:-Divergence(diff(E_(t, x, y, z), t))+Physics:-Vectors:-Divergence(rho*(diff(E_(t, x, y, z), t))/Physics:-Vectors:-Norm(B_(t, x, y, z))^2) = 0

 

Error, (in Physics:-Vectors:-+) vectors projected over different basis

 

 

NULL


 

Download Different_basis.mw

how to calculate potential energy in terms of gauss curvature?

I'm back from presenting work in the "23rd Conference on Applications of Computer Algebra -2017" . It was a very interesting event. This fifth presentation, about "The Appell doubly hypergeometric functions", describes a very recent project I've been working at Maple, i.e. the very first complete computational implementation of the Appell doubly hypergeometric functions. This work appeared in Maple 2017. These functions have a tremendous potential in that, at the same time, they have a myriad of properties, and include as particular cases most of the existing mathematical language, and so they have obvious applications in integration, differential equations, and applied mathematics all around. I think these will be the functions of this XXI century, analogously to what happened with hypergeometric functions in the previous century.

At the end, there is a link to the presentation worksheet, with which one could open the sections and reproduce the presentation examples.
 

The four double-hypergeometric Appell functions,

a complete implementation in a computer algebra system

 

Edgardo S. Cheb-Terrab

Physics, Differential Equations and Mathematical Functions, Maplesoft

 

Abstract:
The four multi-parameter Appell functions, AppellF1 , AppellF2 , AppellF3  and AppellF4  are doubly hypergeometric functions that include as particular cases the 2F1 hypergeometric  and some cases of the MeijerG  function, and with them most of the known functions of mathematical physics. Appell functions have been popping up with increasing frequency in applications in quantum mechanics, molecular physics, and general relativity. In this talk, a full implementation of these functions in the Maple computer algebra system, including, for the first time, their numerical evaluation over the whole complex plane, is presented, with details about the symbolic and numerical strategies used.

Appell Functions (symbolic)

 

 

The main references:

• 

P. Appel, J.Kamke de Feriet, "Fonctions hypergeometriques et Hyperspheriques", 1926

• 

H. Srivastava, P.W. Karlsson, "Multiple Gaussian Hypergeometric Series", 1985

• 

24 papers in the literature, ranging from 1882 to 2015

 

Definition and Symmetries

   

Polynomial and Singular Cases

   

Single Power Series with Hypergeometric Coefficients

   

Analytic Extension from the Appell Series to the Appell Functions

   

Euler-Type and Contiguity Identities

   

Appell Differential Equations

   

Putting all together

   

Problem: some formulas in the literature are wrong or miss the conditions indicating when are they valid (exchange with the Mathematics director of the DLMF - NIST)

   

Appell Functions (numeric)

 

 

Goals

 

• 

Compute these Appell functions over the whole complex plane

• 

Considering that this is a research problem, implement different methods and flexible optional arguments to allow for:

a) comparison between methods (both performance and correctness),

b) investigation of a single method in different circumstances.

• 

Develop a computational structure that can be reused with other special functions (abstract code and provide the main options), and that could also be translated to C (so: only one numerical implementation, not 100 special function numerical implementations)

Limitation: the Maple original evalf command does not accept optional arguments

 

The cost of numerically evaluating an Appell function

 

• 

If it is a special hypergeometric case, then between 1 to 2 hypergeometric functions

• 

Next simplest case (series/recurrence below) 3 to 4 hypergeometric functions plus adding somewhat large formulas that involve only arithmetic operations up to 20,000 times (frequently less than 100 times)

• 

Next simplest case: the formulas themselves are power series with hypergeometric function coefficients; these cases frequently converge rapidly but may involve the numerical evaluation of up to hundreds of hypergeometric functions to get the value of a single Appell function.

 

Strategy for the numerical evaluation of Appell functions (or other functions ...)

 

 

The numerical evaluation flows orderly according to:

1) check whether it is a singular case

2) check whether it is a special value

3) compute the value using a series derived from a recurrence related to the underlying ODE

4) perform an sum using an infinite sum formula, checking for convergence

5) perform the numerical integration of the ODE underlying the given Appell function

6) perform a sequence of concatenated Taylor series expansions

Examples

   

Series/recurrence

   

Numerical integration of an underlying differential equation (ODEs and dsolve/numeric)

   

Concatenated Taylor series expansions covering the whole complex plane

   

Subproducts

 

Improvements in the numerical evaluation of hypergeometric functions

   

Evalf: an organized structure to implement the numerical evaluation of special functions in general

   

To be done

   


 

Download Appell_Functions.mw   
Download Appell_Functions.pdf

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

I'm back from presenting work in the "23rd Conference on Applications of Computer Algebra -2017" . It was a very interesting event. This third presentation, about "Computer Algebra in Theoretical Physics", describes the Physics project at Maplesoft, also my first research project at University, that evolved into the now well-known Maple Physics package. This is a unique piece of software and perhaps the project I most enjoy working.

At the end, there is a link to the presentation worksheet, with which one could open the sections and reproduce the presentation examples.
 

 

 

Computer Algebra in Theoretical Physics

 

Edgardo S. Cheb-Terrab

Physics, Differential Equations and Mathematical Functions, Maplesoft

 

Abstract:

 

Generally speaking, physicists still experience that computing with paper and pencil is in most cases simpler than computing on a Computer Algebra worksheet. On the other hand, recent developments in the Maple system have implemented most of the mathematical objects and mathematics used in theoretical physics computations, and have dramatically approximated the notation used in the computer to the one used with paper and pencil, diminishing the learning gap and computer-syntax distraction to a strict minimum.

 

In this talk, the Physics project at Maplesoft is presented and the resulting Physics package is illustrated by tackling problems in classical and quantum mechanics, using tensor and Dirac's Bra-Ket notation, general relativity, including the equivalence problem, and classical field theory, deriving field equations using variational principles.

 

 

 

 

... and why computer algebra?

 

We can concentrate more on the ideas instead of on the algebraic manipulations

 

We can extend results with ease

 

We can explore the mathematics surrounding a problem

 

We can share results in a reproducible way

 

Representation issues that were preventing the use of computer algebra in Physics

   

Classical Mechanics

 

*Inertia tensor for a triatomic molecule

   

Quantum mechanics

 

*The quantum operator components of  `#mover(mi("L",mathcolor = "olive"),mo("→",fontstyle = "italic"))` satisfy "[L[j],L[k]][-]=i `ε`[j,k,m] L[m]"

   

*Unitary Operators in Quantum Mechanics

 

*Eigenvalues of an unitary operator and exponential of Hermitian operators

   

*Properties of unitary operators

 

 

Consider two set of kets " | a[n] >" and "| b[n] >", each of them constituting a complete orthonormal basis of the same space.

*Verify that "U=(&sum;) | b[k] >< a[k] |" , maps one basis to the other, i.e.: "| b[n] >=U | a[n] >"

   

*Show that "U=(&sum;) | b[k] > < a[k] | "is unitary

   

*Show that the matrix elements of U in the "| a[n] >" and  "| b[n] >" basis are equal

   

Show that A and `&Ascr;` = U*A*`#msup(mi("U"),mo("&dagger;"))`have the same spectrum (eigenvalues)

   

Schrödinger equation and unitary transform

   

Translation operators using Dirac notation

   

*Quantization of the energy of a particle in a magnetic field

   

Classical Field Theory

 

The field equations for the lambda*Phi^4 model

   

*Maxwell equations departing from the 4-dimensional Action for Electrodynamics

   

*The Gross-Pitaevskii field equations for a quantum system of identical particles

   

General Relativity

 

Exact Solutions to Einstein's Equations  Lambda*g[mu, nu]+G[mu, nu] = 8*Pi*T[mu, nu]

   

*"Physical Review D" 87, 044053 (2013)

   

The Equivalence problem between two metrics

   

*On the 3+1 split of the 4D Einstein equations

   

Tetrads and Weyl scalars in canonical form

   

 

 


 

Download Physics.mw

Download Physics.pdf

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

This might be considered nit-picking, but nonetheless I think there is an issue: The metric tensor and its inverse are types (0,2) and (2,0) tensors, respectively. When once contracted with each other, the result is the Kronecker delta, which is then (necessarily) a tensor of type (1,1). I am therefore surprised to find that in Maple, this Kronecker delta is implemented as a type (0,2) tensor, via the command KroneckerDelta:

KroneckerDelta[mu,nu];

I don't think this makes any proper sense. I think that such an object of type (0,2) is, in fact, the metric itself. On a similar note, the (mixed tensor type) objects g_[mu,~nu] and g_[~mu,nu] are actually both Kronecker deltas, because they correspond to the metric having one index raised by contraction with the inverse metric itself. But, nonetheless, the following is the case:

g_[ mu,~nu],
g_[~mu, nu];

Relatedly, consider the following single contraction of the metric with its own inverse:

SumOverRepeatedIndices(g_[mu,nu]*g_[~nu,~sigma]);

Although this sum is formally quite correct, I think it should be given as just a Kronecker delta (of the correct mixed tensor type, that is).

How can I to build a Spinor with Physics package? I would like to explore a sigma model  from Lagrangian density. The ideia is search the Euler-Lagrange's equation and energy density of this model.  

Consider the following:

with(Physics):
Setup(anticommutativeprefix = psi):
psi^2,psi__1^2,psi__a^2;   # double underscores

Why does the square of psi__a (double underscore) not vanish as well? Or, perhaps, more to the point: why is psi__a not as well considered Grassmann-odd by Maple? Is this counter-intuitive behaviour intentional, or is it a bug?

How can we find ricci tensor of a metric attaced in given file that involve two unknown functions phi(r) and nu(r).metric.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

 

 

 

Hi, there!

I try to simplify the next expression:

Simplify(LeviCivita[4, sigma, lambda, rho]*LeviCivita[4, xi, eta, mu]*g_[rho, mu]*qp[sigma]*q[lambda]*qp[xi]*q[eta])

Maple gives answer:

In reality it is incorrect answer, because indices must run over 1,2,3 but not 1,2,3,4!

SumOverRepeatedIndices(%) confirms that maple mistakes.

 

my preamble is:

with(Physics)

Setup(mathematicalnotation = true);
Coordinates(X);

Setup(spaceindices = lowercaselatin)

Setup(tensors = q[mu](X))

PDEtools:-declare(q(X))

Setup(tensors = qp[mu](X))

PDEtools:-declare(qp(X))

I would like to see the list of metrics recognize by Maple with their acornym.  For example,:

>Setup(coordinates = spherical, metric = kerr)

Hello! I try to make friends physics package and matrixes. But I am faced with difficulties. To be more specific, to consider a code:

with(Physics):
Setup(mathematicalnotation = true);
Coordinates(X);
Setup(tensors = A[mu](X));
PDEtools:-declare(A(X), p0(X), pm(X), pp(X), pt(X), U(X), m5(X))

And then I create a matrix:

pt := proc (X) options operator, arrow; Matrix(2, 2, [[p0(X), sqrt(2)*pp(X)], [sqrt(2)*pm(X), -p0(X)]]) end proc;

It displays as:

Why do p0, pp, pm become function only one variable x1?

Interestingly that maple understands the next matrix:

Nevertheless even for function only one variable derivative works fine:

And I can construct more complicated functions:

But why is only one variable?

Helle everybohy,

I need to setup a metric tensor in 3-d but with the varalble r, theta and phi.  So I try this:

>with(Physics); Setup(mathematicalnotation = true, dimension = 3)

>Setup(coordinates = spherical[r, theta, varphi], metric = M)

where M is the metric that I need to use.  But the last command does not work.  Il I don't write [r, theta, varphi], it work but it's r, theta and t.

Any hint on this please?

Thank you in advance for your help.

Mario Lemelin

mario.lemelin@cgocable.ca

Hello everybody,

In the linearised theory of gravity, I want to do some symbolic calculations.  First, I need to set that:

Then I want to see how the Christoffel symbols will change by putting the above in this:

Any hint someone?  I really appreciate the help for learning the Physics package.  Thank you in advance.

Mario

 

 

 

I need yours hepl.  I work with the physics paсkage and I set:

with(Physics)

Setup(mathematicalnotation = true)

 Coordinates(X)

Setup(Dgammarepresentation = standard)

Setup(spaceindices = uppercaselatin)

Define(m, m5, y, p, mm, pp)

I try to square the next value: 

W := Dgamma[mu]*d_[mu]+M+Psigma[A]*aa[A]-mm*Dgamma[0]-m5*Dgamma[0]*Dgamma[5]+I*Dgamma[5]*Psigma[B]*pp[B]+I*Dgamma[5]*y

("*" is multiplication)

W*W

And after that I want to simplify it:

Simplify(W*W)

I guess that matter is owing to d_[`~mu`]. If I remove this term:

E:=Psigma[A]*aa[A]-mm*Dgamma[0]-m5*Dgamma[0]*Dgamma[5]+I*Dgamma[5]*Psigma[B]*pp[B]+I*Dgamma[5]*y

And if i do:

E*E

Then next error emerges:

What is it?

 

1 2 3 Page 1 of 3