Skip to main content
5-Regular Member
May 30, 2014
Question

Multiple Outputs from Solveblock - Intermediate Variables as Output included

  • May 30, 2014
  • 8 replies
  • 2770 views

Hello,

Looking to get multiple outputs from a solve block where some of the outputs are intermediate stages in the calculations. I'm getting an error when I try the normal things one might think of such as entering Tso(Tfo) and Tsi(Tfo). Looking to use the solve block becuase it is faster, but I can stick with the programmed version if that is necessary.

I like the Solve block version more, becuase the accuracy should be greater regarding the equations due to where I inserted the radiation componenet, though I think they should be fairly close for the majority of items.

8 replies

Werner_E
25-Diamond I
May 30, 2014

Not sure what the problem is - both sheets don't show any errors?

I am confused as of the many function definitions IN the solve block. They should not be inside the block IMHO and the parameters you pass should be also arguments of those functions.

And the Excel sheets seems to have nothing to do with the question.

jroth5-Regular MemberAuthor
5-Regular Member
May 30, 2014

Werner,

I have altered the sheet to include the parameters I wanted output as well. I'm looking for a similar output in Temp Solve 3 as I have in my Temp Solve 4 where I programmed in the solving loop.

The excel sheet is a sanity check that the calculations I am getting back in MathCad are accurate.

If I shouldn't define the functions inside the solve block, how should I define them outside the solve block so that the system still solves. Instead of defining my constraint as Qcon + Qrad = Qtrans, should I rather define the constraint in as few variables as possible? I thought that the Constraint of the heat balance would be easiest to read.

Werner_E
25-Diamond I
May 30, 2014

You have only one equation to solve in your solve block, so you solve for just one variable, Tfo.

You want to see the function result of T.si(T.fo) where T.fo is the found value? Then simply assign the result of Temos(...) to a variable and put that variable as argument of the function T.si() and evaluate. For this to work T.si() must be defined outside the solve block, otherwise its not known on the worksheet level (thats different to MC15).

See attached the problem partly solved.

Its annoying to have to type so many arguments in so many functions, but as you want the result being made dependend on that many parameters you have no choice.

Of course you may consider turning some functions into bigger programming routines where you can use local functions with fewer arguments (like you did in the solve block). But everything you make local is not availabel outside, as you could see with T.si.

Of course you could leave all as it is and redefine T.si outside a second time, but thats in no way recommended.

At the end your solve block would consist just of three lines: the guess value for Tfo, the one equation to solve and the line with Find().