Skip to content

Instantly share code, notes, and snippets.

@tenomoto
Created July 12, 2016 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenomoto/f2a932cdc417dd3cab6334cce7d4e320 to your computer and use it in GitHub Desktop.
Save tenomoto/f2a932cdc417dd3cab6334cce7d4e320 to your computer and use it in GitHub Desktop.
Calculate the most developing wave number in the Eady problem
#!/usr/bin/env octave -qf
function y = f(x)
# the maximum of kci = sqrt((mu/2 - tanh mu/2)(mu/2 - cot mu/2)) is found by
# finding the zero of the derivative of the inside of sqrt.
y = x - (tanh(0.5*x) + coth(0.5*x)) - 0.5 * x * (1/(cosh(0.5*x))^2 - 1/(sinh(0.5*x))^2);
endfunction
format long
fsolve("f", 3.2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment