Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
transcendental equation

Subject: transcendental equation

From: John Wise

Date: 25 Sep, 2010 18:28:06

Message: 1 of 3

I have tried to solve the following transcendental equation using Newton method but it doesnot work, can anyone figure it out please
f(x)=x-a*log(1+b+b*c/(x-c)) ,,,a,b,c =0 in the begining then they change

function [x]=newt(a,b,c)
x = 0.1;
f=x-a*log(1+b+b*c/(x-c));
Tol = 0.0000001;
count = 0;
dx=1; %this is a fake value so that the while loop will execute
while (dx > Tol || abs(f)>Tol)
    count = count + 1;
    fprime =1-a*(-(x-c)^-2)/(1+b+b*c/(x-c));
    xnew = x - (f/fprime); % compute the new value of x
    dx=abs(x-xnew); % compute how much x has changed since last step
    x = xnew;
   f=x-a*log(1+b+b*c/(x-c)); % compute the new value of f(x)
end
end

Subject: transcendental equation

From: Greg Heath

Date: 27 Sep, 2010 01:52:12

Message: 2 of 3

On Sep 25, 2:28 pm, "John Wise" <khabu...@hotmail.co.uk> wrote:
> I have tried to solve the following  transcendental equation using Newton method but it doesnot work, can anyone figure it out please
> f(x)=x-a*log(1+b+b*c/(x-c)) ,,,a,b,c =0 in the begining then they change

What range of x?
Is c in that interval?

Greg

Subject: transcendental equation

From: Roger Stafford

Date: 27 Sep, 2010 02:10:05

Message: 3 of 3

"John Wise" <khabuman@hotmail.co.uk> wrote in message <i7levm$ioa$1@fred.mathworks.com>...
> I have tried to solve the following transcendental equation using Newton method but it doesnot work, can anyone figure it out please
> f(x)=x-a*log(1+b+b*c/(x-c)) ,,,a,b,c =0 in the begining then they change
>
> function [x]=newt(a,b,c)
> x = 0.1;
> f=x-a*log(1+b+b*c/(x-c));
> Tol = 0.0000001;
> count = 0;
> dx=1; %this is a fake value so that the while loop will execute
> while (dx > Tol || abs(f)>Tol)
> count = count + 1;
> fprime =1-a*(-(x-c)^-2)/(1+b+b*c/(x-c));
> xnew = x - (f/fprime); % compute the new value of x
> dx=abs(x-xnew); % compute how much x has changed since last step
> x = xnew;
> f=x-a*log(1+b+b*c/(x-c)); % compute the new value of f(x)
> end
> end
- - - - - - - -
  There is an error in your expression for the derivative of f(x). That could cause your iteration to not converge properly or not converge at all.

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us