[Maxima] solving for initial conditions

reyssat eric.reyssat at math.unicaen.fr
Thu Apr 29 11:30:25 CDT 2010

```Le 29/04/2010 16:06, Alexandre Campos a écrit :
> Dear all,
> how can I solve my system, so solve, linsolve,dsolve didn't work ...
> alexandre
>
> kill(all);
>
> x:
> Xo*%e^(-cita*omega_n*t)*cos(omega_n*(1-cita^2)^(0.5)*t-fio)+X*cos(omega_f*t-fi);
> dx: diff(x,t);
>
> eq1: ev(x, t=0)=0;
> eq2: ev(dx, t=0)=0;
>
> res: solve([eq1,eq2],[Xo,fio]);
Express everything polynomially in terms of Xo and c=cos(fio) and then
use solve. To get these polynomials, multiply by conjugate (this gives
extra solutions to be erased after numerical inspection) :

(%i5) eq2conj:subst(-sin(fio),sin(fio),eq2);
(%o5)
sin(fi)*omega_f*X-(1-cita^2)^0.5*sin(fio)*omega_n*Xo-cita*cos(fio)*omega_n*Xo
= 0
(%i6) eq2b:subst(1-cos(fio)^2,sin(fio)^2,expand(eq2*eq2conj));
(%o6)
sin(fi)^2*omega_f^2*X^2-2*cita*sin(fi)*cos(fio)*omega_f*omega_n*Xo*X+cita^2*cos(fio)^2*omega_n^2*Xo^2+cita^2*(1-cos(fio)^2)*omega_n^2*Xo^2
-(1-cos(fio)^2)*omega_n^2*Xo^2
= 0
(%i7) solve([eq1,eq2b],[Xo,cos(fio)]);
(%o7) [[Xo =
sqrt(cos(fi)^2*omega_n^2+2*cita*cos(fi)*sin(fi)*omega_f*omega_n+sin(fi)^2*omega_f^2)*X/(sqrt(1-cita)*sqrt(cita+1)*omega_n),
cos(fio) = -cos(fi)*omega_n

*sqrt(1/(cos(fi)^2*omega_n^2+2*cita*cos(fi)*sin(fi)*omega_f*omega_n+sin(fi)^2*omega_f^2)

-cita^2/(cos(fi)^2*omega_n^2+2*cita*cos(fi)*sin(fi)*omega_f*omega_n+sin(fi)^2*omega_f^2))],
[Xo =
-sqrt(cos(fi)^2*omega_n^2+2*cita*cos(fi)*sin(fi)*omega_f*omega_n+sin(fi)^2*omega_f^2)*X/(sqrt(1-cita)*sqrt(cita+1)*omega_n),
cos(fio) = cos(fi)*omega_n

*sqrt(1/(cos(fi)^2*omega_n^2+2*cita*cos(fi)*sin(fi)*omega_f*omega_n+sin(fi)^2*omega_f^2)

-cita^2/(cos(fi)^2*omega_n^2+2*cita*cos(fi)*sin(fi)*omega_f*omega_n+sin(fi)^2*omega_f^2))]]

finally you get fio using acos(cos(fio)).

Eric
```