2nd order Euler-Cauchy equation ODE/Euler.mws example
> | restart; |
> | with(linalg): |
Warning, the protected names norm and trace have been redefined and unprotected
coefficients:
> | e0:=1;e1:=3;e2:=1; |
> | a0:=e0;a1:=e1-e0;a2:=e2; |
> | f:=z; |
auxilary equation:
> | ax:=a0*m^2+a1*m+a2; |
> | solve(ax=0,m); |
fundamental set:
> | y1:=exp(-z); |
> | y2:=z*exp(-z); |
Wronskians:
> | A:=matrix(2,2,[y1,y2,diff(y1,z),diff(y2,z)]); |
> | W:=simplify(det(A)); |
Variation of parameter:
> | VP1:=simplify(-y2/W*f/a0); |
> | VP2:=simplify(y1/W*f/a0); |
> | u1:=simplify(int(VP1,z)); |
> | u2:=simplify(int(VP2,z)); |
complimentary solution:
> | yc:=c[1]*y1+c[2]*y2; |
particular solution of non-homogeneous equation:
> | yp:=u1*y1+u2*y2; |
> | yp:=simplify(yp); |
General solution of non-homogeneous equation:
> | y:=yc+yp; |
> | y:=simplify(subs(z=ln(abs(x)),y)); |
Solution curves of homogeneous equation:
> | p:={seq(seq(i*x+j*x*ln(abs(x))+ln(abs(x)),i=-2..2),j=-2..2)}; |
> | plot(p,x=-4..4,color=black); |
> |
> | p:={seq(seq(i*x+j*x*ln(abs(x))+ln(abs(x))+x-2,i=-2..2),j=-2..2)}: |
> | plot(p,x=-2..2,color=black); |
> |
> |
> |
> |
> |
> |
> |