Clear[Rth, Phex];Rth[tmax_, tin_, qmax_] := N[(tmax - tin)/qmax];Dynamic[Manipulate[Panel[Column[{"Rth:", Style[Rth[tmax, tin, qmax], Red, Bold, 14]
}, Frame -> True, Background -> LightBlue, FrameStyle -> Red],"Calculated Values :"],Text[Style["Calculator", 20, Background -> LightBlue,
FontWeight -> Bold]],Delimiter,{{tmax, 80, "Temperature (\[Degree]C): "},ControlType -> InputField, FieldSize -> 5},{{qmax, 5000, "Load (W): "}, ControlType -> InputField, FieldSize -> 5},{{tin, 50, "Inlet Temperature (\[Degree]C): "},ControlType -> InputField, FieldSize -> 5},{{tamb, 25, "Ambient air Temperature (\[Degree]C): "},ControlType -> InputField, FieldSize -> 5},{{m, 1.0, "Flow Rate : "}, {0.5, 1, 1.5, 2},ControlType -> RadioButtonBar, FieldSize -> 5},Item[Button["Calculate", Nothing, BaseStyle -> {15}], Background -> Blue],LabelStyle -> {20}, ContentSize -> 500, Frame -> True,TrackedSymbols :> All,Frame -> True, FrameMargins -> Automatic]]
In the above code, we get the output as a calculated value of Rth (0.006 by default). This value will change as per the user inputs.
I also have one table given below:
CP = TableForm[{{0.0078, 0.0066, 0.0088, 0.0082, 0.0078},{0.0058, 0.0049, 0.0073, 0.0067, 0.006},{0.0054, 0.0046, 0.0068, 0.0065, 0.0056},{0.0051, 0.0041, 0.006, 0.006, 0.0051}},TableHeadings -> {{"0.5 GPM", "1.0 GPM", "1.5 GPM",
"2.0 GPM"}, {"CP-1000", "CP-1001", "CP-1002", "CP-1003",
"CP-1004"}}]
Now I want to display one more output beside the calculated value, which will be the table's heading. I have Rth 0.006 as the computed value at 1 GPM in the default case. Now I want to make logic such that the calculated value goes to the table and sees where this value is matched. And display the column heading.
Example: Rth =0.006 at 1GPM (Row). The output will be CP-1004 (2nd row & 5th column). And if the output is not matched with the table value, it should show the nearest smaller value column heading name.
Like: The calculated value of Rth= 0.005 (For different user input), The closest smaller value at 1 GMP Row is 0.0049. At that condition, the Column heading CP-1001 will be displayed as output.
The logic should work the same if the user changes GPM or Row values like 0.5,1.5,2 GPM.
Does anyone have any idea how I can make this logic?
I appreciate any help you can provide.