(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 31623, 958]*) (*NotebookOutlinePosition[ 32972, 1000]*) (* CellTagsIndexPosition[ 32928, 996]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Ecuaciones diferenciales ordinarias", "Section", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[CellGroupData[{ Cell[TextData[StyleBox["Soluciones exactas con DSolve", FontFamily->"Times New Roman"]], "Subsection", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[CellGroupData[{ Cell["Resumen de comandos", "Subsubsection"], Cell[TextData[{ StyleBox["DSolve[edo==0,y,x] ", FontWeight->"Bold"], " da la soluci\[OAcute]n general de una EDO en t\[EAcute]rminos de la funci\ \[OAcute]n ", StyleBox["y[x]", FontWeight->"Bold"], ".", StyleBox["\n\nDSolve[{edo==0,condinic},y,x] ", FontWeight->"Bold"], " resuelve una EDO en t\[EAcute]rminos de la funci\[OAcute]n ", StyleBox["y[x] ", FontWeight->"Bold"], "con condiciones iniciales ", StyleBox["condinic", FontWeight->"Bold"], ".\n\n", StyleBox["DSolve[{edo1==0,edo2==0,...},{y1,y2,...},x] ", FontWeight->"Bold"], " resuelve un sistema de EDOs en t\[EAcute]rminos de las funciones ", StyleBox["y1[x], y2[x]", FontWeight->"Bold"], ", etc.\n\n", StyleBox["DSolve[edp==0,y,{x1,x2,...}] ", FontWeight->"Bold"], " resuelve una EDP (ecuaci\[OAcute]n en derivadas parciales) en \ t\[EAcute]rminos de la funci\[OAcute]n ", StyleBox["y[x1,x2,...]", FontWeight->"Bold"], ".\n\nel paquete ", StyleBox["<"Bold"], "proporciona \"integrales completas\" para EDPs mediante el comando:", StyleBox["\nCompleteIntegral[edp==0,y,{x1,x2,...}] ", FontWeight->"Bold"] }], "Text"], Cell[TextData[{ StyleBox["El comando", FontFamily->"Times New Roman"], StyleBox[" ", FontFamily->"Courier"], StyleBox["DSolve", FontFamily->"Courier", FontWeight->"Bold"], " encuentra soluciones anal\[IAcute]ticas (no num\[EAcute]ricas) para un n\ \[UAcute]mero cada vez mayor de ecuaciones diferenciales. Por ejemplo:\n\ \[FilledSmallSquare] ", StyleBox["DSolve", "MR"], " resuelve EDOs lineales con coeficientes constantes de cualquier orden y \ muchas ecuaciones lineales de hasta segundo orden con coeficientes no \ constantes.\n\[FilledSmallSquare] ", StyleBox["DSolve", "MR"], " incluye procedimientos generales para EDOs no lineales cuyas soluciones \ vienen tratadas en libros de texto y manuales.\n\[FilledSmallSquare] ", StyleBox["DSolve", "MR"], " puede encontrar soluciones generales para ecuaciones en derivadas \ parciales lineales (y \"d\[EAcute]bilmente no lineales\"). T\[EAcute]ngase en \ cuenta que las ecuaciones diferenciales en derivadas parciales no lineales no \ presentan usualmente una soluci\[OAcute]n general expl\[IAcute]cita \ (\[EAcute]ste es un campo de investigaci\[OAcute]n importante donde es \ necesario avanzar)" }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Ejemplos de EDOs de orden 1. Isoclinas y m\[EAcute]todo de Euler", \ "Subsubsection"], Cell[TextData[{ "Consideremos la ecuaci\[OAcute]n diferencial ", StyleBox["y", FontSlant->"Italic"], "'", StyleBox["=x.", FontSlant->"Italic"], " El campo de direcciones (isoclinas) asociado a esta ecuaci\[OAcute]n \ diferencial es ", Cell[BoxData[ \(TraditionalForm\`\(v\&\[RightVector]\)(x, y) = \(\((1, y')\) = \((1, x)\)\)\)]], ", que representan vectores tangentes a la trayectoria ", StyleBox["y(x) ", FontSlant->"Italic"], " en cada punto. La representaci\[OAcute]n gr\[AAcute]fica del mismo se \ realiza mediante:" }], "Text"], Cell[BoxData[{ \(<< Graphics`PlotField`\), "\[IndentingNewLine]", \(\(isoclinas = PlotVectorField[{1, x}, {x, \(-3\), 3}, {y, \(-3\), 3}];\)\)}], "Input", CellLabel->"In[1]:="], Cell[TextData[{ "La soluci\[OAcute]n general de la ecuaci\[OAcute]n diferencial ", StyleBox["y'=x ", FontSlant->"Italic"], " viene dada por:" }], "Text"], Cell[BoxData[ \(DSolve[\(y'\)[x] == x, y[x], x]\)], "Input", CellLabel->"In[3]:="], Cell[TextData[{ "que nos da una familia uniparam\[EAcute]trica de curvas, donde C[1] \ representa la constante de integraci\[OAcute]n. Representemos varias curvas \ de esta familia pero, para ello, definamos la familia ", StyleBox["y(x,c) ", FontSlant->"Italic"], "para distintas condiciones iniciales ", Cell[BoxData[ \(TraditionalForm\`y(0) = c\)]], " como una funci\[OAcute]n ", StyleBox["sol[x,c] ", FontWeight->"Bold"], "de dos variables:" }], "Text"], Cell[BoxData[{ \(\(Clear[y, x, c];\)\), "\[IndentingNewLine]", \(sol[x_, c_] := y[x] /. DSolve[{\(y'\)[x] == x, y[0] == c}, y[x], x]\)}], "Input", CellLabel->"In[4]:="], Cell["\<\ Definamos una tabla con los 7 miembros c=-2,-1.5,...,0.5,1 de dicha familia \ uniparam\[EAcute]trica de curvas y represent\[EAcute]mosla \ gr\[AAcute]ficamente:\ \>", "Text"], Cell[BoxData[{ \(\(familia = Table[sol[x, c], {c, \(-2\), 1, 0.5}];\)\), "\[IndentingNewLine]", \(familiaplot = Plot[Evaluate[familia], {x, \(-2.5\), 2.5}]\)}], "Input", CellLabel->"In[6]:="], Cell["\<\ Superponiendo dichas curvas con el campo de direcciones (isoclinas):\ \>", "Text"], Cell[BoxData[ \(Show[isoclinas, familiaplot]\)], "Input", CellLabel->"In[8]:="], Cell["\<\ vemos que el campo de direcciones es, efectivamente, tangente a la familia de \ curvas en cada punto.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Ejercicio", "Subsubsection"], Cell[TextData[{ "Dibuje el campo de direcciones (isoclinas) de la ecuaci\[OAcute]n \ diferencial ", StyleBox["y'=", FontSlant->"Italic"], Cell[BoxData[ \(TraditionalForm\`x\^3\)]], "-", StyleBox["x ", FontSlant->"Italic"], "en el cuadrado ", StyleBox["(x,y)", FontSlant->"Italic"], "\[Epsilon][-2,2]\[Times][-3,3]", StyleBox[" ", FontSlant->"Italic"], "y superponga dicho gr\[AAcute]fico al de la familia de soluciones con \ condiciones iniciales ", StyleBox["y(0)=c=-1,-0.5,0,0.5,1", FontSlant->"Italic"] }], "Text"], Cell[TextData[{ StyleBox["M\[EAcute]todo de Euler: ", FontWeight->"Bold"], "Aunque ", StyleBox["Mathematica", FontSlant->"Italic"], " dispone de m\[EAcute]todos num\[EAcute]ricos relativamente exactos para \ resolver ecuaciones diferenciales, dise\[NTilde]emos nosotros mismos un \ algoritmo para un m\[EAcute]todo \"grosero\" (poco preciso, no refinado) c\ \[OAcute]mo es el de Euler. Esto nos sirve como \"modelo de juguete\" para \ saber cualitativamente c\[OAcute]mo funcionan otros m\[EAcute]todos num\ \[EAcute]ricos m\[AAcute]s sofisticados y c\[OAcute]mo evaluar el error num\ \[EAcute]rico cometido. Por ejemplo, tomemos la ecuaci\[OAcute]n lineal no \ homog\[EAcute]nea de primer orden ", Cell[BoxData[ \(TraditionalForm\`\(\(y' = \(f(x, y) = x\^2 + y\)\)\(,\)\)\)]], " con la condici\[OAcute]n inicial ", StyleBox["y(0)=1. ", FontSlant->"Italic"], "Aunque s", "abemos resolver dicha ecuaci\[OAcute]n de forma exacta, abordaremos el \ problema de forma num\[EAcute]rica y compararemos la soluci\[OAcute]n num\ \[EAcute]rica con la exacta para evaluar el error cometido y as\[IAcute] \ hacer un test a nuestro m\[EAcute]todo num\[EAcute]rico. Supongamos que \ queremos una soluci\[OAcute]n num\[EAcute]rica de la EDO anterior en el \ intervalo x\[Element][0,1]. Para ello dividimos el intervalo [0,1] en, por \ ejemplo, 10 trozos, tomando un paso ", StyleBox["h=0.1 ", FontSlant->"Italic"], "y obteniendo as\[IAcute] 11 puntos equiespaciados: ", Cell[BoxData[ \(TraditionalForm\`x\_0 = 0, \ x\_1 = 0.1, \ ... , \ x\_k = x\_0 + k\ h, \ ... , \ x\_10 = 1\)]], ". Introduzcamos dicha informaci\[OAcute]n en el programa:" }], "Text"], Cell[BoxData[{ \(\(Clear[f, x, y, h, k];\)\), "\[IndentingNewLine]", \(\(f[x_, y_] := x^2 + y;\)\), "\[IndentingNewLine]", \(h = 0.1; x[0] = 0;\), "\[IndentingNewLine]", \(x[k_] := x[0] + k*h\)}], "Input", CellLabel->"In[9]:="], Cell[TextData[{ "Discretizando la derivada ", Cell[BoxData[ \(TraditionalForm\`y' \((x\_k)\) \[TildeTilde] \((y(x\_\(k + 1\)) - y(x\_k))\)/h = \((y\_\(k + 1\) - y\_k)\)/h\)]], " obtenemos la versi\[OAcute]n en diferencias finitas ", Cell[BoxData[ \(TraditionalForm\`y\_k = y\_\(k - 1\) + h\ \(f(x\_\(k - 1\), y\_\(k - 1\))\)\)]], " de la ecuaci\[OAcute]n diferencial ", Cell[BoxData[ \(TraditionalForm\`y' = \(\(f(x, y)\)\(.\)\(\ \)\)\)]], "Introduzcamos dicha ecuaci\[OAcute]n en el programa y representemos los 11 \ puntos ", Cell[BoxData[ \(TraditionalForm\`\((x\_0, y\_0)\), ... , \((x\_10, y\_10)\)\)]], ":" }], "Text"], Cell[BoxData[{ \(\(y[0] = 1;\)\), "\[IndentingNewLine]", \(\(y[k_] := y[k - 1] + h*f[x[k - 1], y[k - 1]];\)\), "\n", \(eulerplot = ListPlot[Table[{x[k], y[k]}, {k, 0, 10}]]\)}], "Input", CellLabel->"In[13]:="], Cell["\<\ Calculemos la soluci\[OAcute]n exacta y represent\[EAcute]mosla \ gr\[AAcute]ficamente (cambiaremos x\[LeftRightArrow]t, y\[LeftRightArrow]z \ para evitar incompatibilidades)\ \>", "Text"], Cell[BoxData[{ \(exacta = DSolve[{\(z'\)[t] == t^2 + z[t], z[0] == 1}, z, t]\), "\[IndentingNewLine]", \(exactaplot = Plot[z[t] /. exacta, {t, 0, 1}]\)}], "Input", CellLabel->"In[16]:="], Cell["Superpongamos la soluci\[OAcute]n exacta y la num\[EAcute]rica:", "Text"], Cell[BoxData[ \(Show[eulerplot, exactaplot]\)], "Input", CellLabel->"In[18]:="], Cell[TextData[{ "Vemos c\[OAcute]mo la soluci\[OAcute]n num\[EAcute]rica se aparta \ progresivamente de la exacta conforme nos alejamos del punto inicial ", Cell[BoxData[ \(TraditionalForm\`\((x\_0, y\_0)\) = \((0, 1)\)\)]], ". Podemos evaluar el error cometido en el \[UAcute]ltimo punto ", Cell[BoxData[ \(TraditionalForm\`\(\((x\_10, y\_10)\)\(\ \)\)\)]], StyleBox[" ", FontSlant->"Italic"], "como ", Cell[BoxData[ \(TraditionalForm\`y(1) - y\_10\)]], ":" }], "Text"], Cell[BoxData[ \(Evaluate[z[1] /. exacta] - y[10]\)], "Input", CellLabel->"In[19]:="], Cell["Es decir, el error es de 0.214244", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Ejercicio", "Subsubsection"], Cell[TextData[{ "Repita los pasos anteriores para 21 puntos, es decir, tomando como paso la \ mitad del anterior: ", StyleBox["h=0.05. ", FontSlant->"Italic"], "Eval\[UAcute]e el error cometido en el c\[AAcute]lculo num\[EAcute]rico de \ ", StyleBox["y(1).", FontSlant->"Italic"], " \[DownQuestion]Es el error mayor o menor que para el caso ", StyleBox["h=0.1", FontSlant->"Italic"], "?." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Ejemplos de EDOs de orden 2. Diagrama de fases", "Subsubsection"], Cell[TextData[{ "Consideremos la ecuaci\[OAcute]n diferencial lineal de segundo orden con \ coeficientes constantes x", StyleBox["''(t)=kx(t) ", FontSlant->"Italic"], " que puede representar la ecuaci\[OAcute]n de un oscilador \ arm\[OAcute]nico simple atractivo para ", StyleBox["k<0 ", FontSlant->"Italic"], " y repulsivo para ", StyleBox["k>0. ", FontSlant->"Italic"], " La soluci\[OAcute]n general de esta ecuaci\[OAcute]n se obtiene:" }], "Text", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[BoxData[{ \(\(Clear[x, t];\)\), "\[IndentingNewLine]", \(DSolve[\(x''\)[t] == k\ x[t], x[t], t]\)}], "Input", CellLabel->"In[20]:=", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[TextData[{ "Vemos que contiene dos constantes arbitrarias C[1] y C[2], como \ corresponde a una EDO de orden 2. \n\nTomemos el oscilador atractivo con ", Cell[BoxData[ \(TraditionalForm\`k = \(\(-\[Omega]\_0\%2\)\(=\)\)\)]], "-2 y condiciones iniciales x", StyleBox["(0)=1, x'(0)=0 ", FontSlant->"Italic"], "(velocidad inicial nula); ahora la soluci\[OAcute]n ser\[AAcute]:" }], "Text"], Cell[BoxData[ \(xoscatract = DSolve[{\(x''\)[t] == \(-2\)\ x[t], x[0] == 1, \(x'\)[0] == 0}, x, t]\)], "Input", CellLabel->"In[22]:="], Cell[TextData[{ "que representa un movimiento arm\[OAcute]nico simple de amplitud 1 y \ frecuencia ", Cell[BoxData[ \(TraditionalForm\`\[Omega]\_0 = \@2\)]], ". Para representar gr\[AAcute]ficamente la posici\[OAcute]n ", StyleBox["x", FontWeight->"Bold"], " en funci\[OAcute]n del tiempo ", StyleBox["t ", FontWeight->"Bold"], "escribiremos:" }], "Text"], Cell[BoxData[ \(Plot[x[t] /. xoscatract, {t, 0, 2 Pi}, AxesLabel -> {"\", "\"}]\)], "Input", CellLabel->"In[23]:="], Cell[TextData[{ "donde observamos que el periodo del movimiento es ", StyleBox["T=", FontSlant->"Italic"], Cell[BoxData[ \(TraditionalForm\`\(2 \[Pi]\)\/\[Omega]\_0 = 2 \[Pi]/\@2 \[TildeTilde] 4.442882938158366`\)]], ". Para representar la velocidad ", StyleBox["v[t]=x'[t] ", FontWeight->"Bold"], "en funci\[OAcute]n del tiempo escribimos:" }], "Text"], Cell[BoxData[ \(Plot[\(x'\)[t] /. xoscatract, {t, 0, 2 Pi/\@2}, AxesLabel -> {"\", "\"}]\)], "Input", CellLabel->"In[24]:="], Cell[TextData[{ "Tambi\[EAcute]n podemos hacer una representaci\[OAcute]n de la velocidad \ ", StyleBox["v[x]", FontWeight->"Bold"], StyleBox[" ", FontWeight->"Bold"], "en funci\[OAcute]n de la posici\[OAcute]n ", StyleBox["x ", FontWeight->"Bold"], "(\"diagrama de fases\") por medio de un gr\[AAcute]fico en forma param\ \[EAcute]trica:" }], "Text"], Cell[BoxData[ \(ParametricPlot[ Evaluate[{x[t], \(x'\)[t]} /. xoscatract], {t, 0, 2 Pi/\@2}, AxesLabel -> {"\", "\"}]\)], "Input", CellLabel->"In[25]:="], Cell[TextData[{ "que nos da una \[OAcute]rbita cerrada (elipse), caracter\[IAcute]stica de \ los sistemas peri\[OAcute]dicos.\n\nVeamos qu\[EAcute] pasa con el oscilador \ repulsivo para ", StyleBox["k=2 ", FontSlant->"Italic"], "e id\[EAcute]nticas condiciones iniciales que para el atractivo" }], "Text"], Cell[BoxData[{ \(xoscrepul = DSolve[{\(x''\)[t] == 2\ x[t], x[0] == 1, \(x'\)[0] == 0}, x, t]\), "\[IndentingNewLine]", \(Plot[x[t] /. xoscrepul, {t, 0, Pi}, AxesLabel -> {"\", "\"}]\)}], "Input", CellLabel->"In[26]:="], Cell[TextData[{ "Vemos que la part\[IAcute]cula se aleja de su posici\[OAcute]n inicial ", StyleBox["x(0)=1 ", FontSlant->"Italic"], " de forma exponencial. La trayectoria no se repite a intervalos de tiempo \ fijos ", StyleBox["T;", FontSlant->"Italic"], " es decir, a diferencia del oscilador atractivo, el oscilador repulsivo no \ es un sistema peri\[OAcute]dico. Veamos que sus trayectorias en el plano de \ fases tampoco son cerradas:" }], "Text"], Cell[BoxData[ \(ParametricPlot[ Evaluate[{x[t], \(x'\)[t]} /. xoscrepul], {t, 0, 2 Pi/\@2}, AxesLabel -> {"\", "\"}]\)], "Input", CellLabel->"In[28]:="] }, Open ]], Cell[CellGroupData[{ Cell["Ejercicio", "Subsubsection"], Cell[TextData[{ "Dibuje la trayectoria en el plano ", StyleBox["x-t ", FontWeight->"Bold"], " y en el plano de fases ", StyleBox["x-x' ", FontWeight->"Bold"], "de un oscilador arm\[OAcute]nico simple atractivo con ", Cell[BoxData[ \(TraditionalForm\`k = \(\(-\[Omega]\_0\%2\) = \(-5\)\)\)]], " que parte de la posici\[OAcute]n ", StyleBox["x(0)=0 ", FontSlant->"Italic"], "con velocidad ", StyleBox["x'(0)=1. ", FontSlant->"Italic"], "Tome el intervalo ", StyleBox["t\[Element][0,", FontSlant->"Italic"], Cell[BoxData[ \(TraditionalForm\`T = \(2 \[Pi]\)\/\[Omega]\_0\)]], StyleBox["].", FontSlant->"Italic"] }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Sistemas de EDOs", "Subsubsection"], Cell[TextData[{ "Tambi\[EAcute]n podemos resolver sistemas de EDOs,introduciendo \ \[EAcute]stas mediante una lista.Por ejemplo, para resolver el sistema de dos \ EDOs lineales con coeficientes constantes ", Cell[BoxData[ FormBox[ TagBox[ StyleBox[ RowBox[{"{", StyleBox[GridBox[{ {\(y\_1 = \(-y\_2'\)\)}, {\(y\_2 = \(-y\_1'\)\)} }], ShowAutoStyles->True]}], ShowAutoStyles->False], (#&)], TraditionalForm]]], " escribiremos:" }], "Text"], Cell[BoxData[ RowBox[{"DSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{\(y1[x]\), "==", RowBox[{"-", RowBox[{ SuperscriptBox["y2", "\[Prime]", MultilineFunction->None], "[", "x", "]"}]}]}], ",", RowBox[{\(y2[x]\), "==", RowBox[{"-", RowBox[{ SuperscriptBox["y1", "\[Prime]", MultilineFunction->None], "[", "x", "]"}]}]}]}], "}"}], ",", \({y1[x], y2[x]}\), ",", "x"}], "]"}]], "Input", CellLabel->"In[29]:="], Cell[TextData[{ "que nos da la soluci\[OAcute]n general dependiente de dos constantes \ arbitrarias C[1] y C[2].Veamos c\[OAcute]mo calcular la soluci\[OAcute]n \ particular que pasa por ", StyleBox["{y1[0],y2[0]}={1,2}", FontWeight->"Bold"], " y c\[OAcute]mo representar ", StyleBox["y1[t]", FontWeight->"Bold"], " e ", StyleBox["y2[t]", FontWeight->"Bold"], " superpuestas en un mismo gr\[AAcute]fico:" }], "Text"], Cell[BoxData[{ RowBox[{"sistema", "=", RowBox[{"DSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{\(y1[x]\), "==", RowBox[{"-", RowBox[{ SuperscriptBox["y2", "\[Prime]", MultilineFunction->None], "[", "x", "]"}]}]}], ",", \(y1[0] == 1\), ",", RowBox[{\(y2[x]\), "==", RowBox[{"-", RowBox[{ SuperscriptBox["y1", "\[Prime]", MultilineFunction->None], "[", "x", "]"}]}]}], ",", \(y2[0] == 2\)}], "}"}], ",", \({y1, y2}\), ",", "x"}], "]"}]}], "\[IndentingNewLine]", \(<< Graphics`Legend`\), "\[IndentingNewLine]", \(Plot[{Evaluate[ y1[t] /. sistema], Evaluate[y2[t] /. sistema]}, {t, 0, 5}, PlotStyle -> {GrayLevel[0. ], Dashing[{0.02, 0.02}]}, PlotLegend -> {"\", "\"}]\)}], "Input", CellLabel->"In[30]:="], Cell["\<\ Vemos que ambas funciones se separan indefinidamente de forma exponencial.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Ejercicio", "Subsubsection"], Cell[TextData[{ "Resolver el sistema ", Cell[BoxData[ FormBox[ TagBox[ StyleBox[ RowBox[{"{", StyleBox[GridBox[{ {\(y\_1' = y\_1\)}, {\(y\_2' = \(-y\_1\) + 2 y\_2\)} }], ShowAutoStyles->True]}], ShowAutoStyles->False], (#&)], TraditionalForm]]], " con condiciones iniciales ", Cell[BoxData[ \(TraditionalForm\`\(y\_1\)(0) = \(-1\), \ \(y\_2\)(0) = 1\)]], " y representar superpuestas las gr\[AAcute]ficas de ", Cell[BoxData[ \(TraditionalForm\`\(y\_1\)(x)\)]], " e ", Cell[BoxData[ \(TraditionalForm\`\(y\_2\)(x)\)]], " en el intervalo x\[Element][0,10]." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Ecuaciones en derivadas parciales", "Subsubsection"], Cell[TextData[{ "Finalmente, veamos c\[OAcute]mo introducir una ecuaci\[OAcute]n en \ derivadas parciales como, por ejemplo, ", Cell[BoxData[ \(TraditionalForm\`\[PartialD]\_x\ \(U(x, y, z)\) = \(x\^2\) y/z\)]] }], "Text"], Cell[BoxData[ \(DSolve[\(\(Derivative[1, 0, 0]\)[U]\)[x, y, z] == x^2 y/z, U[x, y, z], {x, y, z}]\)], "Input", CellLabel->"In[33]:="], Cell[TextData[{ "que nos da la funci\[OAcute]n ", StyleBox["U(x,y,z)=", FontSlant->"Italic"], Cell[BoxData[ \(\(x\^3\ y\)\/\(3\ z\)\)]], StyleBox[" ", FontSlant->"Italic"], " salvo una funci\[OAcute]n arbitraria ", Cell[BoxData[ \(TraditionalForm\`\(C\_1\)(x, y)\)]], " dependiente de s\[OAcute]lo dos de las tres variables independientes. \ Tambi\[EAcute]n se dispone del paquete: " }], "Text"], Cell[BoxData[{ \(<< Calculus`DSolveIntegrals`\), "\[IndentingNewLine]", \(CompleteIntegral[\(\(Derivative[1, 0, 0]\)[U]\)[x, y, z] == yz, U[x, y, z], {x, y, z}]\)}], "Input", CellLabel->"In[34]:="] }, Open ]], Cell[CellGroupData[{ Cell["Ejercicio", "Subsubsection"], Cell[TextData[{ "Resuelva la ecuaci\[OAcute]n ", Cell[BoxData[ \(TraditionalForm\`y \[PartialD]\_x\ \(U(x, y)\) + x \[PartialD]\_y\ \(U(x, y)\) = 0\)]] }], "Text"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["Soluciones num\[EAcute]ricas con NDSolve. E", FontFamily->"Times New Roman"], "cuaci\[OAcute]n de Van der Pol " }], "Subsection", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[TextData[{ StyleBox["El comando ", FontFamily->"Times New Roman"], StyleBox["NDSolve", FontFamily->"Courier"], " encuentra soluciones num\[EAcute]ricas de ecuaciones diferenciales. \ Selecciona de forma autom\[AAcute]tica el algoritmo \[OAcute]ptimo a usar, o \ nos permite que lo seleccionemos nosotros si lo conocemos previamente. ", StyleBox["Mathematica,", FontSlant->"Italic"], " usa autom\[AAcute]ticamente funciones interpoladoras en vez de listas de \ n\[UAcute]meros para representar las soluciones num\[EAcute]ricas de las \ ecuaciones diferenciales, haciendo m\[AAcute]s factible la \ manipulaci\[OAcute]n posterior de dichas soluciones como, por ejemplo, su \ integraci\[OAcute]n, derivaci\[OAcute]n, etc.\n\nEl comando ", StyleBox["NDSolve ", FontFamily->"Courier"], " utiliza los siguientes algoritmos:\n\n\[FilledSmallCircle] Por defecto, o \ mediante la opci\[OAcute]n ", StyleBox["Method->Automatic", "MR"], ", ", StyleBox["NDSolve", "MR"], " cambia entre un m\[EAcute]todo de Adams no r\[IAcute]gido y un \ m\[EAcute]todo de Adams r\[IAcute]gido adaptado.\n\[FilledSmallCircle] El m\ \[EAcute]todo de Adams se toma con orden entre 1 y 12\n\[FilledSmallCircle] \ El m\[EAcute]todo de la f\[OAcute]rmula de diferencias atrasadas se toma con \ orden entre 1 y 5.\n\[FilledSmallCircle] Un orden 4\[Dash]5 para el m\ \[EAcute]todo Runge\[Hyphen]Kutta se aplica a ecuaciones no r\[IAcute]gidas.\n\ \[FilledSmallCircle] Para problemas lineales con condiciones en la frontera, \ ", StyleBox["NDSolve", FontFamily->"Courier"], " emplea el m\[EAcute]todo de b\[UAcute]squeda de \ Gel'fand\[Hyphen]Lokutsiyevskii. \n\[FilledSmallCircle] Para ecuaciones en \ derivadas parciales de dos variables se utiliza el llamado m\[EAcute]todo de \ las lineas.\n\n\nLos algoritmos adaptativos de ", StyleBox["Mathematica ", FontSlant->"Italic"], "y su control de una precisi\[OAcute]n arbitraria garantiza la precisi\ \[OAcute]n de los resultados sin errores de redondeo o soluciones esp\ \[UAcute]reas debidas a errores num\[EAcute]ricos." }], "Text", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[CellGroupData[{ Cell["Ejemplo: soluci\[OAcute]n num\[EAcute]rica de la ecuaci\[OAcute]n de \ Van der Pol ", "Subsubsection", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[TextData[{ "Veamos c\[OAcute]mo ", StyleBox["Mathematica ", FontSlant->"Italic"], "es capaz de proporcionar una soluci\[OAcute]n num\[EAcute]rica para una \ EDO no lineal como la ecuaci\[OAcute]n de Van der Pol\n\n ", Cell[BoxData[ \(TraditionalForm\`\(\(x'\)'\)[t] - 0.2 \((1 - x[t]\^2)\)\ \(x'\)[t]\ + \ x[t]\ = 0\)], ShowGroupOpenCloseIcon->True, GeneratedCell->False], StyleBox[". \n \n ", FontSlant->"Italic"], "Esta ecuaci\[OAcute]n aparece en el estudio de las oscilaciones de un \ circuito RCL con resistencia ", "variable", " dependiente de la amplitud ", StyleBox["x(t).\n \n ", FontSlant->"Italic"], "La soluci\[OAcute]n num\[EAcute]rica con velocidad inicial nula ", StyleBox["x'(0)=0 ", FontSlant->"Italic"], "y posici\[OAcute]n inicial ", StyleBox["x(0)=1 ", FontSlant->"Italic"], " en los primeros 30 segundos (es decir, en el intervalo 0\[LessEqual]t\ \[LessEqual]30) es:" }], "Text", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[BoxData[ RowBox[{"solu1", " ", "=", " ", RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ FormBox[\(\(\(\(\(x'\)'\)[ t]\)\(-\)\(0.2 \((1 - x[t]\^2)\)\ \(x'\)[ t]\)\(\ \)\(+\)\(\ \)\(x[t]\)\(\ \)\) == 0\), "TraditionalForm"], ",", \(x[0] == 1\), ",", \(\(x'\)[0] == 0\)}], "}"}], ",", "x", ",", \({t, 0, 30}\)}], "]"}]}]], "Input", CellLabel->"In[36]:=", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[TextData[{ "Podemos verificar que la soluci\[OAcute]n num\[EAcute]rica obtenida \ verifica con bastante precisi\[OAcute]n la ecuaci\[OAcute]n diferencial. En \ efecto, la representaci\[OAcute]n gr\[AAcute]fica de ", Cell[BoxData[ \(TraditionalForm\`\(\(\(\(x'\)'\)[ t]\)\(-\)\(0.2 \((1 - x[t]\^2)\)\ \(x'\)[t]\)\(\ \)\(+\)\(\ \)\(x[ t]\)\(\ \)\)\)], ShowGroupOpenCloseIcon->True, GeneratedCell->False], " evaluada en la soluci\[OAcute]n ", StyleBox["solu1 ", FontWeight->"Bold"], "anterior " }], "Text", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[BoxData[ \(Plot[ N[Evaluate[\(\(x'\)'\)[t] - 0.2 \((1 - x[t]\^2)\)\ \(x'\)[t]\ + \ x[t]\ /. solu1], 3], {t, 0, 30}, PlotRange -> {\(-0.002\), 0.002}]\)], "Input", CellLabel->"In[37]:=", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[TextData[{ "nos dice que la soluci\[OAcute]n num\[EAcute]rica ", StyleBox["solu1 ", FontWeight->"Bold"], "verifica la ecuaci\[OAcute]n diferencial en el intervalo t\[Element][0,30] \ salvo errores del orden de 0.001. Una vez que hemos ganado confianza en \ nuestra soluci\[OAcute]n, represent\[EAcute]mosla en el intervalo escogido:" }], "Text", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[BoxData[ \(Plot[x[t] /. solu1, {t, 0, 30}]\)], "Input", CellLabel->"In[38]:=", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[TextData[{ "No queda claro en el gr\[AAcute]fico anterior si dicha soluci\[OAcute]n es \ peri\[OAcute]dica o no. Una representaci\[OAcute]n en el plano de fases: \"", StyleBox["v(x) frente a x\" ", FontSlant->"Italic"] }], "Text"], Cell[BoxData[ \(ParametricPlot[ Evaluate[{x[t], \(x'\)[t]} /. solu1[\([1]\)]], {t, 0, 30}, PlotStyle -> {Thickness[0.005], RGBColor[1, 0, 0]}]\)], "Input", CellLabel->"In[39]:=", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[TextData[{ "nos muestra que la \[OAcute]rbita no es cerrada (al menos en el intervalo \ [0,30]), lo que da idea de \"falta de periodicidad\". No obstante, \ n\[OAcute]tese que la \[OAcute]rbita se acerca \"asint\[OAcute]ticamente\" \ (\"a largo plazo\") a una \[OAcute]rbita cerrada \"atractriz\". Para ver este \ comportamiento asint\[OAcute]tico de la \[OAcute]rbita con mayor nitidez, \ podemos extender el intervalo de tiempo de 30 a 90 segundos y aumentar el n\ \[UAcute]mero m\[AAcute]ximo de pasos que ", StyleBox["NDSolve ", FontWeight->"Bold"], "utiliza (por defecto 500) a 2000 mediante la opci\[OAcute]n ", StyleBox["MaxSteps->2000", FontWeight->"Bold"], " en:" }], "Text", ShowGroupOpenCloseIcon->True, GeneratedCell->False], Cell[BoxData[{ RowBox[{\(\(Clear[x]\)\(\ \)\( (*\ es\ necesario\ borrar\ antes\ el\ valor\ de\ x*) \)\), "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"solu2", "=", " ", RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ FormBox[\(\(\(\(\(x'\)'\)[ t]\)\(-\)\(0.2 \((1 - x[t]\^2)\)\ \(x'\)[ t]\)\(\ \)\(+\)\(\ \)\(x[t]\)\(\ \)\) == 0\), "TraditionalForm"], ",", \(x[0] == 1\), ",", \(\(x'\)[0] == 0\)}], "}"}], ",", "x", ",", \({t, 0, 90}\), ",", \(MaxSteps -> 2000\)}], "]"}]}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", \(ParametricPlot[ Evaluate[{x[t], \(x'\)[t]} /. solu2[\([1]\)]], {t, 0, 90}, PlotStyle -> {Thickness[0.005], RGBColor[1, 0, 0]}]\)}], "Input", CellLabel->"In[40]:="], Cell["\<\ Aqu\[IAcute] se observa con mayor nitidez que existe una \[OAcute]rbita \"l\ \[IAcute]mite, asint\[OAcute]tica o atractriz\" (n\[OAcute]tese la zona de \ mayor densidad de l\[IAcute]neas) cerrada donde converge (a la cual se \ acerca cada vez m\[AAcute]s) nuestro sistema. Esto quiere decir que, aunque \ el sistema no sea peri\[OAcute]dico, se comporta como tal a largo plazo (este \ es un caso particular de un teorema general debido a Alfred Li\[EAcute]nard).\ \ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Ejercicio", "Subsubsection"], Cell[TextData[{ "Hallar la soluci\[OAcute]n num\[EAcute]rica de la ecuaci\[OAcute]n de Van \ der Pol con velocidad inicial ", StyleBox["x'(0)=2 ", FontSlant->"Italic"], "y posici\[OAcute]n inicial ", StyleBox["x(0)=0 ", FontSlant->"Italic"], " en los primeros 50 segundos (es decir, en el intervalo 0\[LessEqual]t\ \[LessEqual]50) y representar las gr\[AAcute]ficas: ", StyleBox["x-t ", FontWeight->"Bold"], "(posici\[OAcute]n frente a tiempo) y ", StyleBox[" x'-x", FontWeight->"Bold"], " (velocidad frente a posici\[OAcute]n)." }], "Text"] }, Open ]] }, Open ]] }, Open ]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1152}, {0, 781}}, WindowSize->{1016, 668}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, PrintingCopies->1, PrintingStartingPageNumber->109, PrintingPageRange->{Automatic, Automatic}, PageHeaders->{{Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"], Inherited, Cell[ TextData[ { OptionValueBox[ "FileName"]}], "Header"]}, {Cell[ TextData[ { OptionValueBox[ "FileName"]}], "Header"], Inherited, Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"]}}, PrintingOptions->{"PrintingMargins"->{{72, 72}, {57.5625, 57.5625}}, "PrintCellBrackets"->False, "PrintRegistrationMarks"->True, "PrintMultipleHorizontalPages"->False, "FirstPageHeader"->False, "FacingPages"->True}, StyleDefinitions -> "Textbook.nb" ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1739, 51, 110, 2, 85, "Section"], Cell[CellGroupData[{ Cell[1874, 57, 160, 3, 43, "Subsection"], Cell[CellGroupData[{ Cell[2059, 64, 44, 0, 37, "Subsubsection"], Cell[2106, 66, 1204, 35, 250, "Text"], Cell[3313, 103, 1198, 25, 118, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[4548, 133, 91, 1, 37, "Subsubsection"], Cell[4642, 136, 582, 17, 42, "Text"], Cell[5227, 155, 209, 5, 50, "Input"], Cell[5439, 162, 163, 5, 25, "Text"], Cell[5605, 169, 88, 2, 30, "Input"], Cell[5696, 173, 484, 13, 42, "Text"], Cell[6183, 188, 186, 4, 50, "Input"], Cell[6372, 194, 184, 4, 25, "Text"], Cell[6559, 200, 211, 4, 50, "Input"], Cell[6773, 206, 92, 2, 25, "Text"], Cell[6868, 210, 85, 2, 30, "Input"], Cell[6956, 214, 125, 3, 25, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[7118, 222, 34, 0, 37, "Subsubsection"], Cell[7155, 224, 566, 20, 42, "Text"], Cell[7724, 246, 1701, 34, 110, "Text"], Cell[9428, 282, 248, 5, 90, "Input"], Cell[9679, 289, 695, 17, 42, "Text"], Cell[10377, 308, 225, 4, 70, "Input"], Cell[10605, 314, 198, 4, 25, "Text"], Cell[10806, 320, 213, 5, 50, "Input"], Cell[11022, 327, 79, 0, 25, "Text"], Cell[11104, 329, 85, 2, 30, "Input"], Cell[11192, 333, 509, 14, 42, "Text"], Cell[11704, 349, 90, 2, 30, "Input"], Cell[11797, 353, 49, 0, 25, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[11883, 358, 34, 0, 37, "Subsubsection"], Cell[11920, 360, 426, 13, 42, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[12383, 378, 71, 0, 37, "Subsubsection"], Cell[12457, 380, 533, 15, 42, "Text"], Cell[12993, 397, 204, 5, 50, "Input"], Cell[13200, 404, 411, 9, 75, "Text"], Cell[13614, 415, 156, 4, 30, "Input"], Cell[13773, 421, 384, 12, 26, "Text"], Cell[14160, 435, 140, 3, 30, "Input"], Cell[14303, 440, 390, 11, 33, "Text"], Cell[14696, 453, 149, 3, 35, "Input"], Cell[14848, 458, 375, 12, 25, "Text"], Cell[15226, 472, 184, 4, 35, "Input"], Cell[15413, 478, 316, 7, 75, "Text"], Cell[15732, 487, 264, 6, 50, "Input"], Cell[15999, 495, 470, 11, 42, "Text"], Cell[16472, 508, 183, 4, 35, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[16692, 517, 34, 0, 37, "Subsubsection"], Cell[16729, 519, 684, 23, 49, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[17450, 547, 41, 0, 37, "Subsubsection"], Cell[17494, 549, 594, 17, 56, "Text"], Cell[18091, 568, 618, 16, 30, "Input"], Cell[18712, 586, 442, 13, 42, "Text"], Cell[19157, 601, 1023, 23, 90, "Input"], Cell[20183, 626, 98, 2, 25, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[20318, 633, 34, 0, 37, "Subsubsection"], Cell[20355, 635, 755, 24, 39, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[21147, 664, 58, 0, 37, "Subsubsection"], Cell[21208, 666, 232, 5, 25, "Text"], Cell[21443, 673, 147, 3, 30, "Input"], Cell[21593, 678, 429, 13, 32, "Text"], Cell[22025, 693, 215, 4, 50, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[22277, 702, 34, 0, 37, "Subsubsection"], Cell[22314, 704, 185, 5, 26, "Text"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[22548, 715, 219, 6, 44, "Subsection"], Cell[22770, 723, 2166, 43, 359, "Text"], Cell[CellGroupData[{ Cell[24961, 770, 164, 3, 37, "Subsubsection"], Cell[25128, 775, 1037, 29, 175, "Text"], Cell[26168, 806, 582, 15, 31, "Input"], Cell[26753, 823, 613, 16, 42, "Text"], Cell[27369, 841, 282, 7, 31, "Input"], Cell[27654, 850, 417, 9, 42, "Text"], Cell[28074, 861, 145, 4, 30, "Input"], Cell[28222, 867, 243, 5, 25, "Text"], Cell[28468, 874, 253, 6, 30, "Input"], Cell[28724, 882, 764, 16, 59, "Text"], Cell[29491, 900, 946, 20, 111, "Input"], Cell[30440, 922, 491, 8, 42, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[30968, 935, 34, 0, 37, "Subsubsection"], Cell[31005, 937, 578, 16, 42, "Text"] }, Open ]] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)