Community Tip - You can change your system assigned username to something more personal in your community settings. X
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?
Solved! Go to Solution.
Salve Claudio Bentivoglio,
dovrei conoscere a fondo il problema per essere certo della soluzione.
Comunque, quella che segue potrebbe andare bene?
Distinti saluti.
F. M.
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
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
Thanks for your quick response.
I've changed the label of both the K (units) and the Tb.i-1 (variable) but the program still doesn't work. Also I assigned the value of Tb.B0 inside the solve block! Could there be any other problems (mostly regarding the use of the root function)?
Yes there could be.
Try to see if the root function works with a simple variable, rather than a vector element. Assign T.b[i-1 to a variable Temp (e.g.) before calling root and use that instead inside the root function.
Success!
Luc
You have more problems. The x.B used in the expression as argument to the root function is an array, but it's i'th element x.B[i is NOT an array, and you try to index it with n.
Luc
Salve Claudio Bentivoglio,
dovrei conoscere a fondo il problema per essere certo della soluzione.
Comunque, quella che segue potrebbe andare bene?
Distinti saluti.
F. M.
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!