From: serge de m. <sde...@gm...> - 2016-07-29 14:16:57
|
Hello, Indeed, bc2 seems to have an issue with the fact that the second boundary condition is expressed as a function of y, or at least I wasn't able to use bc2 to solve the equation. But you can use maxima to assist you in doing what you did by hand: subst([x=0,y=0],sol); gives you an equation in %k2, which you can solve: k2:solve(%)[1]; Now, for the second boundary condition, we substitute the solution for the differential equation and k2 into it: subst([sol,k2],-y='diff(y,x)); This equation still has an unevaluated diff, which we can evaluate like this: ev(%,nouns); This is only valid for x=1 (as per the second boundary condition), so: subst(x=1,%); This gives an equation in %k1, which we can solve: k2:solve(%)[1]; Finally, we can compute the solution to the boundary condition problem by putting k1 and k2 back into sol: subst([k1,k2],sol); serge On Thu, Jul 28, 2016 at 10:32 PM, Pablo Fonovich <Pab...@ho...> wrote: > Hi: > > I'm a begginer with maxima, and i want to solve this second order > differential equation with boundary conditions: > > > 'diff(y,x,2)+y+1=0 > > y=0 for x=0 > > 'diff(y,x)=-y for x=1 > > > Can i do this with bc2? > > i tried the following: > > > eq: 'diff(y,x,2)+y+1=0; > > sol: ode2(eq,y,x); > > bc2: bc2(sol,x=0,y=0,x=1,'diff(y,x)=-y); > > > but i'm getting a confusing result. > > > By using the output of sol: ode2(eq,y,x); and applying the conditions by > hand i arrived to the following solution: > > y=-1.2676*sen(x)+cos(x)-1 > > > How could i achieve this with maxima? > > > Thanks a lot > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > |