Sqrt fix (still not working)

This commit is contained in:
Nuwan Yapa 2025-04-25 18:38:43 -04:00
parent 1f209d2e8e
commit efe19783b2
1 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ target_c = range(0.78, 0.45, 7) # original: range(0.75, 0.40, 8)
target_E = [quick_pole_E(V_system(c)) for c in target_c] target_E = [quick_pole_E(V_system(c)) for c in target_c]
# Solve coefficients as a linear system # Solve coefficients as a linear system
M_left_element(c, i) = complex(c - c0)^(i/2) M_left_element(c, i) = alt_sqrt(c - c0)^i
M_left = M_left_element.(training_c, (0:order)') M_left = M_left_element.(training_c, (0:order)')
a = zeros(ComplexF64, dim, order+1) a = zeros(ComplexF64, dim, order+1)
b = zeros(ComplexF64, dim, order+1) b = zeros(ComplexF64, dim, order+1)
@ -58,7 +58,7 @@ for i in 1:dim
end end
# Pade approximant # Pade approximant
polynomial(a, c) = sum(i -> a[:, i+1] .* complex(c - c0)^(i/2), 0:order) polynomial(a, c) = sum(i -> a[:, i+1] .* alt_sqrt(c - c0)^i, 0:order)
pade_approx(c) = polynomial(a, c) ./ polynomial(b, c) pade_approx(c) = polynomial(a, c) ./ polynomial(b, c)
# Extrapolate # Extrapolate