Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stereographic Diagrams 2

Status
Not open for further replies.

barryodonnell

Mechanical
Jan 25, 2002
15
0
0
GB
Hi,

Has anyone managed to plot a stereographic triangle with EXCEL.
I look forward to all your tips.

Regards

Barry
 
Replies continue below

Recommended for you

I really do not know what a stereographic triangle is but however once I tried to plot a solubility ( on z-axis as a function of two independent conncentrations( on x- and y-axis) in excel. The plot was not very impressive because of rather unprecise measurements. The z-value was shown in a projection of Carthesian coordinates system after a normalization of the input values.
There is a triangle plot of a solubility as a function of three variables though not really independent while the sum of them must be 1,0 (after a normalization) in a software package Statistica that I am using too. Maybe that would help you.
m777182
 
Barry:
Do you mean the triangle graphics perhaps, like those oriented to analyze phases & concentrations, etc, or flammability problems?
If so, maybe this clarifies your post.
I'm in the same search. If I succeed with matlab or excel, I'll post here.
Have a safe day
J.Alvarez
 
Great, Joerd!
Just what I was looking for.
I've a problem with the macro; clicking on "Draw" it appears a compilation error message about the Byref, in the subroutine:
Sub DrawCurve(XYValues As Variant)
I will see if I can do something. Maybe is related with my units definition.
Thanks
J.Alvarez
 
Joerd (or anyone interested):
Your spreadsheet worked, changing the definition double by Variant at the end of the module. See changes in bold:
...
...
Function TernaryToXY(x_A As Variant, x_B As Variant) As Variant
Dim TXY(1) As Double
TXY(0) = LLX + SideSize * (1 - x_A + x_B) / 2
TXY(1) = LLY - SideSize * HSratio * (1 - x_A - x_B)
TernaryToXY = TXY
End Function

I will try to improve the graph, it seems not to work correctly changing the values. Suggestions?

Regards
J.Alvarez
 
Joerd:
The bug apart (I know it is there simply coz you forgot to do a test-run before posting and inadvertently sent this version), your program is simply beautiful!
A fine example of graphics automation in Excel - my compliments!

DARE TO IMAGINE
mala_rs_singh@rediffmail.com
 
Thanks for the compliments and feedback. This was a workbook that I did several years ago and have not looked to it for quite some time, so improvements are welcome.

Jalvarez,
Although your suggestion works, I decided to change the function header to:
[tt]Function TernaryToXY(ByVal x_A As Double, ByVal x_B As Double) As Variant[/tt]

I don't know what the problem with the values would be, can you be more specific?

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Look at the values of X1 and Y1 as declared locally in the Sub DrawCurve(XYValues As Variant):

'Dim X1 As Double, Y1 As Double, X2 As Double, Y2 As Double'

now look at the values as passed to the subroutine:
XY = TernaryToXY(XYValues(i, 0), XYValues(i, 1))

where:
'Function TernaryToXY(x_A, x_B) As Variant'

which makes XY a variant..


Now deriving two 'double' values from a variant as follows:
X1 = XY(0)
Y1 = XY(1)
appears to be a possible cause of the error...

Bottom line is (the way I look at it) : What works OK is the correct syntax...


Mala Singh
'Dare to Imagine'
 
Joerd:
The trouble with the numbers is related to the figures that appears in the Excel table.
The last six rows are not possible values, but they demonstrate that they cannot be drawn. Bright!
These rows are available for any additional data, if available, right? Good job...
I added a colored background, and it's fine.
Your spreadsheet dissapeared on the addressing, so it's lost for future interested guys.
Mala, I'll review your comments, thanks.
Have a safe day
J.Alvarez
 
Status
Not open for further replies.
Back
Top