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

Clear[kIn]

kIn[ee1_] := (Sqrt[2*mass*ee1])

Clear[kOut]

kOut[ee1_] := (Sqrt[2 mass (ee1- U0)])

momenta[energy_]:= ((Sqrt[ energy*energy + 2*mass*energy])/197.327);

(* создаю функции *)

phiIn[q_,r_,A1_,angMom_] := A1*SphericalBesselJ[angMom,q*r] q r

phiOut[k_,r_,delta_,angMom_]:= k r SphericalBesselJ[angMom,k*r] Cos[delta] + k r SphericalBesselY[angMom,k*r] Sin[delta]

(* и их производные *)

phiIn1[q_,r_,A1_,angMom_] := Simplify[D[phiIn[q,r,A1,angMom],r]]

Print[phiIn1[q,r,A1,angMom]]

phiOut1[k_,r_,delta_,angMom_] := Simplify[D[phiOut[k,r,delta,angMom],r]]

Print[phiOut1[k,r,delta,angMom]]

(* Подставляю данные *)

(*fIn[A1_,angMom_] := phiIn[(kIn/197.327),range,A1,angMom]*)
Clear[fIn]
fIn[aa_,A1_,angMom_] := phiIn[kIn[aa],range,A1,angMom]

Print[fIn[aa,A1,angMom]]

Clear[fOut]

(*fOut[delta_,angMom_] := phiOut[(kOut/197.327),range,delta,angMom]*)

fOut[aa_,delta_,angMom_] := phiOut[kOut[aa],range,delta,angMom]

Print[fOut[aa,delta,angMom]]

(*fIn1[A1_,angMom_] :=phiIn1[(kIn/197.327),range,A1,angMom]*)
Clear[fIn1]
fIn1[A1_,angMom_,q_,r_] := (1/2) A1 q (q*r SphericalBesselJ[-1+angMom,q r]+SphericalBesselJ[angMom,q r]-q r SphericalBesselJ[1+angMom,q r])

Print[fIn1[A1,angMom,(kIn/197.327),3]]

(*fOut1[delta_,angMom_] :=phiOut1[(kOut/197.327),range,delta,angMom]*)
Clear[fOut1]
fOut1[delta_,angMom_,k_,r_] := (1/2) k (k r Cos[delta] SphericalBesselJ[-1+angMom,k r]+Cos[delta] SphericalBesselJ[angMom,k r]-k r Cos[delta] SphericalBesselJ[1+angMom,k r]+k r Sin[delta] SphericalBesselY[-1+angMom,k r]+Sin[delta] SphericalBesselY[angMom,k r]-k r Sin[delta] SphericalBesselY[1+angMom,k r])

Print[fOut1[delta,angMom,(kOut/197.327),3]]

NSolve[{fIn[aa,1]==fOut[dd,1],fIn1[aa,1,(kIn/197.327),range]==fOut1[dd,1,(kOut/197.327),range]},{aa,dd}]

NSolve[{fIn[aa,2]==fOut[dd,2],fIn1[aa,2,(kIn/197.327),range]==fOut1[dd,2,(kOut/197.327),range]},{aa,dd}]

NSolve[{fIn[aa,4]==fOut[dd,4],fIn1[aa,4,(kIn/197.327),range]==fOut1[dd,4,(kOut/197.327),range]},{aa,dd}]

NSolve[{fIn[aa,6]==fOut[dd,6],fIn1[aa,6,(kIn/197.327),range]==fOut1[dd,6,(kOut/197.327),range]},{aa,dd}]