I have a general question about the "do...until" iteration until a condition is met.
Let's say that I have a variable x
, y
and z
, where:
x0 = function(y0)
I ran the code, and from the function, I got a value x0
from an inputted variable value y0
.
With the value of x0
, now I have to update y0
and get a new value of y1=function(x0)
.
The process is repeated in the next step, and now I should get:
x1 = function(y1)
and again, from x1
, to update y1
and get a new value of y2=function(x1)
.
The iteration should stop when the condition of x(i-1) - x(i) =~ 0
is met,
and after that, it should continue with a new calculation, which will have:
z = function(y(i))
I'm new to these "do...until" iterations, and my main problem is setting up the condition.
Here is a picture of the results of the example that I solved by running the code a few times manually iterating:
I didn't post the code for the functions because they are long. I really appreciate any help you can provide.