Message Boards Message Boards

1
|
5644 Views
|
4 Replies
|
4 Total Likes
View groups...
Share
Share this post:

LogLinearPlot for Fire Protection Hydraulics

Posted 11 years ago
I'm trying to create a Hydraulic Graph for Fire Protection uses via mathematica.

These images show how to construct one by hand:





This is what the result should look like for flows (gallons per minute or gpm) 0 - 5000 and residual pressures 0 - 100



My efforts to put this into mathematica are:
ListLogLinearPlot[Table[{n, n^1.85}, {n, 1200, 4200}], Joined -> True]

This does not generate a straight line.
The x axis appears to be logarithmic and the y axis linear, which is right, but I don't know if the x axis is logarithmic to an exponent of 1.85 as it should be for hydraulic friction loss. The y axis goes all the way to 5*10^6 when it should only go to 100 for residual pressure.

What I'm trying to figure out:
How to make the x axis increments based on an exponent of 1.85 as in the above picture.
How to make the y axis go from 0 to 100 as in the above picture.
How to make the line go down from the start point instead of going up, based on two points (a point at 0 gpm, at some static pressure such as 69 psi, and then a point at a big gpm, for example 3000, and a residual pressure of 35).
How to make the line straight.

The incorrect result in mathematica:


Here is my second attempt, which doesn't generate a line at all, no idea what I'm doing wrong

POSTED BY: Luke Wallace
4 Replies
Posted 11 years ago
If you could post a list of a small number of {flow, residual pressure} pairs that should line on a line
and the range of flows and residual pressures that you would like to see on a plot of those then it
may be easier to show how to get a plot like what you are wanting to see.
POSTED BY: Bill Simpson
Posted 11 years ago
Thank you Sam, the ListLogLogPlot makes both the Y axis and X axis logarithmic, which is no longer a semilogarithmic plot as I need. The second example you posted works great, now I just need to figure out how to specify the range of the Y axis to be 0 - 100 instead of what it is defaulting to which is 0 - 5.

I can probably figure this out on my own as you got me through the hard part!

Edit: Got the y axis by using the PlotRange option,
ListLogLinearPlot[Table[{n^1.85, Log[n]}, {n, 10, 100}],
Joined -> True, GridLines -> Automatic, Frame -> True, PlotRange -> {0, 100}]

But now the line itself doesn't seem to look right.
I'll try to figure out what is going on.

Edit:
The line itself still seems to be wrong, it should be a line starting at x,y of 0, 69 and going down straight to 3000, 35
but instead it is starting at 10, and going up to 100, due to {n, 10, 100}
POSTED BY: Luke Wallace
Good idea, Joshua, btw you can hyper-link URLs in posts so they are clickable. Check THIS out.

Now, Luke, if you prefer to keep your data form, then as Josh said you need ListLogLogPlot:
ListLogLogPlot[Table[{n, n^1.85}, {n, 1200, 4200}], Joined -> True,
GridLines -> Automatic, Frame -> True]


If you need to use ListLogLinearPlot then you need to change your data to get straight line:
ListLogLinearPlot[Table[{n^1.85, Log[n]}, {n, 10, 100}],
Joined -> True, GridLines -> Automatic, Frame -> True]
POSTED BY: Sam Carrettie
Posted 11 years ago
I think you may want ListLogLogPlot rather than ListLogLinearPlot.  Link for the lazy: http://reference.wolfram.com/mathematica/ref/ListLogLogPlot.html
POSTED BY: Joshua Horton
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract