Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Jupyter notebook La parábola.ipynb

245 views
Kernel: Python 3

##LA PARÁBOLA A continuación presentamos un ejemplo de la modelación gráfica para la resignificación de la parábola para plantear la problematica asociada a la variedad de usos de la graficación u sus implicaciones en la construcción de conocimiento matemático.

##Modelación Gráfica: Un ejemplo de resignificación de la parábola

La parábola es uno de los contenidos comunes en el discurso matemático. El énfasis con que se estudia depende la asignatura en la que aparece. Por ejemplo en la geometría analítica se destacan las relaciones entre los parámetros de la ecuación en sus formas ordinarias y las característica de las curva.

Esta orientación del sistema educativo ancla los significados,los procedimientos y los argumentos a los conceptos matemáticos de tal forma que no ofrece al estudiante elementos para resignificar la parábola. la resignificación será la que propicie que el conocimiento sobre la parábola se constituya en una herramienta para resolver preguntas en otros momentos de su vida,dentro y fuera de la escuela, y en oros contextos, y con profesores de matemática se ha observado que recurren a trazos rectos para una primera representación gráfica de los cambios de posición .

*La Graficación como una categoría que articula la modelación y la tecnología *

El potencial de la graficación puede ir más allá si se le considera en sí misma una modelación. Las características que deberían cumplir son:

  • 1.) Las gráficas se obtienen a partir de una simulación que lleva a cabo múltiples realizaciones y hace ajustes en el movimiento para producir un resultado deseable en la gráfica.

  • 2.) Tiene un carácter dinámico que permite crear modelos gráficos que se convierten en argumentos para nuevas descripciones de movimiento.

  • 3.) Propicia la búsqueda de explicaciones y enfatiza los comportamientos invariantes en las situaciones.

Uno de los propositos de esta investigación es aportar las evidencias de que la práctica de la graficación soporta el desarollo del razonamiento y de la argumentación

Desde la perspectiva de investigación que busca la intervención del sistema didáctico,se buscan categorías de conocimiento. La graficación se estudiará como categoría que sirva de vehículo para implementar el trinomio modelación-graficación-tecnología en la construcción de conocimiento matemático en el salón de clases. Este proyecto de investigación tiene como objetivo la constitución de la epistemología subyacente en las actividades de modelación gráfica y la construcción de diseños de situaciones apoyados en esta epistemología. La finalidad será explicar el papel de la práctica de la graficación en la resignificación del conocimiento. matemático.

%matplotlib inline import matplotlib as plt import numpy as np
from IPython.html.widgets import interact, interactive, fixed from IPython.html import widgets from IPython.display import clear_output, display, HTML
/usr/local/lib/python3.4/dist-packages/IPython/html.py:14: ShimWarning: The `IPython.html` package has been deprecated. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`. "`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)
import numpy as np import matplotlib.pyplot as plt from IPython.html import widgets from IPython.html.widgets import interact from IPython.display import display
#This function plot x, y and adds a title def plt_arrays(x, y, title="", color="red", linestyle="dashed", linewidth=2): fig = plt.figure() axes = fig.add_subplot(111) axes.plot(x,y, color=color, linestyle=linestyle, linewidth=linewidth) axes.set_title(title) axes.grid() plt.show()

We will define a function that return the following:

f(x)=ax3+bx2+cx+df(x)=ax^{3}+bx^{2}+cx+d

where a,b,c and d are are constants.

