Arny

20 Reputation

2 Badges

2 years, 217 days

MaplePrimes Activity


These are replies submitted by Arny

@Kitonum Thanks a lot for correcting the syntax. 

 

@Carl Love OK, I have updated the worksheet for a better example. 

1-D and 3-D integrals of this type typically have different behaviours. 

@Arny, the following could be a start, but not much of an output from Maple. 


 

NULL

with(Physics[Vectors])

p_ := px_i+py_j+pz_k

px_i+py_j+pz_k

(1)

NULL

q_ := qx_i+qy_j+qz_k

qx_i+qy_j+qz_k

(2)

NULL

w_ := wx_i+wy_j+wz_k

wx_i+wy_j+wz_k

(3)

NULL

'`#mover(mi("p"),mo("→"))`^2/((`#mover(mi("p"),mo("→"))`-`#mover(mi("q"),mo("→"))`+`#mover(mi("w"),mo("→"))`).(`#mover(mi("p"),mo("→"))`-`#mover(mi("q"),mo("→"))`+`#mover(mi("w"),mo("→"))`)+b1^2)'

`#mover(mi("p"),mo("→"))`^2/(Typesetting:-delayDotProduct(`#mover(mi("p"),mo("→"))`-`#mover(mi("q"),mo("→"))`+`#mover(mi("w"),mo("→"))`, `#mover(mi("p"),mo("→"))`-`#mover(mi("q"),mo("→"))`+`#mover(mi("w"),mo("→"))`)+b1^2)

(4)

NULL

int(`#mover(mi("p"),mo("→"))`^2/((`#mover(mi("p"),mo("→"))`-`#mover(mi("q"),mo("→"))`+`#mover(mi("w"),mo("→"))`)(`#mover(mi("p"),mo("→"))`-`#mover(mi("q"),mo("→"))`+`#mover(mi("w"),mo("→"))`)+b1^2), [px = -infinity .. infinity, py = -infinity .. infinity, pz = -infinity .. infinity])

`#mover(mi("p"),mo("→"))`^2*infinity/(`#mover(mi("p"),mo("→"))`(`#mover(mi("p"),mo("→"))`-`#mover(mi("q"),mo("→"))`+`#mover(mi("w"),mo("→"))`)-`#mover(mi("q"),mo("→"))`(`#mover(mi("p"),mo("→"))`-`#mover(mi("q"),mo("→"))`+`#mover(mi("w"),mo("→"))`)+`#mover(mi("w"),mo("→"))`(`#mover(mi("p"),mo("→"))`-`#mover(mi("q"),mo("→"))`+`#mover(mi("w"),mo("→"))`)+b1^2)

(5)

NULL


 

Download Integration-Vec-Example.mw

@Carl Love Thanks, I corrected the input. 
Apparently, no closer to the result though. 

@Rouben Rostamian  tomleslie 3149 

Thank you tomleslie 3149 and Rouben Rostamian for taking interest. 

The integration is is indeed over (dp,dq,dw) ∈ R3×R3×Ri.e. as indicated dp = d3p, where p is really \vec{p}, p ∈ R3 etc.

Is it possible to help Maple understand if dp were to be directly expressed in as a 3-vector differential? 

It is possible to express the integrals in spherical co-ordinates, and without phi dependence, would be left with integration over six dimensions, with no vector variables left in the integral. 

@ecterrab 
Thank you once again. The updated worksheet, with the actual integrand, variables of integration and limits is attached.

The integration is being attempted first analytically, to the extent possible. It is very likely that only numerical evaluations will be possible, at least for some of the integration variables. The ideal range of integration is -Infty to +Infty for each of the variables p1, p3 and p4, but it could be tested for convergence over limits -1 to +1, -10 to +10 etc. There is no integration over vector "r", which could be taken as 1 or its equivalent in Cartesian co-ordinates. In Cartesian co-ordinates, this is a nine dimensional integral. However, the dimensions might come down if polar co-ordinates are used, if they are assumed to be 3-vectors. This is not attempted here. 

For comparison, a Mathematica output is also attached as an image. The Mathematica output seems to evaluate the scalar triple product directly, which Maple doesn't do right away (most likely because it's not built into the output of "CrossProduct[v1,v2] etc). 

VectorIntegral20180409b.mw

@ecterrab 

Attached is the Maple worksheet

VectorIntegral.mw

The integration (whether numeric, or analytic, hopefully both) needs to be done avoiding the singularities. There is no integration over r (i.e. \vec{r}). 

