File:Metodo de Newton.svg
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
![File:Metodo de Newton.svg](https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Metodo_de_Newton.svg/226px-Metodo_de_Newton.svg.png?20160902003206)
Size of this PNG preview of this SVG file: 226 × 234 pixels. Other resolutions: 232 × 240 pixels | 464 × 480 pixels | 742 × 768 pixels | 989 × 1,024 pixels | 1,978 × 2,048 pixels.
Original file (SVG file, nominally 226 × 234 pixels, file size: 21 KB)
File information
Structured data
Captions
Captions
Add a one-line explanation of what this file represents
Summary
[edit]DescriptionMetodo de Newton.svg |
Português: Interpretação geométrica do método de Newton.
English: Geometric interpretation of the Newton's method. |
Date | |
Source | Own work |
Author | Picknick |
Código fonte
[edit]#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Este trabalho está licenciado sob a Licença Creative Commons Atribuição-CompartilhaIgual 3.0 Não Adaptada. Para ver uma cópia desta licença, visite https://creativecommons.org/licenses/by-sa/3.0/ ou envie uma carta para Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
Author: Picknick - 09/2016
Descrição:
Ilustração do método de Newton.
Description:
Illustration of the Newton's method.
'''
import numpy as np
import scipy as sci
from scipy import optimize
import matplotlib.pyplot as plt
#canvas
fig = plt.figure(figsize=(3,3), dpi=300, linewidth=0.0, facecolor="white")
#axes definitions
ax = plt.subplot(1,1,1)
ax.set_xlim(-1,3)
ax.set_ylim(-5,30)
ax.set_xticks([])
ax.set_yticks([])
ax.set_frame_on(False)
ax.arrow(-1, 0, 4, 0, length_includes_head=True, facecolor='black', head_length=0.1, head_width=0.5)
ax.text(2.75,-3.5,r"$x$")
ax.arrow(0, -2, 0, 31, length_includes_head=True, facecolor='black', head_length=0.5, head_width=0.1)
ax.text(-0.25, 26, r"$y$")
def fun(x):
return (x+0.5)**3-1
def dfun(x):
return 3*(x+0.5)**2
a = 0.25
b = 2.5
x = np.linspace (a, b)
ax.plot(x, fun(x), lw=1.25)
def rtan(x,x0):
return dfun(x0)*(x-x0) + fun(x0)
x0=2.15
x = np.linspace(x0-0.9,x0+0.4)
ax.plot(x,rtan(x,x0),color="gray",lw=0.75)
x1 = x0 - fun(x0)/dfun(x0)
x = np.linspace(x1-0.6,x1+0.7)
ax.plot(x,rtan(x,x1),color="gray",lw=0.75)
#dashed lines
#(a, f(a))
a = x0
ax.plot ([0, a], [fun(a), fun(a)], color='gray', linestyle='dashed')
ax.plot ([a, a], [fun(a), 0], color='gray', linestyle='dashed')
ax.plot (a, fun(a), 'ko', markersize=3)
ax.plot ([a, a], [-0.5, 0.5], color='black')
ax.plot ([-0.1, 0.1], [fun(a), fun(a)], color='black')
ax.text (-1, fun(a)-0.1, r"$f(x^{(1)})$")
ax.text (a - 0.25, -3.5, r"$x^{(1)}$")
#dashed lines
#(a, f(a))
a = x1
ax.plot ([0, a], [fun(a), fun(a)], color='gray', linestyle='dashed')
ax.plot ([a, a], [fun(a), 0], color='gray', linestyle='dashed')
ax.plot (a, fun(a), 'ko', markersize=3)
ax.plot ([a, a], [-0.5, 0.5], color='black')
ax.plot ([-0.1, 0.1], [fun(a), fun(a)], color='black')
ax.text (-1, fun(a)-0.1, r"$f(x^{(2)})$")
ax.text (a - 0.25, -3.5, r"$x^{(2)}$")
#dashed lines
#(a, f(a))
a = x1 - fun(x1)/dfun(x1)
ax.plot ([a, a], [-0.5, 0.5], color='black')
ax.text (a - 0.25, -3.5, r"$x^{(3)}$")
xstar = sci.optimize.fsolve(fun,a)
ax.plot ([xstar, xstar], [0, 0], 'ro', markersize=3)
ax.text (xstar - 0.25, 0.5, r"$x\!^{*}$")
fig_file = "metodo_de_Newton"
fig.savefig(fig_file+".svg", bbox_inches='tight')
Licensing
[edit]I, the copyright holder of this work, hereby publish it under the following license:
![w:en:Creative Commons](https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/CC_some_rights_reserved.svg/90px-CC_some_rights_reserved.svg.png)
![attribution](https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Cc-by_new_white.svg/24px-Cc-by_new_white.svg.png)
![share alike](https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Cc-sa_white.svg/24px-Cc-sa_white.svg.png)
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 00:32, 2 September 2016 | ![]() | 226 × 234 (21 KB) | Picknick (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
The following page uses this file:
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 181pt |
---|---|
Height | 187pt |
Hidden categories: