|
From: Stavros M. <mac...@gm...> - 2023-07-08 19:23:32
|
For the last question, try scanmap('factor,f2).
On Sat, Jul 8, 2023, 15:06 Eduardo Ochs <edu...@gm...> wrote:
> Hi all,
>
> I am trying to translate to Maxima some exercises that I gave to my
> students. In this code
>
> edo : y_xx + 4*y_x + 29*y = 0;
> edo2 : subst([y_xx='diff(y,x,2), y_x='diff(y,x) ], edo);
> edo2(f) := subst([y_xx= diff(f,x,2), y_x= diff(f,x), y=f], edo);
> sols : ode2(edo2,y,x);
> sol0 : rhs(ode2(edo2,y,x));
> f3 : subst([%k1=0, %k2=1], sol0);
> f4 : subst([%k1=1, %k2=0], sol0);
> f1 : expand(exponentialize(f3 + %i*f4));
> f2 : expand(exponentialize(f3 - %i*f4));
> expand(edo2(f1));
> expand(edo2(f2));
> expand(edo2(f3));
> expand(edo2(f4));
> display2d:false$
> sol0;
> f1;
> f2;
> f3;
> f4;
>
> ode2 prefers to return the basic real solutions of the ODE "edo" - see
> sol0, f3 and f4 here...
>
> (%i15) sol0;
> (%o15) %e^-(2*x)*(%k1*sin(5*x)+%k2*cos(5*x))
> (%i16) f1;
> (%o16) %e^(5*%i*x-2*x)
> (%i17) f2;
> (%o17) %e^((-5*%i*x)-2*x)
> (%i18) f3;
> (%o18) %e^-(2*x)*cos(5*x)
> (%i19) f4;
> (%o19) %e^-(2*x)*sin(5*x)
> (%i20)
>
> ...and I had to do some (simple) juggling to obtain the basic complex
> solutions, that are f1 and f2.
>
> Is there a flag that makes ode2 prefer the complex solutions instead
> of the real ones? And, btw, how do I make Maxima move the x in
>
> %e^((-5*%i*x)-2*x)
>
> outside, and transform that expression into this?
>
> %e^((-2-5*%i)*x)
>
> Thanks in advance! =)
> Eduardo Ochs
> http://anggtwu.net/eev-maxima.html
>
> _______________________________________________
> Maxima-discuss mailing list
> Max...@li...
> https://lists.sourceforge.net/lists/listinfo/maxima-discuss
>
|