cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Problem with subscript in thermodynamic problem

ptc-5688285
1-Newbie

Problem with subscript in thermodynamic problem

Good night.

I'm using mathcad prime 3.0. I try to solve a problem as stated in my textbook "Introduction to Thermodynamics in Chemical Engineering" Smith & Van Ness but I define the variables that tell me or how to resolve the situation subscript "i, j" which are integers. If anyone can help me I appreciate fully. Attached the document.

 

 

thanks

9 REPLIES 9
MarkCheli
6-Contributor
(To:ptc-5688285)

Moved to the Mathcad Usage community in order to get you a response.

Thanks!

MikeArmstrong
5-Regular Member
(To:ptc-5688285)

Have a look at the attached. The subscripts are not required.

The subscripts are not required.

Not sure about that. If the calculated variables should be (symmetrical) 3x3 matrices, the subscripts would be necessary.

@Ricardo: You made (at least 😉 three errors in your sheet

1) Mathcad by default begins counting vector and matrix element with 0, not with 1. Thats the reason Mike had set n:=2. Alternatively you could set the system variable ORIGIN:=1, so your approach could work.

2) you used the literal index (Ctrl + -) instead of the vector index ([) on the LHS of your assignments.

3) When you assign Zc[i,j:=Zc[+Zc[j you are not allowed to use the same variable name (Zc) for the 3x3 matrix (LHS) and the 3x1 vector (RHS) because that assignment will be evaluated step by step and Tc can't be matrix and variable at the same time.

MikeArmstrong
5-Regular Member
(To:Werner_E)

Werner Exinger wrote:

The subscripts are not required.

Not sure about that. If the calculated variables should be (symmetrical) 3x3 matrices, the subscripts would be necessary.

Good point Werner I didn't think of that.

Find attached a version which fixes the above mentioned 3 errors and 3 further ones.

4) The definitions of Vc and Pc are missing the matrix indices i,j on the LHS

5) The definition of the matrix Tr makes use of the matrix Tc, so it should be move after the definition of Tc

6) you define a vector Pc at the top, but you don't use it and at the end you overwrite by a matrix Pc!?

Hope the attached is what you are trying to do.

MikeArmstrong
5-Regular Member
(To:Werner_E)

Nice work. I have never seen integers used like that before.

I simply tried to keep as close to the orgiginal file as possible. So lets see if that is what Ricardo was looking for and if he ever will find this thread again as it obviously was placed at the wrong subspace at first and moved over to here by Mark.

Good afternoon.

Thank you very much for your time and advice. Option ORIGIN = 1, I ue quite useful, as are the selection of vectors. I had no idea about it. The file that I present is the end result of the considerations and your help. Thank you.

Sorry, R is a built-in constant:

R.png

Top Tags