I have a code here:
expr = Sqrt[2]\[Sqrt](\[Sqrt](1/x^2+20 Sqrt[3118] (1/x)^(3/2)
Sqrt[1/50]+3118020 Sqrt[3118] Sqrt[1/x] (1/50)^(3/2)+24304810001/50^2+
623602/(x 50))-10 Sqrt[3118] Sqrt[1/x] Sqrt[1/50]-155900 /50)
(*I use this method here to calculate the midpoint (x,y coordinates) and range of the graph*)
nMax = NMaxValue[expr, {x, 5, 500}];
nMin = NMinValue[expr, {x, 5, 500}];
nR = nMax - nMin;
nRan = nR/4
nRanC = nRan/2
n1 = nMin + nRanC
Solve[expr == n1, x]
n2 = n1 + nRan
Solve[expr == n2, x]
n3 = n2 + nRan
Solve[expr == n3, x]
n4 = n3 + nRan
Solve[expr == n1, x]
(*Then I plot to divide into 4 different section of graph*)
n1x=nMin+nRan
n2x=n1x+nRan
n3x=n2x+nRan
n4x=n3x+nRan
Row[Plot[expr,{x,5,500},MeshFunctions->{#2&},MeshShading->{None,Blue},Mesh->{#},MeshStyle->Opacity[0],PlotRange->{{0,500},{0,1}},AxesLabel->{x,SuperStar[E]},ImageSize->300]&/@{{n3x,n4x},{n2x,n3x},{n1x,n2x},{nMin,n1x}}]
The above code is to divide the graph into 4 different section. Meaning that I have to set/calculate the 4 section manually into the code.
Let's say that if I wanted to do mx=Input["how many graph to show?"]
, then to calculate the midpoint and range of each graph shown, and to plot the graph altogether automatically based on the mx
value given (by using some kind of loop?).
How exactly do I do that? I'm kind of new to mathematica and still learning about its use. Thank you.