def f(a, b, c, d, **kwargs): x=np.linspace(-10, 10, 20) y = a*(x**3) + b*(x**2) + c*x + d title="$f(x) = (%s)x^{3} + (%s)x^{2} + (%s)x + (%s)$" % (a,b,c,d) plt_arrays(x,y, title=title, **kwargs)
#Define Constants a=0.25 b=2 c=-4 d=0 f(a, b, c, d)
Image in a Jupyter notebook
i = interact(f, a=(-10.,10.), b=(-10.,10), c=(-10.,10), d=(-10.,10), color = ["red", "blue", "green","orange","gray"], linestyle=["solid", "dashed"," dotted", "dash-dot"], linewidth=(1,5)
File "<ipython-input-7-be06ebddbf24>", line 9 ^ SyntaxError: unexpected EOF while parsing

#Tutorial Nature cacheme.org Interactive illustration of aliasing

Notebooks can also link code and data to user interfaces (such as sliders, checkboxes, dropdowns) that facilitate interactive exploration.

Aron Ahmadia (Coastal & Hydraulics Laboratory at the US Army Engineer Research and Development Center) and David Ketcheson (King Abdullah University of Science & Technology) created the following example to illustrate the perils of aliasing, which occurs when a rapidly-changing periodic signal is sampled too infrequently, and creates a false impression of the true frequency of the signal.

Ketcheson explains:

"As an undergraduate, I did some observational astronomy looking at variable stars. These are stars whose brightness oscillates, usually on a fairly regular basis. Many published results claim to measure how quickly the star's brightness oscillates - but actually report the oscillations at some multiple of the real answer, owing to insufficient observation and (as a result) aliasing."

This example shows how trying to reconstruct a simple sine wave signal from discrete measurements can fail. The sliders allow you to adjust the frequency of the underlying periodic sine wave signal (represented by frequency), and also how often the signal is sampled (represented by grid_points). Get it wrong, and a high-frequency sine wave is measured as a lower-frequency signal.

To see the effects of aliasing:

Run the next cell, then set the grid_points slider to 13. Move the frequency slider to values above 10. As the frequency increases, the measured signal (blue) has a lower frequency than the real one (red).
# Import matplotlib (plotting) and numpy (numerical arrays). # This enables their use in the Notebook. %matplotlib inline import matplotlib.pyplot as plt import numpy as np # Create an array of 30 values for x equally spaced from 0 to 5. x = np.linspace(-3, 5, 300) y = x**3-12*x ax.axis([x[0] - 0.5, x[-1] + 0.5, x[0] - 0.5, x[-1] + 0.5]) ax.spines['left'].set_position('center') ax.spines['right'].set_color('none') ax.spines['bottom'].set_position('center') ax.spines['top'].set_color('none') ax.spines['left'] ax.spines['bottom'].set_smart_bounds(True) ax.xaxis.set_ticks_position('bottom') ax.yaxis.set_ticks_position('left')# Plot y versus x fig, ax = plt.subplots(nrows=1, ncols=1) plt.grid() ax.plot(x, y, color='red') ax.set_xlabel('x') ax.set_ylabel('y') ax.set_title('A simple graph of $y=x^3-12x$');
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-8-b53a6acfbe4d> in <module>() 9 y = x**3-12*x 10 ---> 11 ax.axis([x[0] - 0.5, x[-1] + 0.5, x[0] - 0.5, x[-1] + 0.5]) 12 ax.spines['left'].set_position('center') 13 ax.spines['right'].set_color('none') NameError: name 'ax' is not defined

Above, you should see a plot of y=x2.

You can edit this code and re-run it. For example, try replacing y = x**2 with y=np.sin(x). For a list of valid functions, see the NumPy Reference Manual. You can also update the plot title and axis labels.

Text in the plot as well as narrative text in the notebook can contain equations that are formatted using LATEX. To edit text written in LATEX, double click on the text or press ENTER when the text is selected.

# Import matplotlib (plotting) and numpy (numerical arrays). # This enables their use in the Notebook. %matplotlib inline import matplotlib.pyplot as plt import numpy as np # Import IPython's interact function which is used below to # build the interactive widgets from IPython.html.widgets import interact def plot_sine(frequency=4.0, grid_points=12, plot_original=True): """ Plot discrete samples of a sine wave on the interval ``[0, 1]``. """ x = np.linspace(0, 1, grid_points + 2) y = np.sin(2 * frequency * np.pi * x) xf = np.linspace(0, 1, 1000) yf = np.sin(2 * frequency * np.pi * xf) fig, ax = plt.subplots(figsize=(8, 6)) ax.set_xlabel('x') ax.set_ylabel('signal') ax.set_title('Aliasing in discretely sampled periodic signal') if plot_original: ax.plot(xf, yf, color='red', linestyle='solid', linewidth=2) ax.plot(x, y, marker='o', linewidth=2) # ion automatically builds a user interface for exploring the # plot_sine function. interact(plot_sine, frequency=(1.0, 22.0, 0.5), grid_points=(10, 16, 1), plot_original=True);
def pinta_funcion(freq): x=np.linspace(0,3,num=5000) plt.ylim(-5,5) y=x*np.sin(freq*x) plt.grid(True) plt.plot(x,y,color='r')
pinta_funcion(2*np.pi*1.0)
from IPython.html.widgets import *
IntSlider()
from IPython.display import display w = IntSlider() display(w)
display(w)
w.close()
w = IntSlider() display(w)
w.value
w.value = 100
w.keys
Text(value='Hello World!', disabled=True)
from traitlets import link a = FloatText() b = FloatSlider() c = FloatProgress() display(a,b,c) mylink = link((a, 'value'), (b, 'value'), (c, 'value'))
mylink.unlink()
from IPython.html.widgets import interact, interactive, fixed from IPython.display import display