Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
14 views
UNIVERSIDAD NACIONAL DE ELSALVADOR INTEGRANTE: CARNET GERSON MANUEL MARTINEZ HERNANDEZ MH12043 WILBER ALEXANDER ORTIZ CORTEZ OC08013 MATERIA: ECDUACIONES DIFERENCIALES LICENCIATURA EN MATEMATICA PROYECTO FINAL DE ECUACIONES DIFERENCIALES Ciudad Universitaria, San salvador, El salvador

**PROBLEMA 1 "graficas de soluciones exactas de ecuaciones diferenciales" **: considere la ecuacion diferencia dydx=ysinx\begin{equation} \dfrac{dy}{dx}=y-sin x \end{equation} de [3,3][-3,3]X[3,3][-3,3].grafique 10 curvas solucion exacta,usando puntos aleatorio de [2,2][-2,2]X[2,2][-2,2].para elegir las condiciones iniciales de manera uniforme. Añadir un campo de pendientes e indicar las condicionales iniciales de la grafica.

u,v=var('u,v') SlopeField=plot_slope_field(v-sin(u),(u,-3,3),(v,-3,3)) x = var ('x') y = function ('y',x) DE = diff (y,x)-y+sin(x)== 0 sol =[]; i=0; a=0; b=0; pts=points([],size=20,color='red') #loop over to obtain the sequence of plots while i < 10: #randomly choose points in the [-2,2]^2 space a=2*random()-2 b=2*random()-2 #append the solutions whose initial condition was chosen randomly sol.append (desolve (DE , [y, x], ics =[ a, b])) #graph the initial condition pts=pts+points([a,b],size=40,color='red') i=i+1 g= plot (sol , x, -3, 3) (g+pts+SlopeField).show(ymin = -3, ymax =3)

**PROBLEMA 2 "Resolver una ecuación diferencial de coeficientes constantes exactamente" **: Sage no tiene una función integrada para la solución de una ecuación diferencial exactamente lineal homogénea de orden superior a 2. Crear una función que resuelve la siguiente ecuación diferencial ad3ydx3+bd2ydx2+cdydx+d=0\begin{equation} a\dfrac{d^3y}{dx^3} + b\dfrac{d^2y}{dx^2}+c\dfrac{dy}{dx}+d = 0 \end{equation} En concreto, cree una función cuya entrada son los cuatro parámetros a; b; c; d de la ecuación diferencial anterior y cuya salida depende de una función de x con los tres parámetros esperados.

def prueba(a,b,c,d): x,c1,c2,c3,c4,c5,c6=var("x,c1,c2,c3,c4,c5,c6") A=a*x^3+b*x^2+c*x+d p=A.roots() #print p #print H if a==0: raices(p) elif b==0: raices(p) elif c==0: raices(p) elif d==0: raices(p) elif a!=0 and b!=0 and c!=0 and d!=0: raices(p) elif a==0 or b==0 or c==0 or d==0 : raices(p) elif b==0 and c==0 : raices(p) return p def raices(Y): print len(Y) for j in range(len(Y)): if Y[j][1]==1: #print"aqui estoy" if len(Y)==2 and Y[j][0].imag()!=0: raices_distintas(Y,j) break elif len(Y)==2 and Y[j][0].imag()!=0: raices_distintas(Y,j) break elif len(Y)==2 and Y[j][0].imag()==0: raices_distintas(Y,j) elif len(Y)==3 and Y[j][0].imag()!=0: raices_distintas(Y,j) elif len(Y)==3 and abs(Y[j][0].imag())==0: raices_distintas(Y,j) elif Y[j][0].imag()!=0: raices_distintas(Y,j) else: raices_distintas(Y,j) elif Y[j][1]==2 and len(Y)!=2: Y.reverse() return raices_repetidas(Y,j) break elif Y[j][1]==2 and len(Y)==2: return raices_repetidas(Y,j) break elif Y[j][1]==3: return calcular(Y) break def raices_distintas(M,N): if M[N][0].imag()==0: #print "real" show(c3*exp(M[N][0].real()*x)) show("+") else: n=N if n <=1: if abs(M[N][0].imag())==abs(M[N+1][0].imag()) : show(exp(M[N][0].real()*x)*(c1*cos(abs(-1*M[N][0].imag()).simplify()*x)+c2*sin(abs(-1*M[N][0].imag()).simplify()*x ))) show("+") elif abs(M[N][0].imag())==abs(M[N+1][0].imag()) : show(exp(M[N][0].real()*x)*(c1*cos(abs(-1*M[N][0].imag()).simplify()*x)+c2*sin(abs(-1*M[N][0].imag()).simplify()*x ))) show("+") return def raices_repetidas(M,J): if M[J][0].imag()==0: #print "real" show((c1+c2*x)*exp(M[J][0].real()*x)) else: #print"complejo" show(exp(M[J][0].real()*x)*(c1*cos(M[J][0].imag()*x)+c2*sin(M[J][0].imag()*x )+x*(c3*cos(M[J][0].imag()*x)+c4*sin(M[J][0].imag()*x )))) return ##prueba(0,1,2,1) #prueba(1,0,1,-10) #prueba(1,1,-1,-1) #prueba(0,1,-4,5) ##prueba(0,1,-4,0) ##prueba(0,4,-12,9) ##prueba(1,3,0,-4) #prueba(1,0,0,27)

**PROBLEMA 3 "graficas de soluciones exactas de ecuaciones diferenciales" **: Considere la ecuación diferencial dydx=x(4x)+h\begin{equation} \dfrac{dy}{dx}=x*(4-x)+h \end{equation} ,donde h es un parámetro . Crear en sage un interactivo gráfico que trazan varias curvas solución de la ecuación diferencial en [1,5][-1,5]X[1,5][-1,5]. crear un deslizador con h que va de 2 a 6. Apreciar la naturaleza cambiante de las curvas solución a medida que mueve el deslizador.

@interact def para(h=slider(2,6,1,default=2)): var('t') #variable independiente j=var('j') x=function('x',t) #variable dependiente c=diff(x,t)== x*(4-x)-h #2 pts=points([]) #creamos esta lista para poder hacer la grafica con condiciones iniciales lista=[]# creamos una lista con las solucuones j=1 #m=0 #n=0 while j<=10: # creamos el cilo para poder graficar las curvas solucion con las condiciones iniciales m=6*random()-1 n=6*random()-1 B=desolve(c,x,ics=[m,n])# soluciones de la ecuacion difernecial 2 con condiciones iniciales k=solve(B,x)[0].rhs()# soluciones de x(t) solo tomamos 1 lista.append(k) pts=pts+points([m,n],size=100,color='red') j=j+1 g=plot(lista,[-2,6],color='blue') (g+pts).show(ymin=-1,ymax=5)