(%i1) | kill(all)$ |
part 3 : solve Ricatti equation (revision 1)
[email protected],08/02/2017
(%i1) | batch(solve_rec)$ |
Ricatti equation :
(%i71) | eq1:x[i+1]*x[i]+A*x[i+1]+B*x[i]+C = 0; |
use : translational subst. remove 'Constant term'
(%i73) |
p1:x[i]=z[i]+delta; p2:x[i+1]=z[i+1]+delta; |
(%i75) |
eq2:subst(rhs(p1),lhs(p1),eq1); eq3:factor(subst(rhs(p2),lhs(p2),eq2)); |
(%i77) |
eq4:ev(eq3,z[i+1]=0,z[i]=0); eq5: factor(lhs(eq3)-lhs(eq4)=0); |
(%i81) |
eq6:t=z[i+1]*z[i]; eq7:ratsubst(lhs(eq6),rhs(eq6),eq5); eq8:coeff(lhs(eq7),z[i+1]); eq9:coeff(lhs(eq7),z[i]); |
(%i82) | eq10:(lhs(eq7)-t)/t = -t/t; |
(%i83) | eq11:ratsubst(rhs(eq6),lhs(eq6),lhs(eq10))=rhs(eq10); |
(%i86) |
eq12:part(lhs(eq11),1,1)/rhs(eq6); eq13:part(lhs(eq11),1,2)/rhs(eq6); eq14:part(lhs(eq11),2); |
(%i88) |
eq15:subst(v[i],1/z[i],eq12); eq16:subst(v[i+1],1/z[i+1],eq13); |
(%i89) | eq17:eq15+eq16=rhs(eq11); |
build in method: solve_rec
solution = general+particular
(%i90) | eq18:solve_rec(eq17,v[i]); |
second difference equation ,nonhomgeous
(%i92) |
eq19:subst(E*v[i],v[i+1],eq17); eq20:factor(eq19); |
other way to solve ⇒
solution = general+particular
general
(%i96) |
eq21:part(eq20,1,1); eq22:coeff(eq21,E); eq23:ev(eq21,E=0); eqq:rr = - eq23/eq22; |
particular:
v[i+1]*a1+v[i]*a2=f(i)
f(i) = -1 = -1 * 1^i, E=1,invers operator,found from eq20
rem : f(i) = -1*E^i,E=1
(%i98) |
eq24:solve(eq20,v[i])[1]; eq25:subst(1,E,eq24); |
(%i99) | gen1:v[i]=constant*(rhs(eqq))^i+rhs(eq25); |
general solution : x[i]
(%i100) | gen:1/(x[i]-delta)=rhs(gen1); |