# Iteration function

1. Oct 8, 2008

### MrReds

Hallo Everybody !

I have tried to look in the previous posts, but I haven’t find something useful.
I am looking for an iteration function to help me to solve following issue.

I have got three values, let’s say
A which is a constant (it is determined), that can be positive, negative or 0
B which is variable that can be positive, negative or 0
C which is variable that varies between two fixed values (typically 0 and 1).

The scope of the function would be to vary C in order to get B as close as possible to A.
C and A are not linked by any relation, let’s say that A is a target value.
C and B are proportional, but they are not linked by a known function.

Therefore the algorithm should :
Vary C of a value, then verify the error between A and B and should this error be positive or negative, vary C consequently.
I hope to have been clear enough.

Is there anybody who knows a similar algorithm ?

Many thanks for your help !

2. Oct 8, 2008

### Tac-Tics

This does not make much sense, the way you have described it. What do you mean, for instance, by "not linked by any relation" and "not liked by a known function"? Even in this context "C and B are proportional" doesn't make any sense.

Perhaps, you could try describing to us what you want your algorithm to do without trying to describe how to actually program it. If you are working with an associated problem that you need this algorithm for, let us know what it is.