Discussion:
[Maxima-discuss] solve ode with von Neumann BC
Сергей Дорофеенко
2017-07-19 17:43:55 UTC
Permalink
Hello!

I need a help to solve an equation like this:

y'' = 0, y(x1)=a, y'(x2)=b

I do it as following, but get wrong result

(%i1) eq: 'diff(y,x,2)=0;
(%o2) 'diff(y,x,2)=0
(%i3) sol: ode2(eq,y,x);
(%o4) y=%k2*x+%k1
(%i5) bc2(sol, x=0,y=100, x=5,'diff(y,x)=10);
(%o6) y=(x*(y-100))/5+100

It is should be y=10x+100

Can Maxima do something like that?

solve(f''(x)=0, f(0)=100, f'(5)=10) --> y=10x+100

Best regards,
S.
Aleksas Domarkas
2017-07-19 21:19:31 UTC
Permalink
Example. Solve ode with von Neumann BC y'' = 0, y(0)=100, y'(5) = 10.

We define
(%i1)
ode2bc(eq,y,x,bc):=block([],
local(y),
ode2(eq,y,x),
define(y(x),rhs(%%)),
ev(bc,nouns),
solve(%%,[%k1,%k2])[1],
y=subst(%%,y(x))
)$
(%i2) eq: 'diff(y,x,2)=0$
(%i3) bc:[y(0)=100,at(diff(y(x),x),x=5)=10]$
(%i4) ode2bc(eq,y,x,bc);
(%o4) y=10*x+100

Best regards

Aleksas D
Post by Сергей Дорофеенко
Hello!
y'' = 0, y(x1)=a, y'(x2)=b
I do it as following, but get wrong result
(%i1) eq: 'diff(y,x,2)=0;
(%o2) 'diff(y,x,2)=0
(%i3) sol: ode2(eq,y,x);
(%o4) y=%k2*x+%k1
(%i5) bc2(sol, x=0,y=100, x=5,'diff(y,x)=10);
(%o6) y=(x*(y-100))/5+100
It is should be y=10x+100
Can Maxima do something like that?
solve(f''(x)=0, f(0)=100, f'(5)=10) --> y=10x+100
Best regards,
S.
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Maxima-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/maxima-discuss
Loading...