Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. f45[{x_, y_}] := {x + 1, y^2 + 1};
  2. NestWhileList[f45, {0.1, 0.1}, "here I dont know"]
  3.  
  4. NestWhileList[f45, {0.1, 0.1}, Norm[Last[f45]]] < 1]
  5.  
  6. condition[vector_] := Norm[vector] < 10
  7.  
  8. f45[{x_, y_}] := {x + 1, y^2 + 1};
  9. NestWhileList[f45, {0.1, 0.1}, condition]
  10.  
  11. (*
  12. ==> {{0.1, 0.1}, {1.1, 1.01}, {2.1, 2.0201}, {3.1, 5.0808}, {4.1,
  13. 26.8146}}
  14. *)
  15.  
  16. f45[{x_, y_}] := {x + 1, y^2 + 1}
  17. With[{max = 2}, NestWhileList[f45, {0.1, 0.1}, Norm[#] < max &]]
  18.  
  19. f46[x_, y_] := {x + 1, y^2 + 1}
  20. With[{max = 2}, NestWhileList[f46[#[[1]], #[[2]]] &, {0.1, 0.1}, Norm[#] < max &]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement