Skip to main content
1-Visitor
March 24, 2011
Solved

Comparing sets of paired-vectors

  • March 24, 2011
  • 5 replies
  • 3597 views

Hi All,

I have 9 sets of two dimensional vectors and am interested in comparing these sets under certain conditions. The condtions are stated in the mathcad file attached. As there are 9 rules to be followed, I am confused as how to program it. I guess for and other types of loops may be required.

Any help would be highly appreciated.

Thanks,

Ashehad

Best answer by StuartBruff

AshehadAl wrote:

Thanks Stuart for the response,

I have followed it to degree. As I did not fully understand, I am attaching two versions of the same program that you wrote with some more explanations. However, I am focusing for simplicity reasons on 3 vectors.

Thanks,

Ashehad

Hi Ashehad,

Unfortunately, I can't open the 'mcd' version even in M15, so I don't know what your questions were.

If you want to calculate each combination of vector, say a and b, then you can simplify matters considerably (I think!). If condA(a,b) is true, then condB(b,a) will be true and vice versa. Consequently, the total meeting A and B will be the same. In which case, you need simply count those meeting Condition C and split the difference between this number and the total number of possible combinations to get the number meeting A and B.

Stuart

Note: there was at least one error in condA - a '>' should have been a '<'.

5 replies

23-Emerald V
March 24, 2011

AshehadAl wrote:

Hi All,

I have 9 sets of two dimensional vectors and am interested in comparing these sets under certain conditions. The condtions are stated in the mathcad file attached. As there are 9 rules to be followed, I am confused as how to program it. I guess for and other types of loops may be required.

Any help would be highly appreciated.

Thanks,

Ashehad

Ashehad,

I had a brief look at your worksheet during the final moments shouting at the children to get ready for school but didn't have time to do more than that.

Unfortunately, I don't have whatever version of Mathcad you're using at work, so I had to remember (guess!!!) what you were after and invent some data.

Even more regrettably, I have had to throw together the attached worksheet in between slurping tea and doing actual work - there's more general form for your conditional functions that I may attempt to debug later - condition C (IIRC) seems to be redundant.

Stuart

AshehadAl1-VisitorAuthor
1-Visitor
March 24, 2011

Thanks Stuart for the response,

I have followed it to degree. As I did not fully understand, I am attaching two versions of the same program that you wrote with some more explanations. However, I am focusing for simplicity reasons on 3 vectors.

Thanks,

Ashehad

23-Emerald V
March 24, 2011

AshehadAl wrote:

Thanks Stuart for the response,

I have followed it to degree. As I did not fully understand, I am attaching two versions of the same program that you wrote with some more explanations. However, I am focusing for simplicity reasons on 3 vectors.

Thanks,

Ashehad

Hi Ashehad,

Unfortunately, I can't open the 'mcd' version even in M15, so I don't know what your questions were.

If you want to calculate each combination of vector, say a and b, then you can simplify matters considerably (I think!). If condA(a,b) is true, then condB(b,a) will be true and vice versa. Consequently, the total meeting A and B will be the same. In which case, you need simply count those meeting Condition C and split the difference between this number and the total number of possible combinations to get the number meeting A and B.

Stuart

Note: there was at least one error in condA - a '>' should have been a '<'.