Recent content by rewmck

  1. R

    Matlab: Finding a quicker method than simple iteration

    Hi Theo, solving for lambda and you're right the equation is wrong, it should be: \lambda = \frac{g \cdot T^2}{2\, \pi} \cdot \tanh\left(\frac{2\, \pi \, h}{\lambda}\right) Sorry about that. So I solve for lambda over a range of T values. I discovered that the fzero function which...
  2. R

    Matlab: Finding a quicker method than simple iteration

    Thanks for the push in the right direction. Matlab has a built in function fzero which gets the roots. Iteration is quicker for 99% of my calculations but the final 1% is much faster with fzero so I have found the point where it becomes beneficial to use fzero and put an if in my function. So...
  3. R

    Matlab: Finding a quicker method than simple iteration

    Homework Statement I am trying to speed up a function in MATLAB that solves the equation by simple iteration: λ= \frac{gT^{2}\frac{\text{tanh}(2\pi h)}{λ}}{2\pi} Where λ is wavelength, h is wave height, T is period and g=9.81. Also here where it's a bit easier to read. Homework Equations...
Back
Top