Skip to content
Snippets Groups Projects
Commit acd13504 authored by tomrink's avatar tomrink
Browse files

add 3pt quadratic minimization function

parent 0d767268
No related branches found
No related tags found
No related merge requests found
......@@ -108,4 +108,11 @@ def pressure_to_altitude(pres, temp, prof_pres, prof_temp, sfc_pres, sfc_temp, s
z = thickness_hydrostatic(prof_pres, prof_temp) + sfc_elev
return z
\ No newline at end of file
return z
# http://fourier.eng.hmc.edu/e176/lectures/NM/node25.html
def minimize_quadratic(xa, xb, xc, ya, yb, yc):
x_min = xb + 0.5*(((ya-yb)*(xc-xb)*(xc-xb) - (yc-yb)*(xb-xa)(xb-xa)) /
((ya-yb)*(xc-xb) + (yc-yb)*(xb-xa)))
return x_min
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment