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

## Problem with subscript in thermodynamic problem  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  6-Contributor
(To:ptc-5688285)

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

Thanks!  5-Regular Member
(To:ptc-5688285)

Have a look at the attached. The subscripts are not required.  24-Ruby V
(To:MikeArmstrong)
 The subscripts are not required.

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

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.  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.  24-Ruby V
(To:ptc-5688285)

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.  5-Regular Member
(To:Werner_E)

Nice work. I have never seen integers used like that before.  24-Ruby V
(To:MikeArmstrong)

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.  1-Newbie
(To:Werner_E)

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.  24-Ruby III
(To:ptc-5688285)

Sorry, R is a built-in constant:  