Documente Academic
Documente Profesional
Documente Cultură
Informes:
Scribe: @jmarquezc
Contenido:
Derivando e integrando en Mathematica Usando los puntos crticos de una funcin para graficarla Slidos de revolucin Graficando funciones y ecuaciones en tres dimensiones Potenciales Electrostticos en dos y tres dimensiones
Out[2]=
Out[3]=
El comando D[ ] asume que todas las letras que no correspondan a la variable de derivacin representan constantes, como en una derivada parcial
In[4]:=
Out[4]=
En cambio, el comando Dt asume que todas las letras son funciones de la variable de derivacin, como en una derivada total
In[5]:=
Out[5]=
Out[6]=
Out[7]=
El
nmero
resultado
del clculo
anterior
es
el
rea
bajo
la
curva
desde
1.5
hasta
3.5
Podemos ver dibujada esta rea usando el comando FilledPlot Primero es necesario cargar la libreria con el comando FilledPlot
In[8]:=
Aqu graficamos la funcin junto con el rea bajo la curva. El dibujo se guarda con el nombre "fp"
In[10]:=
Out[10]=
Out[12]=
ES MUY IMPORTANTE QUE COPIES EXACTAMENTE, INCLUYENDO EL GUION LARGO _ SOLO EN EL LADO IZQUIERDO DEL PRIMER COMANDO ASI COMO LOS DOS PUNTOS Y EL PUNTO Y COMA EN SU LUGAR:
In[2]:=
Out[3]=
lo que hicimos en el primer rengln fue definir la funcin "f", mientras que en el segundo rengln el comando plot sirve para graficarla. Nota que se especific que se graficara en el dominio de 0 a 10 dentro del comando plot.
Out[4]=
este resultado a quedado guardado en la memoria de la computadora bajo el nombre "derivada". Nota que la definicin de la funcin est en memoria bajo el nombre "f" y por eso pudimos utilizarla en el comando D[ ]. Ahora vamos a averiguar los valores de "x" para los cuales la derivada es cero mediante el comando Solve[ ]. ES IMPORTANTE USAR EN ESTE COMANDO DOS SIGNOS DE IGUAL "==".
In[5]:=
Out[5]=
Out[6]=
Podemos notar que la funcin tiene ms estructura de la que se veia en el inciso anterior. Sin embargo, esta grfica an se puede mejorar, como se muestra en el siguiente inciso.
Out[7]=
En esta grfica ya se alcanza a observar que el valor crtico -1 corresponde a un mnimo local de la funcin, mientras que el valor crtico 61 corresponde a un mximo local. Tambin observa que Mathematica grafic una lnea casi vertical en x=30. Esta lnea es incorrecta, ya que no forma parte de la funcin, porque la funcin tiene una asntota vertical en x=30 (revisa la definicin de la funcin en el primer inciso). Observa que Mathematica decidi que el eje "Y" debe ir de -400 a 400. Quizs se obtenga una grfica que resalte ms la forma de la funcin si graficamos en un rango ms pequeo, por ejemplo, le podemos indicar a Mathematica que grafique con un rango en "Y" desde -250 a 100 mediante la opcin PlotRange adentro del comando Plot:
In[8]:=
Out[8]=
Out[11]=
Como observaste obtuvimos tres grficas, las cuales son dibujo1, dibujo2 y por ltimo las dos juntas.
Ejercicio
Para que valores de x tiene asntotas verticales la funcin? (Es decir, para que valores de x se vuelve cero el denominador de la fraccin) Encuentra la derivada de de la la funcin con funcin respecto a x. Para qu valores de x se vuelve cero curvatura, la derivada? etc.) Realiza una grfica de la funcin. Escoge el dominio (valores en x) y el rango (valores en y) para que la grfica muestre claramente todas las caractersticas (asntotas, mximos, mnimos, Realiza una grfica como la anterior pero que las asntotas no sean dibujadas.
Slidos de revolucin
Primero nos aseguramos que los nombres "x" y "u" no contiene ningn valor
In[1]:=
Out[3]=
Primero cargamos la librera de Mathematica con los comandos para dibujar superficies de revolucin:
In[4]:=
Esta es la superficie generada cuando hacemos girar la funcin alrededor del eje y:
In[6]:=
Out[6]=
Esta es la superficie generada cuando hacemos girar la funcin alrededor del eje x:
In[7]:=
Out[7]=
Out[8]=
Out[9]=
Esta es la pieza de ajedrez generada cuando la funcin gira alrededor del eje "x":
In[10]:=
Out[10]=
Supn que necesitamos conocer la cantidad de material necesaria para construir la pieza de ajedrez. Esa cantidad de material es el volumen, que se puede calcular con las siguientes integrales (revisa "slidos de revolucin" en tu libro de clculo):
In[11]:=
Out[11]=
Si todas las unidades de la pieza de ajedrez estn en centmetros, entonces el volumen calculado est en centmetros cbicos.
In[2]:=
Out[2]=
Otra forma de visualizar la funcin es obtener el diagrama de contorno, que es como un mapa topogrfico, lo ms obscuro est ms abajo:
In[3]:=
Out[3]=
In[6]:=
Out[6]=
Out[7]=
Out[8]=
Here (x,y) are the plane coordinates in meters, is the linear density of charge in Coulomb/meter and
Out[3]=
We will plot the potential for -0.05<x<0.05 and -0.05<y<0.05 meters. The surface is constant inside the wire, and a decreasing function outside:
In[4]:=
Out[4]=
A level curve of a function is made of points with the same value of the function. A plot with several level curves for different values is called a contour plot, and it is like a topographic map of the surface. In Physics, the level lines of an electric potential are called "equipotential lines". Notice that the plot is stored in the variable cp1:
In[5]:=
Out[5]=
This vector is a function of x and y,and in each point (x,y) it points toward the direction of maximum increase of the function.In Physics,the electric field E is a vector given by:
and it gives the force that a charge of 1 coulomb would experience in each point (x,y). The next command stores the plot of the gradient of our potential in the variable pg1:
In[6]:=
Out[8]=
Now we show together the level curves and the gradient field. Notice that the gradient arrows point in the direction of higher increase of the function, and they are perpendicular to the level curves.
In[9]:=
Out[9]=
They are at a distance of 0.10 meters from each other. We will plot the electric potential, the equipotential curves and the electric field in a plane perpendicular to the wires (some equipotential curves in the perpendicular plane are shown)
We define the potential using the function v[x,y] of the previous exercise. Notice that the positive wire intersects the plane at (0.05,0) and the negative wire intersects the plane at (-0.05,0):
In[10]:=
Out[10]=
Out[11]=
In this exercise, the level curves (or equipotential curves) are circles with different center and different radius:
In[12]:=
Out[12]=
The gradient arrows make "lines of force" which go from one wire to the other.
In[13]:=
Out[15]=
The gradient vector is always perpendicular to the level curve, and it points in the direction of higher increase of the function:
In[16]:=
Out[16]=
and they are separated 0.08 meters from each other. This configuration is called "electric dipole":
Out[19]=
Out[20]=
A level SURFACE of a function is made of points with the same value of the function. A plot with several level surfaces for different values is called a contour plot. In Physics, the contour surfaces of an electric potential are called "equipotential surfaces":
In[21]:=
Out[23]=
Out[24]=
This vector is a function of x, y, and z, and in each point (x,y,z) it points toward the direction of maximum increase of the function. In Physics, the electric field E is a vector given by:
and it gives the force that a charge of 1 coulomb would experience in each point (x,y,z). In the next graph you can see a plot of the gradient of the potential v2p. Can you see the arrows leaving one charge and pointing to the other?:
In[25]:=
Out[27]=
In the next array of graphics, the first column corresponds to the function of two variables and the second column to the function of three variables. Notice that we cannot plot the 4D hypersurface corresponding to the function of three variables.
In[28]:=
Out[29]=
and
two
positive
at
(0,
0.05)
and
(0,
-0.05)
Then make the Plot3D, ContourPlot and PlotGradientField plots of this potential.
Exercise (Spheres)
Create two and a new negative two function v4p[x,y,z] at positive for at the (0.05, 0, 0) potential (0, 0, 0.05) of and four and spheres ( of charge: -0.05, 0, 0) (0, 0, -0.05).