{"id":4064,"date":"2017-12-12T07:05:21","date_gmt":"2017-12-12T12:05:21","guid":{"rendered":"http:\/\/blog.espol.edu.ec\/matg1013\/?p=4064"},"modified":"2026-04-05T20:20:47","modified_gmt":"2026-04-06T01:20:47","slug":"s2eva2012ti_t2-edo-modelo-de-clima","status":"publish","type":"post","link":"https:\/\/blog.espol.edu.ec\/algoritmos101\/mn-s2eva20\/s2eva2012ti_t2-edo-modelo-de-clima\/","title":{"rendered":"s2Eva2012TI_T2 EDO Modelo de clima x,y,z"},"content":{"rendered":"\n<p><em><strong>Ejercicio<\/strong><\/em>: <a href=\"https:\/\/blog.espol.edu.ec\/algoritmos101\/mn-2eva20\/2eva2012ti_t2-edo-modelo-clima-xyz\/\" data-type=\"post\" data-id=\"852\">2Eva2012TI_T2 EDO Modelo de clima x,y,z<\/a><\/p>\n\n\n\n<p>Se deja de tarea realizar las tres primeras iteraciones en papel.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"638\" height=\"479\" src=\"http:\/\/blog.espol.edu.ec\/algoritmos101\/files\/2017\/12\/modeloclimaxyz_3D.png\" alt=\"modelo clima x,y,z 3D\" class=\"wp-image-18445\" \/><\/figure>\n\n\n\n<p>Se presenta el resultado usando el algoritmo de segundo grado como una variante a la respuesta usada como ejemplo.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> &#091; ti, xi, yi, zi]\n&#091;&#091; 0.0000e+00  1.0000e+01  7.0000e+00  7.0000e+00]\n &#091; 2.5000e-03  9.9323e+00  7.5033e+00  7.1335e+00]\n &#091; 5.0000e-03  9.8786e+00  7.9988e+00  7.2774e+00]\n ...\n &#091; 2.4995e+01 -8.4276e+00 -2.7491e+00  3.3021e+01]\n &#091; 2.4998e+01 -8.2860e+00 -2.6392e+00  3.2858e+01]\n &#091; 2.5000e+01 -8.1453e+00 -2.5346e+00  3.2692e+01]]<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Algoritmo en Python<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# 2Eva_IT2012_T2 Modelo de clima\n# MATG1013 An\u00e1lisis Num\u00e9rico\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef rungekutta2_fg(f,g,j,t0,x0,y0,z0,h,muestras):\n    tamano = muestras + 1\n    estimado = np.zeros(shape=(tamano,4),dtype=float)\n    # incluye el punto &#x5B;t0,x0,y0,z0]\n    estimado&#x5B;0] = &#x5B;t0,x0,y0,z0]\n    ti = t0\n    xi = x0\n    yi = y0\n    zi = z0\n    for i in range(1,tamano,1):\n        K1x = h * f(ti,xi,yi,zi)\n        K1y = h * g(ti,xi,yi,zi)\n        K1z = h * j(ti,xi,yi,zi)\n        \n        K2x = h * f(ti+h,xi + K1x, yi + K1y, zi + K1z)\n        K2y = h * g(ti+h,xi + K1x, yi + K1y, zi + K1z)\n        K2z = h * j(ti+h,xi + K1x, yi + K1y, zi + K1z)\n        \n        xi = xi + (K1x+K2x)\/2\n        yi = yi + (K1y+K2y)\/2\n        zi = zi + (K1z+K2z)\/2\n        ti = ti + h\n        \n        estimado&#x5B;i] = &#x5B;ti,xi,yi,zi]\n    return(estimado)\n\n\n#INGRESO\nto = 0\nxo = 10\nyo = 7\nzo = 7\nf = lambda t,x,y,z: 10*(y-x)\ng = lambda t,x,y,z: x*(28-z) - y\nj = lambda t,x,y,z: -(8\/3)*z + (x*y)\nh = 0.0025\nmuestras = 10000\n\n#PROCEDIMIENTO\n#Rugen-Kutta 2_orden\ntabla = rungekutta2_fg(f,g,j,to,xo,yo,zo,h,muestras)\n\n#SALIDA\nnp.set_printoptions(precision=4)\nprint(' &#x5B; ti, xi, yi, zi]')\nprint(tabla)\n\n# Gr\u00e1fica 3D\nfig = plt.figure()\ngraf3D = fig.add_subplot(111, projection = '3d')\ngraf3D.plot(tabla&#x5B;:,1], tabla&#x5B;:,2], tabla&#x5B;:,3])\nplt.tight_layout()\nplt.show()\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Ejercicio: 2Eva2012TI_T2 EDO Modelo de clima x,y,z Se deja de tarea realizar las tres primeras iteraciones en papel. Se presenta el resultado usando el algoritmo de segundo grado como una variante a la respuesta usada como ejemplo. Algoritmo en Python<\/p>\n","protected":false},"author":8043,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"wp-custom-template-entrada-mn-ejemplo","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[58,54],"class_list":["post-4064","post","type-post","status-publish","format-standard","hentry","category-mn-s2eva20","tag-ejemplos-python","tag-mnumericos"],"_links":{"self":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/4064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/users\/8043"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/comments?post=4064"}],"version-history":[{"count":4,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/4064\/revisions"}],"predecessor-version":[{"id":23875,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/4064\/revisions\/23875"}],"wp:attachment":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/media?parent=4064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/categories?post=4064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/tags?post=4064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}