Message Boards Message Boards

0
|
4884 Views
|
7 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Integrating a convolution in a specified domain

Posted 11 years ago
Please guys I need to solve this
f1[y_] := {1 /; -1/2 <= y <= 0; 1 /; 0 < y <= 1/2;
   0 /; 1/2 < y < \[Infinity]; 0 /; -\[Infinity] < y < -1/2};

g1[y_, x_] := {1 /; -1/2 <= (y + x) <= 0; 1 /; 0 < (y + x) <= 1/2;
   0 /; 1/2 < (y + x) < \[Infinity];
   0 /; -\[Infinity] < (y + x) < -1/2};
find the integral f1 * g1[y,x] dy and plot it.
POSTED BY: azmi almasalha
7 Replies
Posted 11 years ago
 In[1]:= f1[y_]:=Piecewise[{{0, -Infinity<y<-1/2}, {1,-1/2<=y<=1/2}, {0, 1/2<y<Infinity}}];
 In[2]:= g1[y_, x_]:=Piecewise[{{0, -Infinity<x+y<-1/2}, {1, -1/2<=x+y<=1/2}, {0, 1/2<x+y<Infinity}}];
 In[3]:= Plot3D[f1[y], {x, -5, 5}, {y, -5, 5}]
 Out[3]= ...Snip...
 In[4]:= Plot3D[g1[y, x], {x, -5, 5}, {y, -5, 5}]
 Out[4]= ...Snip...
 In[5]:= Plot3D[f1[y]*g1[y, x], {x, -5, 5}, {y, -5, 5}]
 Out[5]= ...Snip...
 In[6]:= Integrate[f1[y]*g1[y, x], {x, -2, 2}, {y, -2, 2}]
Out[6]= 1
Test this carefully.
POSTED BY: Bill Simpson
Posted 11 years ago
Dear Bill Simpson ,
Thank you  I did that and I have another qs for another issue can I discuss that with you if you don't mind please ?
POSTED BY: azmi almasalha
Posted 11 years ago
If you can explain your question clearly so others can understand and show what work you have done then people are happy to try and help
POSTED BY: Bill Simpson
Posted 11 years ago
 Sscar[rff, \[Theta]_, \[Pi]/2] :=
 
   1/2*Re[Cross[{Escar[rff, \[Theta], \[Pi]/2],
 
         Esca\[Theta][rff, \[Theta], \[Pi]/2],
 
         Esca\[Phi][rff, \[Theta], \[Pi]/2]},
 
        Conjugate[{Bscar[rff, \[Theta], \[Pi]/2],

         Bsca\[Theta][rff, \[Theta], \[Pi]/2],

         Bsca\[Phi][rff, \[Theta], \[Pi]/2]}]]].{1, 0, 0}/ norm;
res = \[Pi]/200.0;

rff = 100*R;

norm = Sscar[rff, \[Theta]z, \[Pi]/2.0];
Now if I want to make a shift just only for (theta) to make a new function
Sscar1[rff, \[Theta]_, s1_, \[Pi]/2] :=

  1/2*Re[Cross[{Escar[rff, (\[Theta] + s1), \[Pi]/2],

        Esca\[Theta][rff, (\[Theta] + s1), \[Pi]/2],

        Esca\[Phi][rff, (\[Theta] + s1), \[Pi]/2]},

       Conjugate[{Bscar[rff, (\[Theta] + s1), \[Pi]/2],

         Bsca\[Theta][rff, (\[Theta] + s1), \[Pi]/2],

         Bsca\[Phi][rff, (\[Theta] + s1), \[Pi]/2]}]]].{1, 0, 0}/

    norm;
So Plot[ data1[\[Theta]_] :=

Integrate [

  Sscar[rff, \[Theta], \[Pi]/2]*

   Sscar1[rff, \[Theta],

    s1, \[Pi]/2], {\[Theta], \[Theta]z, \[Theta]\[Pi]}]]
Where theta is the polar angle in spherical coordinate and the E's and B's are the electric and magnetic fields and they are already defined with special definitions contain Bessel and Legendre function My qs I cant define (theta+s1)?
Help me plz
POSTED BY: azmi almasalha
Posted 11 years ago
 Sscar[rff_, \[Theta]_, \[Pi]/2] :=
   1/2*Re[Cross[{Escar[rff,\[Theta],\[Pi]/2], Esca\[Theta][rff,\[Theta],\[Pi]/2], Esca\[Phi][rff,\[Theta],\[Pi]/2]},
   Conjugate[{Bscar[rff,\[Theta],\[Pi]/2], Bsca\[Theta][rff,\[Theta],\[Pi]/2], Bsca\[Phi][rff,\[Theta],\[Pi]/2]}]]].{1, 0, 0}/norm;
 res = \[Pi]/200.0;
 rff = 100*R;
 norm = Sscar[rff, \[Theta]z, \[Pi]/2.0];
 Sscar1[rff_, \[Theta]_, s1_, \[Pi]/2] :=
   1/2*Re[Cross[{Escar[rff,(\[Theta]+s1),\[Pi]/2],Esca\[Theta][rff,(\[Theta]+s1),\[Pi]/2],Esca\[Phi][rff,(\[Theta]+s1),\[Pi]/2]},
   Conjugate[{Bscar[rff,(\[Theta]+s1),\[Pi]/2],Bsca\[Theta][rff,(\[Theta]+s1),\[Pi]/2],Bsca\[Phi][rff,(\[Theta]+s1),\[Pi]/2]}]]].{1, 0, 0}/norm;
Plot[Integrate[Sscar[rff,\[Theta],\[Pi]/2]*Sscar1[rff,\[Theta],s1,\[Pi]/2],{\[Theta],\[Theta]z,\[Theta]\[Pi]}]]

Compare that very carefully with your code and see the small changes. I added _ after rff in your Sscar and Sscar1 definitions and changed your Plot argument.

The final Plot is still mising a {var,low,high} to show the range of the plot to make.

I believe there are other changes that will be needed.
POSTED BY: Bill Simpson
Posted 11 years ago
Dear ,
But (rff) is constant I forget to tell you that (R= 40.4853)  so the only variable here is (theta) . My problem I can not define (theta+s1) and integrate !
Any way thanks and I will try again .
POSTED BY: azmi almasalha
Posted 11 years ago
Now I understand R and rff and that theta is your variable. Thank you.

I apologize for not understanding your problem defining theta+s1. If you can explain more I will try to understand.

Would you show me your definition for Bscatheta, Escatheta?

It appears that your Bscar is multiplied by zero by the dot operation and that definition is not needed to see the result.

Mathematica treats 2.0 and 2 very differently. Thus Sscar[rff, thetaz_, Pi/2] and Sscar[rff, thetaz_, Pi/2.0] are different. I changed your
norm = Sscar[rff, thetaz_, Pi/2.0]
to
norm = Sscar[rff, thetaz_, Pi/2]
and this fixed one more small problem.

But now I have another problem.
Sscarp[]:= .../norm
but
norm=Sscar[]
and so there is recursion again and again, always calculating another deeper Sscar until Mathematica halts with RecursionLimit.
Can you define Sscar or norm so that they do not calculate again and again?

Would you tell me the variable and range you wish to plot your integral over?

Do thetaz and thetapi have constant values?

Thank you
POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract