SHARE
TWEET

Punto3

cardel Jul 29th, 2018 (edited) 112 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //// Ecuacion 1
  2. function f=u(x,y,z)
  3.  f = 3*x-cos(y*z)-1/2;
  4. endfunction
  5. //// Ecuacion 2
  6. function f=v(x,y,z)
  7.  f = x^2-81*(y+0.1)^2+sin(z)+1.06;
  8. endfunction
  9. //// Ecuacion 3
  10. function f=w(x,y,z)
  11. f = exp(-x*y)+20*z+(10*%pi-3)/3;
  12. endfunction
  13. //
  14. //// Resultados
  15. x0 = [1.5;1.5; 1.5];
  16. [x,f,ea,iter]=NewtonRaphson2(u, v, w, x0, 0.0001, 50)
  17.  
  18.  iter  =
  19.  
  20.    12.
  21.  
  22.  ea  =
  23.  
  24.    1.026D-09
  25.  
  26.  f  =
  27.  
  28.    0.
  29.    5.134D-11
  30.   -9.059D-13
  31.  
  32.  x  =
  33.  
  34.    0.5
  35.   -3.176D-12
  36.   -0.5235988
  37.  
  38. x0 = [5; 2; 1];
  39. [x,f,ea,iter]=NewtonRaphson2(u, v, w, x0, 0.0001, 30)
  40.  
  41.  iter  =
  42.  
  43.    9.
  44.  
  45.  ea  =
  46.  
  47.    6.170D-09
  48.  
  49.  f  =
  50.  
  51.   -5.107D-14
  52.   -1.865D-10
  53.   -6.400D-10
  54.  
  55.  x  =
  56.  
  57.    0.5
  58.    9.811D-12
  59.   -0.5235988
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top