Skip to main content
1-Visitor
October 30, 2014
Solved

Operations with matrice array

  • October 30, 2014
  • 33 replies
  • 10647 views

Hello PTC community, thanks for taking your time to check this post out. I dont know if mathcad can do this but im pretty sure it can for what Ive seen. I want to make the sum of multiplying a component of a vector with a component of a matrice in an especific column, then with the next component of the vector with the second row in the same column and so on. Details are attached in the document. Thanks for all!

 

PS. If you are familiarized with chemical engineering, the problem I want to solve is a multicomponent destilation tower with the rigorous method ( I think its the Amundson-Pointnen method)

Best answer by Werner_E

Look at my comments in the attached sheet.

33 replies

23-Emerald V
October 30, 2014

A few points...

If you're going to index from 1 to n, then you need to set ORIGIN = 1, otherwise the Mathcad default of 0 for indexing will mean that i:=1..3, K[i:=something will result in a 4 element vector with K[0 = 0.

The second is that you have defined Z by Z[i,j:=[matrix]. This will create a 3x5 array each element of which contains your [matrix]. (I'm guessing) you just need to write Z:=[matrix].

Stuart

Message was edited by: Stuart Bruff Corrected stupid error on my part ...

1-Visitor
October 31, 2014

Hey Stuart, thanks for taking your time to check out my document. You expanded my vision on how could I have solved the problem. I hope you have a great day!

Werner_E
Werner_E25-Diamond IAnswer
25-Diamond I
October 30, 2014

Look at my comments in the attached sheet.

1-Visitor
October 31, 2014

Hello Werner, im almost done with the problem but i want to do the last operation and calculate the L matrix. The results should be

L1=100
L2=100
L3=200

L4=200

L5=50

The general form of the eq is

Lj=(Vj+1)+(SUM(m=1 until 5) Fm-Um-Wm)-V1
I want to keep using the vector notation as you told me and not the Lj

Werner_E
25-Diamond I
October 31, 2014

The sum is a constant 50, V1 is zero! So all you do is adding 50 to your vector V which has 6 elements and then you just want the last five elements of that result?? This would yield (200; 200; 200; 200; 50). Where do the two 100's in your suggested solution come from?

Furthermore i is not defined!?

1-Visitor
November 4, 2014

I tried to be as especific and clear as possible. This is what im trying to do, sorry for bothering, I hope you guys can help me.

Werner_E
25-Diamond I
November 4, 2014

I think the question about how to calculate L was already answered in my last replay and I showed two ways of doing it.

The result is not what you expected but you didn't answer the question why you think that (200; 200; 200; 200; 50) is the result and how you would calculate to get that result.

The formula given in your file is a bit different from the one you gave in your question above (the upper sum index is variable in the formula of your fle), so I think you have to clear things up for yourself first.

Anyway, the attached sheet may help as it shows much easiers ways to calculate your matrix K.

1-Visitor
November 4, 2014

Hello Werner, I really appreciate what you are doing for me here. The original post I made was for 5 stages, since I have to do another work in school, I wanted to leave the worksheet for a more general situation. In this case for 17 stages. I will insert the worksheet with my comments with I want to do with solver. Now I understand how to calculate L. Sorry if im getting to annoy you but its not what I want to do, the thing is its the first I use mathcad.

Greetings from Mexico