How to find the positive maximum value of a function

In summary, the conversation is about a code that was written in an unknown language to plot a function with a long expression. The function's maximum value depends on the range of x and the conversation includes a request for clarification on the equation and its source.
  • #1
Keysa
1
0
TL;DR Summary
I want to find the positive maximum value of a function, but so far I always ended up with either a negative value or the value doesn't even show up.
This is the code that i wrote

Clear["Global`*"]
Z = 500;
W = 100000;
G = 250;
H = 100;
K = 0.5;
T = 30;
L = 4000;
P = 5;
S = 2.5;
Y = 1;
A = 0.1;
V = 2.5;
J = 8000;
f[x_] := 1/
x {(J*Z*x*(2*Y - x))/(
2*Y) - ((W + T*G) + ((L + T*P)*2*Z*Y*(1 - ((Y - x)/Y)^1.5))/
3 + (H + T*S + A*L)*((
2*Z*Y*2*Y - 2*Z*Y*2*Y*((Y - x)/Y)^2.5 -
2*Z*Y*5*x*((Y - x)/Y)^1.5)/15))};
Plot[f[x], {x, -2, 2}]
FindMaximum[f[x], x]
 
Physics news on Phys.org
  • #2
Hay Keysa, what function and what domain? Can you write it in LaTeX? You use Python?
 
  • #3
Hello Keysa,
:welcome: ##\qquad##!​

It would help if you mentioned the language in which you try to do this.
If I use Excel (?:)) to plot your function, I get

1657795501701.png

and an error if ##x\ge 1##.

You sure you have no typos in your very long expression ?

##\ ##
 
  • #4
Some formatting and added parenthesis would help us to see what your equation is. I can't see how much is in the denominator. If @BvU's graph is correct, then the maximum depends on the range of x.
 
  • #5
What I plotted is
Code:
f(x) = 1/x *((J*Z*x*(2*Y - x))/(2*Y) - ((W + T*G) + ((L + T*P)*2*Z*Y*(1 - ((Y - x)/Y)^1.5))/3 + (H + T*S + A*L)*((2*Z*Y*2*Y - 2*Z*Y*2*Y*((Y - x)/Y)^2.5 -2*Z*Y*5*x*((Y - x)/Y)^1.5)/15)))

but, since I am not a computer nor a robot, I have a hard time chopping it up into digestable pieces.
Do you have a source, an original, or anything that helps sorting out your function ?

##\ ##
 

FAQ: How to find the positive maximum value of a function

What is the definition of a positive maximum value of a function?

A positive maximum value of a function is the highest point on the graph of a function where the y-value is greater than all other y-values on the graph. It is also known as the global maximum.

How do you find the positive maximum value of a function algebraically?

To find the positive maximum value of a function algebraically, you must take the derivative of the function and set it equal to 0. Then, solve for the x-value. Plug this x-value back into the original function to find the corresponding y-value, which is the positive maximum value.

What is the difference between a local maximum and a positive maximum value?

A local maximum is the highest point on a small section of the graph, while a positive maximum value is the highest point on the entire graph. A local maximum does not necessarily mean it is the highest point on the entire graph.

Are there any special cases when finding the positive maximum value of a function?

Yes, there are special cases where a function may not have a positive maximum value. For example, if the function is constantly increasing, there is no highest point on the graph, and therefore, no positive maximum value.

Can the positive maximum value of a function change?

Yes, the positive maximum value of a function can change if the function is modified or if the domain is restricted. It is important to always check for any changes in the function before assuming the same positive maximum value.

Similar threads

Replies
1
Views
624
Replies
1
Views
982
Replies
2
Views
1K
Replies
18
Views
3K
Replies
2
Views
2K
Replies
4
Views
4K
Replies
5
Views
1K
Replies
2
Views
3K
Back
Top