How to get Y value from exponential function that starts at 0,0 and ends at 100,1000
up vote
2
down vote
favorite
It's been a while since my math classes so here's the question, any help is appreciated.
I'll be implementing the function in javascript also.
I have an X range of 0-100 and a set max Y of 10000 (which may change).
This is an exponential function and the closer X is to 100, the closer it gets to Y max and x=100 is y=10000. So my question is, what is the function that can handle this? Ideally I'd like to have something to control the steepness of the curve as well.
What I have in mind :
graph
Thanks.
javascript function math graph linear-algebra
|
show 1 more comment
up vote
2
down vote
favorite
It's been a while since my math classes so here's the question, any help is appreciated.
I'll be implementing the function in javascript also.
I have an X range of 0-100 and a set max Y of 10000 (which may change).
This is an exponential function and the closer X is to 100, the closer it gets to Y max and x=100 is y=10000. So my question is, what is the function that can handle this? Ideally I'd like to have something to control the steepness of the curve as well.
What I have in mind :
graph
Thanks.
javascript function math graph linear-algebra
Do you want to know how to get the Y value in javascript?
– Donny Verduijn
Nov 10 at 22:36
Yeah, or just the expression, I can manage putting it in js from there. Whatever is easiest for you.
– LAZ
Nov 10 at 22:38
1
Because otherwise, this question should be asked on math.stackexchange.com
– Donny Verduijn
Nov 10 at 22:40
Well it will be used in javascript
– LAZ
Nov 10 at 22:43
Programming goes hand to wand with maths, thus this is really just a math question... this indeed should be asked on math.stackexchange.com
– Akxe
Nov 11 at 1:57
|
show 1 more comment
up vote
2
down vote
favorite
up vote
2
down vote
favorite
It's been a while since my math classes so here's the question, any help is appreciated.
I'll be implementing the function in javascript also.
I have an X range of 0-100 and a set max Y of 10000 (which may change).
This is an exponential function and the closer X is to 100, the closer it gets to Y max and x=100 is y=10000. So my question is, what is the function that can handle this? Ideally I'd like to have something to control the steepness of the curve as well.
What I have in mind :
graph
Thanks.
javascript function math graph linear-algebra
It's been a while since my math classes so here's the question, any help is appreciated.
I'll be implementing the function in javascript also.
I have an X range of 0-100 and a set max Y of 10000 (which may change).
This is an exponential function and the closer X is to 100, the closer it gets to Y max and x=100 is y=10000. So my question is, what is the function that can handle this? Ideally I'd like to have something to control the steepness of the curve as well.
What I have in mind :
graph
Thanks.
javascript function math graph linear-algebra
javascript function math graph linear-algebra
edited Nov 10 at 22:27
asked Nov 10 at 22:11
LAZ
385
385
Do you want to know how to get the Y value in javascript?
– Donny Verduijn
Nov 10 at 22:36
Yeah, or just the expression, I can manage putting it in js from there. Whatever is easiest for you.
– LAZ
Nov 10 at 22:38
1
Because otherwise, this question should be asked on math.stackexchange.com
– Donny Verduijn
Nov 10 at 22:40
Well it will be used in javascript
– LAZ
Nov 10 at 22:43
Programming goes hand to wand with maths, thus this is really just a math question... this indeed should be asked on math.stackexchange.com
– Akxe
Nov 11 at 1:57
|
show 1 more comment
Do you want to know how to get the Y value in javascript?
– Donny Verduijn
Nov 10 at 22:36
Yeah, or just the expression, I can manage putting it in js from there. Whatever is easiest for you.
– LAZ
Nov 10 at 22:38
1
Because otherwise, this question should be asked on math.stackexchange.com
– Donny Verduijn
Nov 10 at 22:40
Well it will be used in javascript
– LAZ
Nov 10 at 22:43
Programming goes hand to wand with maths, thus this is really just a math question... this indeed should be asked on math.stackexchange.com
– Akxe
Nov 11 at 1:57
Do you want to know how to get the Y value in javascript?
– Donny Verduijn
Nov 10 at 22:36
Do you want to know how to get the Y value in javascript?
– Donny Verduijn
Nov 10 at 22:36
Yeah, or just the expression, I can manage putting it in js from there. Whatever is easiest for you.
– LAZ
Nov 10 at 22:38
Yeah, or just the expression, I can manage putting it in js from there. Whatever is easiest for you.
– LAZ
Nov 10 at 22:38
1
1
Because otherwise, this question should be asked on math.stackexchange.com
– Donny Verduijn
Nov 10 at 22:40
Because otherwise, this question should be asked on math.stackexchange.com
– Donny Verduijn
Nov 10 at 22:40
Well it will be used in javascript
– LAZ
Nov 10 at 22:43
Well it will be used in javascript
– LAZ
Nov 10 at 22:43
Programming goes hand to wand with maths, thus this is really just a math question... this indeed should be asked on math.stackexchange.com
– Akxe
Nov 11 at 1:57
Programming goes hand to wand with maths, thus this is really just a math question... this indeed should be asked on math.stackexchange.com
– Akxe
Nov 11 at 1:57
|
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
The formula would be a variant of y = a * exp(b * x), where you can play around with a and b to get the curve / endpoints you want. For 100/100.000, you could use:
y = 5 * exp(0.0990348754944493 * x). In Javascript that would look something like:
function getExponent(x) {
return 5 * Math.pow(0.0990348754944493*x);
}
or if you want a and b to be variables:
function getExponent(x,a,b) {
return a * Math.pow(b*x);
}
I want to be able to provide x and the y value at x=100. I can't go in the code and edit the floats every time I have a different y max. For example, what is Y when X = 56 when the exponential starts at (0,0) and intercepts with the point (100,10000)? The range of 0-100 will never change, the steepness I will play with but eventually will be static and the "max" Y value will vary. Think of it like a slider, you slide it up to the max which in this case is 10000. But some sliders go up to 100000 or a million, etc.
– LAZ
Nov 11 at 2:53
If you want to make the steepness static, we can assume b is (becomes) fixed. Since y_max and x_max are known (although y_max is varying), you can use a function to calculate a: a = exp(b * x_max) / y_max = exp(b * 100) / y_max Then... whenever you have fixed b, the interceptions (0,0) and (100, y_max) will always hold.
– CIAndrews
Nov 11 at 3:20
Thanks, makes sense but Math.pow() requires two args, and exp() doesn't exist in my environment. I did try Math.exp(b * x_max) / y_max but that returns an 18 digit number.
– LAZ
Nov 11 at 3:53
Ah yes, my b was incorrect. Changed it to 0.0990348754944493, that results exactly in y = 100.000 for x = 100 and a = 5
– CIAndrews
Nov 11 at 4:18
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
The formula would be a variant of y = a * exp(b * x), where you can play around with a and b to get the curve / endpoints you want. For 100/100.000, you could use:
y = 5 * exp(0.0990348754944493 * x). In Javascript that would look something like:
function getExponent(x) {
return 5 * Math.pow(0.0990348754944493*x);
}
or if you want a and b to be variables:
function getExponent(x,a,b) {
return a * Math.pow(b*x);
}
I want to be able to provide x and the y value at x=100. I can't go in the code and edit the floats every time I have a different y max. For example, what is Y when X = 56 when the exponential starts at (0,0) and intercepts with the point (100,10000)? The range of 0-100 will never change, the steepness I will play with but eventually will be static and the "max" Y value will vary. Think of it like a slider, you slide it up to the max which in this case is 10000. But some sliders go up to 100000 or a million, etc.
– LAZ
Nov 11 at 2:53
If you want to make the steepness static, we can assume b is (becomes) fixed. Since y_max and x_max are known (although y_max is varying), you can use a function to calculate a: a = exp(b * x_max) / y_max = exp(b * 100) / y_max Then... whenever you have fixed b, the interceptions (0,0) and (100, y_max) will always hold.
– CIAndrews
Nov 11 at 3:20
Thanks, makes sense but Math.pow() requires two args, and exp() doesn't exist in my environment. I did try Math.exp(b * x_max) / y_max but that returns an 18 digit number.
– LAZ
Nov 11 at 3:53
Ah yes, my b was incorrect. Changed it to 0.0990348754944493, that results exactly in y = 100.000 for x = 100 and a = 5
– CIAndrews
Nov 11 at 4:18
add a comment |
up vote
1
down vote
accepted
The formula would be a variant of y = a * exp(b * x), where you can play around with a and b to get the curve / endpoints you want. For 100/100.000, you could use:
y = 5 * exp(0.0990348754944493 * x). In Javascript that would look something like:
function getExponent(x) {
return 5 * Math.pow(0.0990348754944493*x);
}
or if you want a and b to be variables:
function getExponent(x,a,b) {
return a * Math.pow(b*x);
}
I want to be able to provide x and the y value at x=100. I can't go in the code and edit the floats every time I have a different y max. For example, what is Y when X = 56 when the exponential starts at (0,0) and intercepts with the point (100,10000)? The range of 0-100 will never change, the steepness I will play with but eventually will be static and the "max" Y value will vary. Think of it like a slider, you slide it up to the max which in this case is 10000. But some sliders go up to 100000 or a million, etc.
– LAZ
Nov 11 at 2:53
If you want to make the steepness static, we can assume b is (becomes) fixed. Since y_max and x_max are known (although y_max is varying), you can use a function to calculate a: a = exp(b * x_max) / y_max = exp(b * 100) / y_max Then... whenever you have fixed b, the interceptions (0,0) and (100, y_max) will always hold.
– CIAndrews
Nov 11 at 3:20
Thanks, makes sense but Math.pow() requires two args, and exp() doesn't exist in my environment. I did try Math.exp(b * x_max) / y_max but that returns an 18 digit number.
– LAZ
Nov 11 at 3:53
Ah yes, my b was incorrect. Changed it to 0.0990348754944493, that results exactly in y = 100.000 for x = 100 and a = 5
– CIAndrews
Nov 11 at 4:18
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
The formula would be a variant of y = a * exp(b * x), where you can play around with a and b to get the curve / endpoints you want. For 100/100.000, you could use:
y = 5 * exp(0.0990348754944493 * x). In Javascript that would look something like:
function getExponent(x) {
return 5 * Math.pow(0.0990348754944493*x);
}
or if you want a and b to be variables:
function getExponent(x,a,b) {
return a * Math.pow(b*x);
}
The formula would be a variant of y = a * exp(b * x), where you can play around with a and b to get the curve / endpoints you want. For 100/100.000, you could use:
y = 5 * exp(0.0990348754944493 * x). In Javascript that would look something like:
function getExponent(x) {
return 5 * Math.pow(0.0990348754944493*x);
}
or if you want a and b to be variables:
function getExponent(x,a,b) {
return a * Math.pow(b*x);
}
edited Nov 11 at 4:18
answered Nov 11 at 1:48
CIAndrews
1766
1766
I want to be able to provide x and the y value at x=100. I can't go in the code and edit the floats every time I have a different y max. For example, what is Y when X = 56 when the exponential starts at (0,0) and intercepts with the point (100,10000)? The range of 0-100 will never change, the steepness I will play with but eventually will be static and the "max" Y value will vary. Think of it like a slider, you slide it up to the max which in this case is 10000. But some sliders go up to 100000 or a million, etc.
– LAZ
Nov 11 at 2:53
If you want to make the steepness static, we can assume b is (becomes) fixed. Since y_max and x_max are known (although y_max is varying), you can use a function to calculate a: a = exp(b * x_max) / y_max = exp(b * 100) / y_max Then... whenever you have fixed b, the interceptions (0,0) and (100, y_max) will always hold.
– CIAndrews
Nov 11 at 3:20
Thanks, makes sense but Math.pow() requires two args, and exp() doesn't exist in my environment. I did try Math.exp(b * x_max) / y_max but that returns an 18 digit number.
– LAZ
Nov 11 at 3:53
Ah yes, my b was incorrect. Changed it to 0.0990348754944493, that results exactly in y = 100.000 for x = 100 and a = 5
– CIAndrews
Nov 11 at 4:18
add a comment |
I want to be able to provide x and the y value at x=100. I can't go in the code and edit the floats every time I have a different y max. For example, what is Y when X = 56 when the exponential starts at (0,0) and intercepts with the point (100,10000)? The range of 0-100 will never change, the steepness I will play with but eventually will be static and the "max" Y value will vary. Think of it like a slider, you slide it up to the max which in this case is 10000. But some sliders go up to 100000 or a million, etc.
– LAZ
Nov 11 at 2:53
If you want to make the steepness static, we can assume b is (becomes) fixed. Since y_max and x_max are known (although y_max is varying), you can use a function to calculate a: a = exp(b * x_max) / y_max = exp(b * 100) / y_max Then... whenever you have fixed b, the interceptions (0,0) and (100, y_max) will always hold.
– CIAndrews
Nov 11 at 3:20
Thanks, makes sense but Math.pow() requires two args, and exp() doesn't exist in my environment. I did try Math.exp(b * x_max) / y_max but that returns an 18 digit number.
– LAZ
Nov 11 at 3:53
Ah yes, my b was incorrect. Changed it to 0.0990348754944493, that results exactly in y = 100.000 for x = 100 and a = 5
– CIAndrews
Nov 11 at 4:18
I want to be able to provide x and the y value at x=100. I can't go in the code and edit the floats every time I have a different y max. For example, what is Y when X = 56 when the exponential starts at (0,0) and intercepts with the point (100,10000)? The range of 0-100 will never change, the steepness I will play with but eventually will be static and the "max" Y value will vary. Think of it like a slider, you slide it up to the max which in this case is 10000. But some sliders go up to 100000 or a million, etc.
– LAZ
Nov 11 at 2:53
I want to be able to provide x and the y value at x=100. I can't go in the code and edit the floats every time I have a different y max. For example, what is Y when X = 56 when the exponential starts at (0,0) and intercepts with the point (100,10000)? The range of 0-100 will never change, the steepness I will play with but eventually will be static and the "max" Y value will vary. Think of it like a slider, you slide it up to the max which in this case is 10000. But some sliders go up to 100000 or a million, etc.
– LAZ
Nov 11 at 2:53
If you want to make the steepness static, we can assume b is (becomes) fixed. Since y_max and x_max are known (although y_max is varying), you can use a function to calculate a: a = exp(b * x_max) / y_max = exp(b * 100) / y_max Then... whenever you have fixed b, the interceptions (0,0) and (100, y_max) will always hold.
– CIAndrews
Nov 11 at 3:20
If you want to make the steepness static, we can assume b is (becomes) fixed. Since y_max and x_max are known (although y_max is varying), you can use a function to calculate a: a = exp(b * x_max) / y_max = exp(b * 100) / y_max Then... whenever you have fixed b, the interceptions (0,0) and (100, y_max) will always hold.
– CIAndrews
Nov 11 at 3:20
Thanks, makes sense but Math.pow() requires two args, and exp() doesn't exist in my environment. I did try Math.exp(b * x_max) / y_max but that returns an 18 digit number.
– LAZ
Nov 11 at 3:53
Thanks, makes sense but Math.pow() requires two args, and exp() doesn't exist in my environment. I did try Math.exp(b * x_max) / y_max but that returns an 18 digit number.
– LAZ
Nov 11 at 3:53
Ah yes, my b was incorrect. Changed it to 0.0990348754944493, that results exactly in y = 100.000 for x = 100 and a = 5
– CIAndrews
Nov 11 at 4:18
Ah yes, my b was incorrect. Changed it to 0.0990348754944493, that results exactly in y = 100.000 for x = 100 and a = 5
– CIAndrews
Nov 11 at 4:18
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243930%2fhow-to-get-y-value-from-exponential-function-that-starts-at-0-0-and-ends-at-100%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you want to know how to get the Y value in javascript?
– Donny Verduijn
Nov 10 at 22:36
Yeah, or just the expression, I can manage putting it in js from there. Whatever is easiest for you.
– LAZ
Nov 10 at 22:38
1
Because otherwise, this question should be asked on math.stackexchange.com
– Donny Verduijn
Nov 10 at 22:40
Well it will be used in javascript
– LAZ
Nov 10 at 22:43
Programming goes hand to wand with maths, thus this is really just a math question... this indeed should be asked on math.stackexchange.com
– Akxe
Nov 11 at 1:57