-5
a=2

b=3

c=7

d=5

w=14

Find x using newton raphson method in matlab

enter code here
4.w.d^2.(1-x^2)^2=a.b.c^3.x.sqrt(pi^2.(1-x^2)^2+16.x^2)
zellus
  • 9,617
  • 5
  • 39
  • 56
Arslan Ahmad
  • 1
  • 1
  • 2
  • 5
    I have a very, very strong suspicion that this needs a "homework" tag. Also, what have you tried? What specific problems are you having? We aren't here to code for you, we're here to help. – Corbin Mar 08 '12 at 06:01
  • Instead of giving a -1 and further downvotes. Please migrate this question to http://math.stackexchange.com/. I dont have that privilige. – Yavar Mar 08 '12 at 07:16
  • @Yavar: this is very much a Matlab question, and a badly formulated one at that. I don't think this question would be of interest to math.stackexchange.com, nor that the answers would be of use to the OP. – Jonas Mar 08 '12 at 15:01
  • @jonas: you are absolutely right i think when the question was posted it did not have matlab in subject so commented like that. – Yavar Mar 08 '12 at 15:25

1 Answers1

1

There is a ton of posts similar to this, even on StackOverflow, like this one, or this one. Even more on the web like Matlab Central, or other educational sites like here. So, I think you could have come to the table a little more prepared. I'll put my two cents in here as far as the method I like the best.

function x = newton(f,dfdx,x0,tolerance)
err = Inf;
x = x0;
while abs(err) > tolerance
   xPrev = x;
   x = xPrev - f(xPrev)./dfdx(xPrev);
   % stop criterion: (f(x) - 0) < tolerance
   err = f(x); % 
   % stop criterion: change of x < tolerance
   % err = x - xPrev;
end

f = @(x) ((x-4).^2-4);
dfdx = @(x)(2.*(x-4));
x0 = 1;
xRoot = newton(@f,@dfdx,x0,1e-10);

f(x) = 4wd2(1-x2)2 - abc3x√(π2*(1-x2)2+16*x2)

So just differentiate the above equation with respect to x and then you have your df/dx. Plug the equations into the file handles and run the routine! Also, I'm fine with moving this to SE Math, but I don't know how to do that either. :-)

Community
  • 1
  • 1
macduff
  • 4,655
  • 18
  • 29