Tercer Parcial de Metodos Numericos 2011 Rk

METODOS NUMERICOS RESOLUCION DE EJERCICIOS DE ECUACIONES DIFERENCIALES ORDINARIAS Y SISTEMA DE ECUACIONES DIFERENCIALES

Views 54 Downloads 0 File size 245KB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

METODOS NUMERICOS RESOLUCION DE EJERCICIOS DE ECUACIONES DIFERENCIALES ORDINARIAS Y SISTEMA DE ECUACIONES DIFERENCIALES 1.

En una red eléctrica, las corrientes i1(t) e i2(t) están definidas por el siguiente sistema de ecuaciones diferenciales:

di1  50 i 2  60 dt di 0,005 2  i 2  i1  0 dt Las corrientes i1(t) e i2(t) son nulas al inicio. Utilizando el algoritmo de Runge Kutta, determinar ambas corrientes después de t=0,04 s. Realizar mínimo dos iteraciones. SOLUCION Despejamos las ecuaciones en su forma diferencial 𝑑𝑖1 = 60 − 50 ∗ 𝑖2 𝑑𝑡 𝑑𝑖2 𝑖1 − 𝑖2 = 𝑑𝑡 0.005 APLICANDO EL ALGORITMO DE RANGE KUTTA DE CUARTO ORDEN En general, una ecuación diferencial ordinaria de orden 𝑛 − 𝑒𝑠𝑖𝑚𝑜 queda convertida en un sistema de n- ecuaciones diferenciales simultáneas ordinarias de la forma general 𝑦1′ = 𝑓1 (𝑥, 𝑦1, 𝑦2, 𝑦3 … 𝑦𝑛) 𝑦2′ = 𝑓2 (𝑥, 𝑦1, 𝑦2, 𝑦3 … 𝑦𝑛) ⋮ 𝑦𝑛′ = 𝑓3 (𝑥, 𝑦1, 𝑦2, 𝑦3 … 𝑦𝑛) Que puede resolverse aplicando, por ejemplo, algunos de los métodos de 𝑅𝑎𝑛𝑔𝑒 𝐾𝑢𝑡𝑡𝑎 a cada ecuación, e iterando cada ecuación en turno, tal como en los sistemas de ecuaciones no lineales y los métodos de predicción-corrección

𝑦 ′ = 𝑓1 (𝑥, 𝑦, 𝑧) 𝑧 ′ = 𝑓2 (𝑥, 𝑦, 𝑧) Donde solo se emplea z como una nueva variable a fin de no usar sub índices dobles en las ecuaciones

𝑦𝑖+1 = 𝑦𝑖 +

ℎ ∗ (𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ) 6

𝑧𝑖+1 = 𝑧𝑖 +

ℎ ∗ (𝑐1 + 2𝑐2 + 2𝑐3 + 𝑐4 ) 6

Las cuales se calculan alternadamente, y las 𝑘 y 𝑐 se obtienen de:

𝑘1 = 𝑓1 (𝑥𝑖 , 𝑦𝑖 , 𝑧𝑖 ) 𝑐1 = 𝑓2 (𝑥𝑖 , 𝑦𝑖 , 𝑧𝑖 ) Calculando las segundas constantes ℎ ℎ𝑘1 ℎ𝑐1 𝑘2 = 𝑓1 (𝑥𝑖 + , 𝑦𝑖 + , 𝑧𝑖 + ) 2 2 2 ℎ ℎ𝑘1 ℎ𝑐1 𝑐2 = 𝑓2 (𝑥𝑖 + , 𝑦𝑖 + , 𝑧𝑖 + ) 2 2 2 Calculando las terceras constantes ℎ ℎ𝑘2 ℎ𝑐2 𝑘3 = 𝑓1 (𝑥𝑖 + , 𝑦𝑖 + , 𝑧𝑖 + ) 2 2 2 ℎ ℎ𝑘2 ℎ𝑐2 𝑐3 = 𝑓2 (𝑥𝑖 + , 𝑦𝑖 + , 𝑧𝑖 + ) 2 2 2 Calculando las cuartas constantes 𝑘4 = 𝑓1 (𝑥𝑖 + ℎ, 𝑦𝑖 + ℎ𝑘3 , 𝑧𝑖 + ℎ𝑐3 ) 𝑐4 = 𝑓2 (𝑥𝑖 + ℎ, 𝑦𝑖 + ℎ𝑘3 , 𝑧𝑖 + ℎ𝑐3 ) Las cuales son calculadas en ese orden clc, clear %METODO DE RANGE KUTTA disp(' RANGE KUTTA') syms i1 i2 t %CONDICIONES INICIAES i10=0; i20=0; t0=0; %PRIMERA FUNCION di1=60-50*i2 %SEGUNDA FUNCION di2=(i1-i2)/0.005 %MARCA DE PASO h=0.04; n=4; while i