non-linear coupled second order ODE with matlab

Dear All,
In attempt to compare an asymptotic solution to the exact solution of Reissner theory of elasticity, I will need to solve the following coupled equation :
D, A and q are constant and the boundary conditions are of clumped boundary conditions
I would be glad if there are hints to how to implement this in matlab.
Thanks a lot!

5 Comments

I tried bvp4c, but didn't get a result. Also MATLAB wants 4 boundary conditions
I did all i can, im so sorry (
Hi Thanks for the quick response,
The fourth boundary condition is how can I add it to the attached file?
thanks again!
Torsten
Torsten on 2 Jul 2019
Edited: Torsten on 2 Jul 2019
function res = bc4(ul, ur)
res = [ur(1)
ur(2)
ur(3)
ul(2)];
end
I get this error...
Error using bvp4c (line 251)
Unable to solve the collocation equations -- a singular Jacobian encountered.
You divide by r^2 and r. That means that you have to start solving at r>0.

Sign in to comment.

 Accepted Answer

According to Torsten suggestions
function bvp4c_mathworks
rspan = [0.05 1];
init = zeros(1,4);
solinit = bvpinit(rspan,init);
sol = bvp4c(@ode4,@bc4,solinit);
r = sol.x;
Nr = sol.y(1,:);
b = sol.y(2,:);
plot(r,Nr)
hold on
plot(r,b,'r')
hold off
legend('Nr(r)','\beta(r)')
end
function du = ode4(r,u)
Nr = u(1);
b = u(2); % beta
dNr = u(3); % d(Nr)/dr
db = u(4); % d(beta)/dr
cb = cos(b); % cos(beta)
sb = sin(b); % sin(beta)
A = 0.5;
D = 1.7;
q = 1;
du(1) = dNr;
du(2) = db;
du(3) = -(3*r*dNr + Nr + (1-cb)/A)/r^2;
du(4) = -(r*Nr*sb + r^2*q*cb)/D - db + sb/r;
du(4) = du(4)/r;
end
function res = bc4(u0, ur)
res = [ur(1)-0
ur(2)-0
ur(3)-0
u0(2)-0];
end
Accept my answer please

3 Comments

Hi, sorry to comeback on this point.
But how can I specify a boundary condition of this form :
as and
than I would like to evaluate
I am trying to reproduce the results of this paper (see attachement)
You had Nr before, what is u here?
The authors (see attachement) define u as and
which is not clear to me who to solve it. Any hint?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!