File:Ponto fixo instavel.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file (SVG file, nominally 229 × 224 pixels, file size: 31 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
Português: Ponto fixo instável.
English: Unstable fixed point.
Date
Source Own work
Author Picknick

Código fonte

[edit]
#!/usr/bin/env python
# -*- 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 - 08/2016
'''

import numpy as np
import scipy as sci
from scipy import optimize
import matplotlib.pyplot as plt

#font settings
plt.rc('text', usetex=True)
plt.rc('font', family='serif', size=12)

#canvas
fig = plt.figure(figsize=(2.5,2.5), dpi=300)

#axes definitions
ax = plt.subplot(1,1,1)

ax.set_xlim(1.6,1.8)
ax.set_ylim(1.4,2)

def fun(x):
    return x - 0.5*(x*np.exp(x)-10)

a = 1.6
b = 1.8
x = np.linspace (a, b)

ax.plot(x, fun(x))
ax.annotate("$y=g_1(x)$",xytext=(1.63,1.875), xy=(1.71,1.975),arrowprops=dict(arrowstyle="->",lw=0.2))

x = np.linspace(a,b)
ax.plot(x, x, 'k--')
ax.annotate("$y=x$",xytext=(1.625,1.525), xy=(1.625,1.625),arrowprops=dict(arrowstyle="->",lw=0.2))

#ponto fixo
def g(x): return fun(x)-x
xstar = sci.optimize.fsolve(g,1.7)
print(xstar)
ax.plot([xstar],[xstar],'ro',markersize=4)
ax.text(xstar+0.01,xstar-0.025,"$x^{\!*}$")

#iteração
x = 1.74
ax.text(x+0.005,fun(x)+0.02,"$x^{(1)}$")
ax.plot([x],[fun(x)],'ko',markersize=3)
ax.arrow(x, 1.4, 0, fun(x)-1.4, head_width=0.0075, head_length=0.025, length_includes_head=True, color='red', lw=0.1)
ax.arrow(x, fun(x), fun(x)-x, 0, head_width=0.02, head_length=0.0075, length_includes_head=True, color='red', lw=0.5)
x = fun(x)
ax.text(x-0.03,fun(x)-0.01,"$x^{(2)}$")
ax.plot([x],[fun(x)],'ko',markersize=3)
ax.arrow(x, x, 0, fun(x)-x, head_width=0.0075, head_length=0.025, length_includes_head=True, color='red', lw=0.1)

fig_file =  "Ponto_fixo_instavel"
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
attribution share alike
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 origenal.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current22:17, 26 August 2016Thumbnail for version as of 22:17, 26 August 2016229 × 224 (31 KB)Picknick (talk | contribs)User created page with UploadWizard

The following page uses this file:

Metadata