adds general find_gap function for arbitrary mu_star
All checks were successful
gitea-physics/pysuperconductor/pipeline/head This commit looks good
All checks were successful
gitea-physics/pysuperconductor/pipeline/head This commit looks good
This commit is contained in:
parent
8455e4f982
commit
aea431cd2d
@ -24,9 +24,13 @@ def gap_integral(temp, delta, mu_star, debye_frequency):
|
||||
|
||||
|
||||
def equilibrium_gap(temp, debye_frequency, nv):
|
||||
return find_gap(temp, 0, debye_frequency, nv)
|
||||
|
||||
|
||||
def find_gap(temp, mu_star, debye_frequency, nv):
|
||||
nv_inv = 1 / nv
|
||||
sol = scipy.optimize.root(
|
||||
lambda d: gap_integral(temp, d, 0, debye_frequency) - nv_inv,
|
||||
lambda d: gap_integral(temp, d, mu_star, debye_frequency) - nv_inv,
|
||||
x0=debye_frequency / (numpy.sinh(nv_inv))
|
||||
)
|
||||
logging.info(sol)
|
||||
|
@ -37,3 +37,12 @@ def test_equilibrium_gap_zero_temp():
|
||||
decimal=7, err_msg='gap finding at zero temp equilibrium is wrong',
|
||||
verbose=True
|
||||
)
|
||||
|
||||
|
||||
def test_gap():
|
||||
actual = pysuperconductor.os_gap_calc.find_gap(.5, .1, 100, .2)
|
||||
numpy.testing.assert_almost_equal(
|
||||
actual, 1.108996409216592,
|
||||
decimal=7, err_msg='had trouble with gap at non-zero temp and mustar',
|
||||
verbose=True
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user