Trying to make an equation to do something...

MrWardy

New member
Joined
Mar 30, 2020
Messages
2
Before I start, I'd just like to say sorry if I'm not in the right category, I don't really know how I need to go about writing this equation.

Basically what I need is I have 2 variables, let's call them a and b
a = any whole number between 1 and 100
b = any other "base" number (For example purposes I would like to use 0.07

The outcome when a=100 needs to be 3 times the value of b (For example the outcome when b=0.07 should equal 0.21)
The outcome when a=1 needs to be equal to the value of a
And the outcome when a is between 2-99 needs to steadily increase by a fixed amount each time to get to our final value when a=100 (For example when a=50 the outcome needs to be 2 times, and when a=25 the outcome needs to be 1.5 times)

In conclusion, I have been trying with no success to create one equation that does this.
 
Before I start, I'd just like to say sorry if I'm not in the right category, I don't really know how I need to go about writing this equation.

Basically what I need is I have 2 variables, let's call them a and b
a = any whole number between 1 and 100
b = any other "base" number (For example purposes I would like to use 0.07

The outcome when a=100 needs to be 3 times the value of b (For example the outcome when b=0.07 should equal 0.21)
The outcome when a=1 needs to be equal to the value of a <- did you mean b here?
And the outcome when a is between 2-99 needs to steadily increase by a fixed amount each time to get to our final value when a=100 (For example when a=50 the outcome needs to be 2 times, and when a=25 the outcome needs to be 1.5 times)

In conclusion, I have been trying with no success to create one equation that does this.

It would be easier if a started at 0 rather than 1. I'm going to call it that to start with; in fact, without this change, you would be wrong at a=50 and a=25.

Call the output c. Then we have c = (multiplier)*b.

The multiplier varies linearly from 1 when a=0, to 3 when a=100. The slope is 2/100, and the "c-intercept" is 1. So we get 1 + 2(a/100), that is, 1 + a/50.

So the formula is c = (1 + a/50)b.

If we go by your request where a starts at 1, this changes to c = (1 + 2(a-1)/99)b. This can be simplified a bit to c = (97 + 2a)b/99.

Does that do what you want?
 
This is perfect! I really appreciate it, the way we were doing it was far off and probably wasn't the best way of approaching the problem, let's just say it involved a lot of guesses and check haha.

I'll just give you what we were trying to make work and it really wasn't going so well. Our equation which mostly worked, the issues with it was when a=1 c was equal to 0 which we didn't want, and it was about a thousandth or so off from the exact answer. The equation was...
(b*(1.01410141014101410149^a-1))-b
 
Since you specified linear increase ("steadily increase by a fixed amount", and your example values), I can't imagine why you used an exponential function. But what you show here doesn't even become positive until a=50; I wonder if you meant (b*(1.01410141014101410149^(a-1)))-b .

In any case, it sounds like either of my functions is suitable.
 
Top