Skip to main content
1-Visitor
January 19, 2017
Solved

How to use the root command in a program

  • January 19, 2017
  • 2 replies
  • 3648 views

Hi everyone, I am having some trouble with this program. My aim is to find a temperature (by using the command root) in a program, can anyone help me?

Best answer by -MFra-

Salve Claudio Bentivoglio,

dovrei conoscere a fondo il problema per essere certo della soluzione.

Comunque, quella che segue potrebbe andare bene?

Batch Distillation.jpg

Distinti saluti.

F. M.

2 replies

23-Emerald IV
January 19, 2017

You've probably run into the automatic labelling trap of Mathcad Prime:

Notice that my cursor (short vertical blue line) is on the T.b[0 variable where it is assigned the value of T.b.B0 (of which I could not find a definition, so that may be yet another problem). The label (see the ribbon: 'Labels', 3rd from top-right) of this T.b[0 variable is 'Variable'. If you move the cursor to the offending item T.b[i-1 inside the argument list of the root function you see that the label of that item is not 'Variable', but '(-)'. Now both items refer to an element of the vector T.b (the first to its element with index 0, the other to the element with index i-1. The labels are different, so the arrays are different, and that's not your intent, I guess. You can correct this by manually changing the label of T.b[i-1 to be a 'variable' as well. then this problem should be out of the way.

Unfortunately I cannot do it, because I'm limited to Prime Express (no programming or solve blocks allowed). But if you (still) run into more issues, don't hesitate to come back here.

Success!
Luc

23-Emerald IV
January 19, 2017

Oh, there's one other thing.

The 300 and 400 K limits don't use K(elvin) as a unit, but K as a variable instead. If they were units, they'd be as blue as the K(elvin) inside the solve block just above your program. Similar label trap stuff... Similar method of correction.

Luc

-MFra-21-Topaz IIAnswer
21-Topaz II
January 23, 2017

Salve Claudio Bentivoglio,

dovrei conoscere a fondo il problema per essere certo della soluzione.

Comunque, quella che segue potrebbe andare bene?

Batch Distillation.jpg

Distinti saluti.

F. M.

1-Visitor
January 23, 2017

Grazie mille! è proprio quello che volevo fare, ma non mi è venuto in mente di creare una funzione della temperatura all'interno del programma!
Ti allego il programma così se vuoi capire quello che stavo facendo puoi farlo. Grazie ancora!