Message Boards Message Boards

Use FindRoot as a loop function?

Posted 8 years ago
FindRoot[{?^2 == g k Tanh[k D], H0^2==H^2 (1+ 2 k D/Sinh[k D]) Tanh[k D]},{k,0.02},{H,6}]

I want to make this a function, which will solve for k and H for a given range of D. Can anyone help?

This is one way:

myLoopFunction[\[Omega]_, g_, D_, H0_] := 
  FindRoot[{\[Omega]^2 == g k Tanh[k D], 
    H0^2 == H^2 (1 + 2 k D/Sinh[k D]) Tanh[k D]}, {k, 0.02}, {H, 6}];
myLoopFunction[1, 1, 1, 1]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract