Advertisement
Guest User

Untitled

a guest
May 28th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. f[θ_, r_, x_, h_] =
  2. 1/2 x (r^2 ArcCos[(r - x Cot[θ])/r] + (x Cot[θ] - r) Sqrt[
  3. x Cot[θ] (2 r - x Cot[θ])]) - π r^2 h;
  4.  
  5. root[θ_?NumericQ, r_?NumericQ, h_?NumericQ] :=
  6. x /. FindRoot[f[θ, r, x, h], {x, 2}]
  7.  
  8. FindRoot[root[θ, 3.7, 2.6] - 10.7, {θ, 1}]
  9.  
  10. (* {θ -> 1.24469} *)
  11.  
  12. root[θ /. %, 3.7, 2.6] - 10.7
  13.  
  14. (* 3.55271*10^-15 *)
  15.  
  16. FindRoot[root[θ, 4, 2.2] - 10.7, {θ, 1}]
  17.  
  18. (* {θ -> 1.25971} *)
  19.  
  20. root[θ /. %, 4, 2.2] - 10.7
  21.  
  22. (* -3.55271*10^-15 *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement