Menu

#3261 Wrong answer from odeL_ic

None
open
nobody
None
5
2016-12-12
2016-12-11
No

The following code shows an error in odeL_ic (package odes)
The last line, sol4, gives a wrong result:

load(odes)$
assume(g>0,m>0,sin(α)>0,ω>0)$
Eq:m*'diff(q,t,2)-ω^2*sin(α)^2*m*q=-cos(α)*g*m;
sol1:expand(trigsimp(ode2_ic(Eq,q,t,[0,q_0,v_0])));
sol2:expand(trigsimp(odeL_ic(Eq,q,t,[0,q_0,v_0])));
linsol:linsolve(Eq,'diff(q,t,2));
sol3:expand(trigsimp(ode2_ic(first(linsol),q,t,[0,q_0,v_0])));
sol4:expand(trigsimp(odeL_ic(first(linsol),q,t,[0,q_0,v_0])));

Daniel

Related

Bugs: #3261

Discussion

  • Daniel Volinski

    Daniel Volinski - 2016-12-11

    For some reaseon the * is not showing, it should be:
    Eq:m'diff(q,t,2)-ω^2sin(α)^2mq=-cos(α)gm;

     
  • Kris Katterjohn

    Kris Katterjohn - 2016-12-12
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,6 +1,7 @@
     The following code shows an error in odeL_ic (package odes)
     The last line, sol4, gives a wrong result:
    
    +~~~
     load(odes)$
     assume(g>0,m>0,sin(α)>0,ω>0)$
     Eq:m*'diff(q,t,2)-ω^2*sin(α)^2*m*q=-cos(α)*g*m;
    @@ -9,5 +10,6 @@
     linsol:linsolve(Eq,'diff(q,t,2));
     sol3:expand(trigsimp(ode2_ic(first(linsol),q,t,[0,q_0,v_0])));
     sol4:expand(trigsimp(odeL_ic(first(linsol),q,t,[0,q_0,v_0])));
    +~~~
    
     Daniel
    
     
    • Daniel Volinski

      Daniel Volinski - 2016-12-12

      Hi Kris,
      I understand from your email that you have the correct equation to duplicate this bug.
      Thanks,
      Daniel

      El Lunes 12 de diciembre de 2016 5:29, Kris Katterjohn <kjak@users.sf.net> escribió:
      
      • Description has changed:
        Diff:--- old
        +++ new
        @@ -1,6 +1,7 @@
        The following code shows an error in odeL_ic (package odes)
        The last line, sol4, gives a wrong result:

      +~~~
      load(odes)$
      assume(g>0,m>0,sin(α)>0,ω>0)$
      Eq:m'diff(q,t,2)-ω^2sin(α)^2mq=-cos(α)gm;
      @@ -9,5 +10,6 @@
      linsol:linsolve(Eq,'diff(q,t,2));
      sol3:expand(trigsimp(ode2_ic(first(linsol),q,t,[0,q_0,v_0])));
      sol4:expand(trigsimp(odeL_ic(first(linsol),q,t,[0,q_0,v_0])));
      +~~~

      Daniel

      • Comment:
        Wrapping the code with tildes to fix formatting. By default, asterisks cause text to be italicized. [bugs:#3261] Wrong answer from odeL_icStatus: open
        Group: None
        Created: Sun Dec 11, 2016 11:10 PM UTC by Daniel Volinski
        Last Updated: Sun Dec 11, 2016 11:13 PM UTC
        Owner: nobodyThe following code shows an error in odeL_ic (package odes)
        The last line, sol4, gives a wrong result:load(odes)$
        assume(g>0,m>0,sin(α)>0,ω>0)$
        Eq:m'diff(q,t,2)-ω^2sin(α)^2mq=-cos(α)gm;
        sol1:expand(trigsimp(ode2_ic(Eq,q,t,[0,q_0,v_0])));
        sol2:expand(trigsimp(odeL_ic(Eq,q,t,[0,q_0,v_0])));
        linsol:linsolve(Eq,'diff(q,t,2));
        sol3:expand(trigsimp(ode2_ic(first(linsol),q,t,[0,q_0,v_0])));
        sol4:expand(trigsimp(odeL_ic(first(linsol),q,t,[0,q_0,v_0])));
        DanielSent from sourceforge.net because you indicated interest in https://sourceforge.net/p/maxima/bugs/3261/To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
       

      Related

      Bugs: #3261

  • Kris Katterjohn

    Kris Katterjohn - 2016-12-12

    Wrapping the code with tildes to fix formatting. By default, asterisks cause text to be italicized.

     
  • Aleksas

    Aleksas - 2016-12-12

    Functions odeL, odeL_ic solves differential equations Ly = f,
    where L is linear differential operator with constant coefficients.
    For example y'' + y = 1, y(0)=1, y'(0)=1
    (%i1) load(odes)$
    (%i2) eq:'diff(y,x,2)+y=1$
    (%i3) eq1:'diff(y,x,2)=1-y$

    correct:
    (%i4) odeL(eq,y,x);
    (%o4) y=C2sin(x)+C1cos(x)+1
    (%i5) odeL_ic(eq,y,x,[0,1,1]);
    (%o5) y=sin(x)+1

    wrong:
    (%i6) odeL_ic(eq1,y,x,[0,1,1]);
    (%o6) y=x+1
    (%i7) odeL(eq1,y,x);
    (%o7) y=C2*x+C1+1

    I want to fix it.

    best
    Aleksas D

     

Log in to post a comment.

MongoDB Logo MongoDB