double a = 1, Lspan = 30, Lcable = 33, fn, fdn, dfn, j;
fn = (2 * a * (Math.Sinh(Lspan / 2 * a))) - Lcable;
fdn = (2 * (Math.Sinh(Lspan / 2 * a)) - ((Lspan / 2 * a) * Math.Cosh(Lspan / 2 * a)));
dfn = -fn / fdn;
do
j = a + dfn;
while (dfn > 0.00000000001);
So that is my code. I know it is very badly written! I am a beginner. So here is my question, from above what I am trying to do is a newton raphson method..
xn+1 = xn - f(xn)/f'(xn)
Now i know how to calculate f(xn)/f'(xn) as shown above but what I have problems with is the xn part.
For those who do not know, with newton raphson you give a guess estimate for xn, lets say 1 and you fill it in..then the new answer you get becomes xn for the equation and you fill that in an so forth until you reach a limit. Now if you could follow that, Its very badly written to be honest! Then please I need your help!