Solve 3rd order non-linear ODE : $$ U''' + UU' = 0$$ with boundary conditions : $$ \begin{cases} U(1) = U(-1) = 0 , U(0) = 1 \\ U'(0) = 0. \end{cases} $$
2026-03-25 13:56:17.1774446977
On
solve 3rd order nonlinear ODE as U''' + UU' = 0 with Boundary conditions, U(1) = U(-1) = 0 and U(0) = 1, U'(0) = 0; I tried ode45 but, it didnt work.
315 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
0
On
You are in luck that the problem is symmetric and thus the 4 boundary conditions are essentially only 3 boundary condition for one of the mirror symmetric halves of the problem. In this simple example a single shooting method with the secant method as the root finder quickly finds the solution.
def f(y,t) : u,v,a = y; return [ v, a, -u*v ]
shoot = lambda a : odeint(f, [1.0,0.0,a], [0.0,1.0])[-1,0]
a = 0; fa = shoot(a);
print a, fa
b = 1; fb = shoot(b);
print b, fb
while abs(b-a)>1e-6:
c = b-fb*(b-a)/(fb-fa)
a,b,fa,fb = b,c,fb,shoot(c)
print b, fb
t = np.linspace(0,1,301)
y = odeint(f,[1.0,0.0,b], t)
plt.plot(t,y[:,0]); plt.show()
with the shooting iteration
u''(t=0;a)=a u(t=1;a)
---------------------------------
0 1.0
1 1.4559759293
-2.19309822239 -0.0263743757651
-2.13628575904 0.000678874640943
-2.13771141179 3.0597750697e-07
-2.13771205464 -3.54982709894e-12
and solution graph

Hint
$$U''' + UU' = 0$$ $$U''' + \frac 12(U^2)' = 0$$ Integrate $$U'' + \frac 12U^2= K_1$$ $$U''U' + \frac 12U^2U'= K_1U'$$ $$\frac 12(U'^2)' + \frac 16(U^3)'= K_1U'$$ Integrate again $$\frac 12(U'^2) + \frac 16U^3= K_1U+K_2$$ $$U'^2 + \frac 13U^3= K_1U+K_2 $$ Since $U'(0)=0, U(0)=1 \implies K_2=1/3-K_1$ $$U' =\pm \sqrt{ -\frac 13U^3+ K_1(U-1)+1/3}$$ $$\int \frac {dU}{\sqrt{ -\frac 13U^3+ K_1(U-1)+1/3}}=\pm t+K$$ $$....$$ Not that easy to integrate (elliptic integral)..