Skip to main content
1-Visitor
April 21, 2016
Solved

Plotting a family of curves

  • April 21, 2016
  • 3 replies
  • 7686 views

I am trying to plot the curves of the properties of monoethylene glycol solutions in water, working from the parametric equations given in M. Conde Engineering "Properties of Working Fluids - Brines" (http://www.mrc-eng.com/Downloads/Brine%20Properties.pdf). Ultimately, I want to show the curves cut off properly at the freezing point line, as in the Conde document, and also to be able to show index lines for a specific temperature and glycol concentration. But I am struggling to get even the curves to plot correctly. If I set up the equations using range variables for glycol concentration and temperature I get the right sort of graph but with 'flyback' lines between each curve. Here's an example, for the dynamic viscosity; the various curves are for 0%, 10%..60% glycol in water.

I have found the various discussions here on plotting families of curves and waterfall curves. I am trying to follow the method illustrated by Valery Ochkov in his example sheet 2D_Plot_y_x_a.xmcdz, but I am not getting it to work for me. I am getting error messages like 'These array dimensions do not match' and 'All evaluations resulted in either an error or a complex result'.

I am using Mathcad 15 (M005), but I am not very experienced in using Mathcad for matrix manipulation; I am not sure I am even reading the example sheet correctly. Can anyone help?

Gerard

Best answer by RichardJ

You are trying too hard

If you plot a vector on the x-axis and a matrix on the y-axis, where the matrix and vector have the same number of rows, then you get a line for each column of the matrix. You don't need any program to do this, but I did put in a helper function that makes it easier to fill a vector using a range.

3 replies

RichardJ19-TanzaniteAnswer
19-Tanzanite
April 21, 2016

You are trying too hard

If you plot a vector on the x-axis and a matrix on the y-axis, where the matrix and vector have the same number of rows, then you get a line for each column of the matrix. You don't need any program to do this, but I did put in a helper function that makes it easier to fill a vector using a range.

glardner1-VisitorAuthor
1-Visitor
April 22, 2016

Thanks for this solution too; quite different from Valery Ochkov's. His appears to draw the curves forewards and backwards as a continuous line but yours draws a series of separate curves - very neat!

23-Emerald I
April 21, 2016

try "draw" for curve type rather than "line"

glardner1-VisitorAuthor
1-Visitor
April 22, 2016

I'd seen your similar comment to other threads before, but had not previously understood it. This time I found where the curve type can be changed. I must say the Mathcad User Guide is not very forthcoming about the curve types; I had not seen them - maybe I hadn't had the need - previously.

24-Ruby IV
April 22, 2016

Thanks for the using my program.

glardner1-VisitorAuthor
1-Visitor
April 22, 2016

Thanks for the program and for correcting my graph.

There's one thing I am not sure I understand; that is why the format of ϱ(T) as I entered it is different from your graph. If I write ϱ(T) on the axis placeholder, it doesn't work, but if I copy it from the program, it does work. Presumably there is a format error, that as I write it, it appears as a function but as copied it has another format. What should that format be?

19-Tanzanite
April 22, 2016

Valery is playing games with variable names. Type

r,

Ctrl g,

Ctrl Shft k,

(T)

Ctrl Shft k

That gives you a variable name, whereas

r,

Ctrl g,

(T)

gives you a function definition with T as the argument.