## ploting a 'complete' catenary curve by using a solver

### Markus Krug (view profile)

on 20 Jun 2013
Hi,
the ODE for the catenary curve can be expressed as: y'' = a*sqrt(1+(y'^2))
If I transform this quation to a MATLAB ODE system to be solved by one of the ODE solvers I get something like:
function [ dy] = catenary_curve( x, y )
a = 1;
dy(1,1) = y(2);
dy(2,1) = a*sqrt(1+(y(2)^2));
end
[x,y] = ode45('catenary_curve',[0,2],[0 0]);
If I solve this equation I always get only the right branch of the catenary curve. I guess the reason is that there is no x in the ODE equation and therefore it always starts at the lowest point of the curve. Does anyone has an idea how I should setup my function file or my command window commands to get also the left branch of the curve?
The same questions applies to a Simulink representation. It is easy to model the equation. However the output for y(x) is always only the right branch.
Best Regards
Markus

### Roger Stafford (view profile)

on 20 Jun 2013

As you have written the differential equation with the given initial conditions and with x increasing from 0 to 2, there is no other "branch". The solution is uniquely determined. With a = +1 it is
y = cosh(x)-1
and nothing else.
You would get a different solution if you took the negative of the square root or if you set a equal to minus one - that is, if your differential equation were:
(y")^2 = 1 + (y')^2
and you chose the negative root for y". Or, if x was set to decrease from 0 to -2, the solution would of course be different.