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.










share|improve this question
























  • 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















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.










share|improve this question
























  • 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













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.










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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












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);
}





share|improve this answer























  • 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











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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

























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);
}





share|improve this answer























  • 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















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);
}





share|improve this answer























  • 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













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);
}





share|improve this answer














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);
}






share|improve this answer














share|improve this answer



share|improve this answer








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


















  • 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


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Florida Star v. B. J. F.

Error while running script in elastic search , gateway timeout

Adding quotations to stringified JSON object values