Message Boards Message Boards

0
|
7553 Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Loop with definite scope of alpha until the result no longer change?

Posted 8 years ago

I have the following problem. My alpha must be between {0,1}. The function is

f[x_] = Log[x] + x - 0.5;  
y[x_] = x - alpha*f[x]/f'[x];
0.75 + 4 (y[0.75] - 0.75) f[0.75]/(3 f[0.75] - 2 f[y[0.75]])

I should make a loop with all the values between 0 and 1 until the end result no longer change - it must happen automatic. I have tried with while, do and fixed point, but I did not get any result. I should get for Alpha = 0.5046 and for end result 0.766249. Thanks in advance

POSTED BY: Reni Todorova
5 Replies
Posted 8 years ago
POSTED BY: Reni Todorova

Sure, you can apply FixedPoint[] as well as FixedPointList[]:

f[x_] := Log[x] + x - 0.5
y[x_] := x - \[Alpha] f[x]/f'[x]

Table[Print["\[Alpha] = ", \[Alpha], " ", 
  FixedPoint[# + (4 (y[#] - #) f[#])/(3 f[#] - 2 f[y[#]]) &, 
   0.75]], {\[Alpha], 0, 1, 0.01}]
Posted 8 years ago

Thank you very much! You save me. Have a nice day :)

POSTED BY: Reni Todorova

Please make sure you know how to format code properly: https://wolfr.am/READ-1ST

I have tried with while, do and fixed point, but I did not get the right result.

Please edit your post and add code you have tried as you mention above.

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract