//  [python]
def fluid_sphere(f,Radius, Range, Rho_w,Rho_b,Theta,c_w,c_b):
    #compute wavelength and wave number in the external fluid
    K_ext = k(c_w,f) # wave number
    
    #compute wavenumber inside the scattering body
    K_int = k(c_b, f)
    
    #set convergence parameters
    ConvLim = 1e-10
    MaxCount = 200
    
    #wavenumbers
    kr = K_ext * Range #wavenumber at range
    ka = K_ext * Radius #wvenumber radius
    kdasha = K_int * Radius #wavenumber radius inside
    
    #density and soundspeed contrasts
    g = Rho_b / Rho_w #density contrast
    h = c_b / c_w #sound velocity contrast
    rho_c = Rho_w * c_w 
    
    #check for convergence and set starting parameters
    Done = False
    Count = 0
    m = 0
    while Done == False:
        # build vector of theta angles and ranges inside/outside of sphere
        #Theta = np.arange(0.0,np.pi,np.pi/180)
        CosTheta = np.cos(Theta)
        #Ext_Range = np.arange(1.5 * Radius, Radius, -0.5 * Radius / 20)
        #Int_Range = np.arange(Radius,0,-Radius/40)
            
        ###compute spherical bessel fucntions with ka, k'a, kr, k'r
        ###use functions from scipy.special
        
        #Bessel functions first degree
        Jm_kr = ss.spherical_jn(m, kr)
        Jm_ka = ss.spherical_jn(m, ka)
        Jm_kdasha = ss.spherical_jn(m, kdasha)
        
        #bessel functions second degree
        Nm_Kr = ss.spherical_yn(m, kr)
        Nm_Ka = ss.spherical_yn(m, ka)
        
        #First degree derivate bessel functions
        Alpham_kdasha = (2 * m + 1) * ss.spherical_jn(m, kdasha, derivative=True)
        Alpham_ka = (2 * m + 1) * ss.spherical_jn(m, ka, derivative=True)
        Alpham_kr = (2 * m + 1) * ss.spherical_jn(m, kr, derivative=True)
        
        #Second degree derivate bessel functions
        Betam_ka = (2 * m + 1) * ss.spherical_yn(m, ka, derivative=True)
        Betam_kr = (2 * m + 1) * ss.spherical_yn(m, kr, derivative=True)
        
        
        # Compute Legendre Polynom, dependent on Theta
        Pm = legendreP(m, CosTheta)
        
        # Calculate Cm for the current m value - independant of theta
        Cm = (( Alpham_kdasha / Alpham_ka) * (Nm_Ka / Jm_kdasha) - \
              (Betam_ka / Alpham_ka) * g * h) / ((Alpham_kdasha / Alpham_ka) * \
              (Jm_ka / Jm_kdasha) - g * h)
        
        # Use Cm coefficient to calculate Am explcitely and then Bm from this
        Am = -( (-1j)**m) * (2 * m + 1) / (1 + 1j * Cm)
           
        # Now use Cm to calculate current 'm' value scattered pressure contribution
        ThisPs = -(((-1j)**m) * (2 * m + 1) / (1 + 1j * Cm)) * Pm * \
                   (Jm_kr + 1j * Nm_Kr)
        ThisPi = ((-1j)**m) * (2 * m + 1) * Pm * Jm_kr
        ThisTS = ((-1)**m) * (2 * m + 1) / (1 + 1j * Cm)
        
        # exterior domain particle velocity
        ThisVel = (-1j / rho_c) * (Am / (2 * m + 1)) * Pm * (Alpham_kr +\
                  1j * Betam_kr)
        ThisVel_Inc = (-1j / rho_c) * ((-1j)**m) * Pm * Alpham_kr
        if m == 0:
            Ps = ThisPs
            Pi = ThisPi
            TS = ThisTS
            Vel = ThisVel
            Vel_Inc = ThisVel_Inc
        else:
            Ps = Ps + ThisPs
            Pi = Pi + ThisPi
            TS = TS + ThisTS
            Vel = Vel + ThisVel
            Vel_Inc = Vel_Inc + ThisVel_Inc
        m += 1
        Count += 1
        if max(abs(ThisPs)) < ConvLim and m > 10:
              Done = True;
        elif Count > MaxCount:
              Done = True
              print('Convergence failure in FluidSphereScat')
        
        IsBad = np.isnan(Ps)
        Ps[IsBad] = 0
        
    #Calculate final TS after summation is complete
    TS = (2 / ka)**2 * abs(TS)**2 * (np.pi * Radius * Radius)
    TS = 10 * np.log10(TS / ( 4 * np.pi))
    
    #print('Backscatter TS of the sphere is %.2f dB re 1m^2'%TS)
    return(TS)