Numerical integration, after any analytic integration, would need to be done for r = 1, 1.5, ....10 (so r={1,1,1} etc.) in cartesian coordinates over p1, p3, etc from -Infinity to + Infinity.  
Later, there would be other integrations, over p1 etc. The full integral would have terms in the denominator like (p1 - p4)^2, (1+p4)^4, etc. and inetgrate over p4 etc. Due to reasons of angular dependencies, it's best if cartesian coordinates are used. 

 

@ecterrab 

Using the methodology you kindly provided, and using Maple 2017, I tried to extend the method to an integration that needs to be done (to the extent possible, in closed form, and then numerically) over the following expression over vectors p1, p3, p4, and p5. (My guess is this must be a combination of a rookie error, plus not knowing how exactly to hand the integral in Maple).  


 

Setup(mathematicalnotation = true); with(Physics[Vectors])

Setup(mathematicalnotation = true)

(1)

r_ := _i*x+_j*y+_k*z

_i*x+_j*y+_k*z

(2)

p__1_ := _i*`p__1x `+_j*`p__1y `+_k*`p__1z `

_i*`p__1x `+_j*`p__1y `+_k*`p__1z `

(3)

p__3_ := Physics:-Vectors:-`+`(Physics:-Vectors:-`+`(`p__3x `*_i, `p__3y `*_j), `p__3z `*_k)

_i*`p__3x `+_j*`p__3y `+_k*`p__3z `

(4)

p__4_ := Physics:-Vectors:-`+`(Physics:-Vectors:-`+`(`p__4x `*_i, `p__4y `*_j), `p__4z `*_k)

_i*`p__4x `+_j*`p__4y `+_k*`p__4z `

(5)

p__5_ := _i*`p__5x `+_j*`p__5y `+_k*`p__5z `

_i*`p__5x `+_j*`p__5y `+_k*`p__5z `

(6)

'exp(I*(p__1_.r_))/((p__3_-p__1_)^2*(p__4_+p__1_)^2*(p__3_^2+1)^2*(p__4_^2+1)^2*(p__5_^2+1)^4)'

Physics:-Vectors:-`+`, "found power of the vector expression %1", p__3_

(7)

CrossProduct(p__3_, p__4_)

CrossProduct(_i*`p__3x `+_j*`p__3y `+_k*`p__3z `, _i*`p__4x `+_j*`p__4y `+_k*`p__4z `)

(8)

DotProduct(p__1_, CrossProduct(`p__3x `*`#mover(mi("i"),mo("∧"))`+`p__3y `*`#mover(mi("j"),mo("∧"))`+`p__3z `*`#mover(mi("k"),mo("∧"))`, `p__4x `*`#mover(mi("i"),mo("∧"))`+`p__4y `*`#mover(mi("j"),mo("∧"))`+`p__4z `*`#mover(mi("k"),mo("∧"))`))

DotProduct(_i*`p__1x `+_j*`p__1y `+_k*`p__1z `, CrossProduct(_i*`p__3x `+_j*`p__3y `+_k*`p__3z `, _i*`p__4x `+_j*`p__4y `+_k*`p__4z `))

(9)

'exp(Typesetting[delayDotProduct](I, `#mover(mi("\`p__1\`"),mo("→"))`.`#mover(mi("r"),mo("→"))`, true))*DotProduct(`p__1x `*`#mover(mi("i"),mo("∧"))`+`p__1y `*`#mover(mi("j"),mo("∧"))`+`p__1z `*`#mover(mi("k"),mo("∧"))`, CrossProduct(`p__3x `*`#mover(mi("i"),mo("∧"))`+`p__3y `*`#mover(mi("j"),mo("∧"))`+`p__3z `*`#mover(mi("k"),mo("∧"))`, `p__4x `*`#mover(mi("i"),mo("∧"))`+`p__4y `*`#mover(mi("j"),mo("∧"))`+`p__4z `*`#mover(mi("k"),mo("∧"))`))/((`#mover(mi("\`p__3\`"),mo("→"))`-`#mover(mi("\`p__1\`"),mo("→"))`)^2*(`#mover(mi("\`p__4\`"),mo("→"))`+`#mover(mi("\`p__1\`"),mo("→"))`)^2*(`#mover(mi("\`p__3\`"),mo("→"))`^2+1)^2*(`#mover(mi("\`p__4\`"),mo("→"))`^2+1)^2*(`#mover(mi("\`p__5\`"),mo("→"))`^2+1)^4)'

Physics:-Vectors:-`+`, "found power of the vector expression %1", p__3_

(10)

interface(imaginaryunit = I)

I

(11)

