1
$\begingroup$
Rth[tmax_, tin_, qmax_] := N[(tmax - tin)/qmax];Phex[qmax_, m_, tamb_] := N[qmax/(((qmax/(m*0.063*4184)) - tamb) - tamb)]Manipulate[StringJoin["CP Thermal Resistance:", "HEX Performance:" ToString[Style[Rth[tmax, tin, qmax], 14]]],StringJoin["HEX Performance:",ToString[Style[Phex[qmax, m, tamb], 14]]],Delimiter,Text[Style["Performance Calculator", 20, Background -> LightBlue,FontWeight -> Bold]],Delimiter,{{tmax, 100, "Max Cold-Plate Temperature (\[Degree]C): "},ControlType -> InputField, FieldSize -> 7},{{qmax, 1000, "Heat Load (W): "}, ControlType -> InputField,FieldSize -> 7},{{tin, 30, "Cold-Plate Inlet Temperature (\[Degree]C): "},ControlType -> InputField, FieldSize -> 7}, 
 {{m, 0.5, "Flow Rate (GPM): "}, ControlType -> InputField,FieldSize -> 7},{{tamb, 25, "Ambient air Temperature (\[Degree]C): "},ControlType -> InputField, FieldSize -> 7},Delimiter, Item[Button["Calculate", Nothing, BaseStyle -> {15}],Background -> Blue], LabelStyle -> {16},ContentSize -> 300,TrackedSymbols :> All]

I want display the value of Rth & Phex as an output. but i dont know what mistake i am doing here.

$\endgroup$

1 Answer 1

5
$\begingroup$

You had few syntax errors. Try this. Also, the Manipulate expression needs to be a single expression. Not things separated by commas as you had it. So I put it inside a Row for now.

Mathematica graphics

Rth[tmax_, tin_, qmax_] := N[(tmax - tin)/qmax];
Phex[qmax_, m_, tamb_] := 
 N[qmax/(((qmax/(m*0.063*4184)) - tamb) - tamb)]

Manipulate[
 Row[{
   StringJoin["CP Thermal Resistance:", "HEX Performance:", 
    ToString[Style[Rth[tmax, tin, qmax], 14]]], 
   StringJoin["HEX Performance:", 
    ToString[Style[Phex[qmax, m, tamb], 14]]],
   Text[Style["Performance Calculator", 20, Background -> LightBlue, 
     FontWeight -> Bold]]
   }],
 Delimiter,
 
 {{tmax, 100, "Max Cold-Plate Temperature (\[Degree]C): "}, 
  ControlType -> InputField, 
  FieldSize -> 7}, {{qmax, 1000, "Heat Load (W): "}, 
  ControlType -> InputField, 
  FieldSize -> 7}, {{tin, 30, 
   "Cold-Plate Inlet Temperature (\[Degree]C): "}, 
  ControlType -> InputField, 
  FieldSize -> 7}, {{m, 0.5, "Flow Rate (GPM): "}, 
  ControlType -> InputField, 
  FieldSize -> 7}, {{tamb, 25, 
   "Ambient air Temperature (\[Degree]C): "}, 
  ControlType -> InputField, FieldSize -> 7}, Delimiter, 
 Item[Button["Calculate", Nothing, BaseStyle -> {15}], 
  Background -> Blue], LabelStyle -> {16},
 
 ContentSize -> 300,
 TrackedSymbols :> All
 ]
$\endgroup$
5
  • $\begingroup$ Thanks For your support.. Can we make a put box to display the values as input box? $\endgroup$
    – ASHISH
    Commented Mar 2, 2022 at 8:18
  • $\begingroup$ @ASHISH You can use Grid instead of Row to have more control of your final output appearance. Look at help for Grid. There many examples there. Use Framed option and Spacing option to adjust spacing as needed. $\endgroup$
    – Nasser
    Commented Mar 2, 2022 at 8:33
  • $\begingroup$ I did but not working for me... Can we make a dialog box as input same for to display the Rth & Phex values? $\endgroup$
    – ASHISH
    Commented Mar 2, 2022 at 13:26
  • $\begingroup$ I want to display the output more attractive.. do you have any idea how we can do that... Remove this performance calculator text box.. $\endgroup$
    – ASHISH
    Commented Mar 2, 2022 at 13:28
  • $\begingroup$ @ASHISH How you want to display the output is your design decision as I do not know how you want it to look like. As I said, I use Grid for my main layout. Just replace Row with Grid. You could look for examples at demonstrations.wolfram.com $\endgroup$
    – Nasser
    Commented Mar 2, 2022 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.