Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

"This value must be a scalar" issue in the FOR loop Mathcad Prime 9 1

Status
Not open for further replies.

yuriy_biks

Civil/Environmental
Apr 27, 2024
7
0
0
UA
Hi everybody!
I'm a newbie in this forum's community and, obviously, a newbie in Mathcad Prime.
So, I have a little loop for calculating the thermal characteristics of the i-th iterated layer thickness of a two-layered wall assembly according to ISO 13786 and can't understand what I have to change with my "Internal" script to make it run seamlessly. I kindly ask for relevant help with my issue.
Any assistance or advice will be appreciated!
The problem is in the "internal" script for the FOR loop, which isn't working...
 
 https://files.engineering.com/getfile.aspx?folder=f591e51b-6170-4c67-b16d-ad5329623b88&file=Thermal_performance_calculation_ISO13786_parametrization_2.mcdx
Replies continue below

Recommended for you

You probably have a reference to an entire array rather than to an array element.

Not a user of MathCad, but experience with between 5 and 10 programming languages; the error is universal.
 
@3DDave
Thank you for your advice; it is probably a point. As far as I assigned the i-th iterable element in the loop, it could be called as an element of an array, nor as a range, e.g., i10=0.1*10*d1 returns a number, not the array and so on.
 
Didn't the original problem relate to a scalar being expected? Was that edited out?

Nevermind - problem statement is in title.
 
The problem, as far as I get from the previous post is in calling the arrange instead of calling the i-th element. I want Mathcad will work for me in all of the proposed ranges of independent variables with calculus of the goal function.
 
I have now figured out the ∧ is the "AND" operator. Most of the ones I use either use "AND" or the use "&"

As I said, not a MathCAD user; just familiar with programming.

I thought the > was an inline logical operator and ∧ was exponentiation and was thinking that the logical operator was returning a Boolean and that was all wrong ... anyway, now understood.

Is the red box supplied by MathCAD or is that by you?
 
The reason I asked is the first PDF only indicated part of the expression; the reworked expression it highlighted a portion that was previously not boxed, so it's not clear why it boxed the part it accepted before.

When will d1[sub]i[/sub] + d2[sub]i[/sub] ≤ 0.6⋅m not be true? I don't think it is the problem, but it may add unnecessary clutter.

Am I right that MathCAD automatically creates an array with dynamic number of elements just because subscripts are used?

I'm too fuzzy right now (need sleep) but have you looked to see that all the comparisons have matching units? If the software complaint is about being scalar that suggests that something has a scalar and is being compared to something that has units.
 
Status
Not open for further replies.
Back
Top