(* Input *)
(*kin = 20.;*)
mass= 939.;
range = 3;

sps={{Dashing[None],RGBColor[0,0,0]}, {Dashing[Large],RGBColor[1,0,0]},{Dashing[Medium],RGBColor[0,0,1]},{Dashing[None],RGBColor[0,1,0]},{Dashing[None],RGBColor[0,1,1]}};

kOut[e_] := ((Sqrt[2*mass*e])/197.327)

kIn[e_,U0_] := ((Sqrt[2 mass (e- U0)])/197.327)

ang = 0;
Plot[{e*SphericalBesselJ[ang,e],Sin[e-ang*(Pi/2)]},{e,0,50},PlotStyle->sps]

Plot[{-e*SphericalBesselY[ang,e],Cos[e-ang*(Pi/2)]},{e,0,50},PlotStyle->sps]

δ[e_,ang_,r_,u0_]:= ArcCot[(SphericalBesselY[ang,kOut[e] r]D[SphericalBesselJ[ang,kIn[e,u0]r],r] - SphericalBesselJ[ang,kIn[e,u0]r]D[SphericalBesselY[ang,kOut[e] r],r])/(SphericalBesselJ[ang,kOut[e]r]D[SphericalBesselJ[ang,kIn[e,u0]r],r] - SphericalBesselJ[ang,kIn[e,u0]r]D[SphericalBesselJ[ang,kOut[e]r],r]) ]

myDelta[e_,ang_,u0_]:= Simplify[δ[e,ang,r,u0]/.r->range]

myU = -20;
myAng = 0;
Plot[{myDelta[e,myAng,-2],myDelta[e,myAng,-5],myDelta[e,myAng,-7]},{e,0,40},PlotRange->All,PlotStyle->sps]

CS[e_,ang_,u0_]:=(1/100)((4 π )/((kOut[e])^2)) (2ang +1) (((Sin[myDelta[e,ang,u0]]))^2)

csAng = 1;
Plot[{CS[ee,csAng,-5],CS[ee,csAng,-10],CS[ee,csAng,-15],CS[ee,csAng,-20]},{ee,0,40},PlotRange->All,PlotStyle->sps]

A[e_,ang_,u0_]:=((kOut[e] SphericalBesselJ[ang,kOut[e]range]Cos[myDelta[e,ang,u0]] -kOut[e] SphericalBesselY[ang,kOut[e] range]Sin[myDelta[e,ang,u0]])/(kIn[e,u0]SphericalBesselJ[ang,kIn[e,u0]range]))

fIn[e_,r_,ang_,u0_]:=A[e,ang,u0]kIn[e,u0]r SphericalBesselJ[ang,kIn[e,u0]r]

fOut[e_,r_,ang_,u0_]:=kOut[e]r SphericalBesselJ[ang,kOut[e]r]Cos[myDelta[e,ang,u0]] - kOut[e]r SphericalBesselY[ang,kOut[e]r]Sin[myDelta[e,ang,u0]]

myE = 30;
myU = -20;
myAng = 1;
Plot[{fIn[myE,rr,myAng,myU],fOut[myE,rr,myAng,myU]},{rr,0.1,15},PlotRange->All,PlotStyle->sps]

myR = 15;
myU = -15;
myAng = 1;
Plot[{fIn[ee,myR,myAng,myU],fOut[ee,myR,myAng,myU]},{ee,0.1,40},PlotRange->All,PlotStyle->sps]

fOut1[e_,r_,ang_]:=kOut[e] r  SphericalBesselJ[ang,kOut[e]r]

TMatriX[e_,u_,ang_]:=(1/(kIn[e,u]kOut[e]))NIntegrate[ u fIn[e,rr,ang,u]fOut1[e,rr,ang] ,{rr,0,range}]

u0 = -22;
ang0 = 1;	
Plot[((TMatriX[e,u0,ang0])^2),{e,0,50}]