exp(Typesetting[delayDotProduct](I, `#mover(mi("\`p__1\`"),mo("→"))`.`#mover(mi("r"),mo("→"))`, true))*DotProduct(`p__1x `*`#mover(mi("i"),mo("∧"))`+`p__1y `*`#mover(mi("j"),mo("∧"))`+`p__1z `*`#mover(mi("k"),mo("∧"))`, CrossProduct(`p__3x `*`#mover(mi("i"),mo("∧"))`+`p__3y `*`#mover(mi("j"),mo("∧"))`+`p__3z `*`#mover(mi("k"),mo("∧"))`, `p__4x `*`#mover(mi("i"),mo("∧"))`+`p__4y `*`#mover(mi("j"),mo("∧"))`+`p__4z `*`#mover(mi("k"),mo("∧"))`))/((`#mover(mi("\`p__3\`"),mo("→"))`-`#mover(mi("\`p__1\`"),mo("→"))`)^2*(`#mover(mi("\`p__4\`"),mo("→"))`+`#mover(mi("\`p__1\`"),mo("→"))`)^2*(`#mover(mi("\`p__3\`"),mo("→"))`^2+1)^2*(`#mover(mi("\`p__4\`"),mo("→"))`^2+1)^2*(`#mover(mi("\`p__5\`"),mo("→"))`^2+1)^4)

Error, invalid input: Physics:-Vectors:-BaseToUnitVectorNotation expects its 1st argument, V, to be of type identical(i,j,k,r,rho,phi,theta), but received i

"((e)^(i (`p__1`*r)) DotProduct(`p__1x ` i+`p__1y ` j+`p__1z ` k,CrossProduct(`p__3x ` i+`p__3y ` j+`p__3z ` k,`p__4x ` i+`p__4y ` j+`p__4z ` k)))/((`p__3`-`p__1`)^2 (`p__4`+`p__1`)^2 (`p__3`^2+1)^2 (`p__4`^2+1)^2 (`p__5`^2+1)^4)"

 

``


 

Download V2-Integral-20171103b.mw
 

 

@ecterrab 

Thank you!

My Maple 17 worksheet is giving the following errors, is there something incorrect? (Tried correcting the p3 entry in the worksheet you had attached)


 

with(Physics[Vectors]):

r_ := _i*x+_j*y+_k*z

_i*x+_j*y+_k*z

(1)

p__1_ := _i*`p__1x `+_j*`p__1y `+_k*`p__1z `

_i*`p__1x `+_j*`p__1y `+_k*`p__1z `

(2)

p__3_ := _i*`p__3x `+_j*`p__3y `+_k*`p__3z `

_i*`p__3x `+_j*`p__3y `+_k*`p__3z `

(3)

This is the integratal to be evaluated

'exp(i*(p__1_ . r_))/((p__3_ - p__1_)^2)';

exp(I*(p__1_.r_))/(p__3_-p__1_)^2

(4)

Note the ' ' delaying the evaluation, if you allow evaluation, the integrand is

exp(I*(p__1_.r_))/(p__3_-p__1_)^2

exp(I*(`p__1x `*x+`p__1y `*y+`p__1z `*z))/(_i*(-`p__1x `+`p__3x `)+_j*(-`p__1y `+`p__3y `)+_k*(-`p__1z `+`p__3z `))^2

(5)

Define iota

interface(imaginaryunit = i)

I

(6)

Because (4), has the value of i before being the imaginary unit, I need to input the integrand again

'exp(i*(p__1_ . r_))/((p__3_ - p__1_)^2)';

exp(I*(p__1_.r_))/(p__3_-p__1_)^2

(7)

 

Now on the integration

Int(exp(I*(p__1_.r_))/(p__3_-p__1_)^2, [x = -infinity .. infinity, y = -infinity .. infinity, z = -infinity .. infinity])

Int(exp(I*(`p__1x `*x+`p__1y `*y+`p__1z `*z))/(_i*(-`p__1x `+`p__3x `)+_j*(-`p__1y `+`p__3y `)+_k*(-`p__1z `+`p__3z `))^2, [x = -infinity .. infinity, y = -infinity .. infinity, z = -infinity .. infinity])

(8)

value(Int(exp(I*(`p__1x `*x+`p__1y `*y+`p__1z `*z))/(_i*(-`p__1x `+`p__3x `)+_j*(-`p__1y `+`p__3y `)+_k*(-`p__1z `+`p__3z `))^2, [x = -infinity .. infinity, y = -infinity .. infinity, z = -infinity .. infinity]))

undefined/(_i*(-`p__1x `+`p__3x `)+_j*(-`p__1y `+`p__3y `)+_k*(-`p__1z `+`p__3z `))^2

(9)

In the above, there is the product of three Dirac delta functions, that can be represented as a single 3D Dirac delta

combine(undefined/(_i*(-`p__1x `+`p__3x `)+_j*(-`p__1y `+`p__3y `)+_k*(-`p__1z `+`p__3z `))^2)

undefined/(_i*(-`p__1x `+`p__3x `)+_j*(-`p__1y `+`p__3y `)+_k*(-`p__1z `+`p__3z `))^2

(10)

NULL


 

Download VectorIntegral.mw
 

with(Physics[Vectors]):

r_ := _i*x+_j*y+_k*z

_i*x+_j*y+_k*z

(1)

p__1_ := _i*`p__1x `+_j*`p__1y `+_k*`p__1z `

_i*`p__1x `+_j*`p__1y `+_k*`p__1z `

(2)

p__3_ := _i*`p__3x `+_j*`p__3y `+_k*`p__3z `

_i*`p__3x `+_j*`p__3y `+_k*`p__3z `

(3)

This is the integratal to be evaluated

'exp(i*(p__1_ . r_))/((p__3_ - p__1_)^2)';

exp(I*(p__1_.r_))/(p__3_-p__1_)^2

(4)

Note the ' ' delaying the evaluation, if you allow evaluation, the integrand is

exp(I*(p__1_.r_))/(p__3_-p__1_)^2

exp(I*(`p__1x `*x+`p__1y `*y+`p__1z `*z))/(_i*(-`p__1x `+`p__3x `)+_j*(-`p__1y `+`p__3y `)+_k*(-`p__1z `+`p__3z `))^2

(5)

Define iota

interface(imaginaryunit = i)

I

(6)

Because (4), has the value of i before being the imaginary unit, I need to input the integrand again

'exp(i*(p__1_ . r_))/((p__3_ - p__1_)^2)';

exp(I*(p__1_.r_))/(p__3_-p__1_)^2

(7)

 

Now on the integration

Int(exp(I*(p__1_.r_))/(p__3_-p__1_)^2, [x = -infinity .. infinity, y = -infinity .. infinity, z = -infinity .. infinity])

Int(exp(I*(`p__1x `*x+`p__1y `*y+`p__1z `*z))/(_i*(-`p__1x `+`p__3x `)+_j*(-`p__1y `+`p__3y `)+_k*(-`p__1z `+`p__3z `))^2, [x = -infinity .. infinity, y = -infinity .. infinity, z = -infinity .. infinity])

(8)

value(Int(exp(I*(`p__1x `*x+`p__1y `*y+`p__1z `*z))/(_i*(-`p__1x `+`p__3x `)+_j*(-`p__1y `+`p__3y `)+_k*(-`p__1z `+`p__3z `))^2, [x = -infinity .. infinity, y = -infinity .. infinity, z = -infinity .. infinity]))

undefined/(_i*(-`p__1x `+`p__3x `)+_j*(-`p__1y `+`p__3y `)+_k*(-`p__1z `+`p__3z `))^2

(9)

In the above, there is the product of three Dirac delta functions, that can be represented as a single 3D Dirac delta

combine(undefined/(_i*(-`p__1x `+`p__3x `)+_j*(-`p__1y `+`p__3y `)+_k*(-`p__1z `+`p__3z `))^2)

undefined/(_i*(-`p__1x `+`p__3x `)+_j*(-`p__1y `+`p__3y `)+_k*(-`p__1z `+`p__3z `))^2

(10)

NULL


 

Download VectorIntegral.mw

 

@ecterrab 

with(Physics[Vectors]);
print(`output redirected...`); # input placeholder
[&x, +, ., ChangeBasis, Component, Curl, DirectionalDiff, 

  Divergence, Gradient, Identify, Laplacian, Nabla, Norm, Setup, 

  diff]
X := _i*x1+_j*x2+_k*x3;
print(`output redirected...`); # input placeholder
                     _i x1 + _j x2 + _k x3
P := _i*p1+_j*p2+_k*p3;
print(`output redirected...`); # input placeholder
                     _i p1 + _j p2 + _k p3
e^(X.P);
print(`output redirected...`); # input placeholder
                     (p1 x1 + p2 x2 + p3 x3)
                    e                       
int(e^(p1*x1+p2*x2+p3*x3), P);
%;
Error, (in int) integration range or variable must be specified in the second argument, got _i*p1+_j*p2+_k*p3

Not the solution expected?

Page 1 of 1