Multi-Variable Function Error, variable not defined

Multi-Variable Function Error, variable not defined - Cannot determine where the error is in this function - 消息

#1 已发布: 2017/12/25 18:06:56
John Evans

John Evans

0个赞,共10个帖子。

组: User

I've never tried to establish a multi-function variable in SMath until now.
I thought the function illustrated below should run fine.
Can anyone point out where I went wrong?

Also, can anyone help me with a strategy of dealing with input units and subscripts. SMath does not appear to like it where i try to type units into my input, whereas this is necessary to balance the equations in the function. The subscripts in one force the remaining variables to be entered as remaining subscripts.
It appears to me that I should use some functionality of the menus to create the list of variables, because manually typical them is a real problem.

I am trying to transpose all of my previous research from MathCAD to SMath, and expecting a super-clean result. Any help will be appreciated.

Cheers,
John
(Merry Christmas, too)

2017-12-25_14-58-17.png
#2 已发布: 2017/12/25 19:11:16
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Here is ... good luck with your conversions MCD/Smath.
I have already done several 100's, most posted in Samples.
Samples => 35*15 ~ 535

Jean

Inst_Mach Number Pitot.sm (186.37 KiB)已下载 1351 次。
#3 已发布: 2017/12/25 19:27:04
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

... that one fresh from the bakery.

2D Plot Tip Setup Critical.sm (60.53 KiB)已下载 1269 次。
#4 已发布: 2017/12/25 19:40:45
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

... did you miss that one ?
Smath is gorgeous for publishing !

Image Formated LABEL [Oxyhemoglobin].sm (17.3 KiB)已下载 1055 次。
#5 已发布: 2017/12/26 02:44:18
John Evans

John Evans

0个赞,共10个帖子。

组: User

Jean,
I am still not seeing where the simple function went wrong. Why the error?
John
#6 已发布: 2017/12/26 10:07:41
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

Jean,
I am still not seeing where the simple function went wrong. Why the error?
John


Please, attach the WS for doctoring.

MachError.PNG

#7 已发布: 2017/12/26 12:00:20
John Evans

John Evans

0个赞,共10个帖子。

组: User

Jean,
Thanks for the assistance. Please find attached the file I started that contains the error.
HPC Short Revise AR makeup.sm (96.22 KiB)已下载 1240 次。

The only thing I see is that your c is unitless, while mine are included. Is that the problem?

2017-12-26_8-58-17.png

I just tried to render the units out of the function, but to no avail.
#8 已发布: 2017/12/26 14:04:55
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

I just tried to render the units out of the function, but to no avail.



Only POM is not defined [red]

HPC Short Revise AR makeup.sm (98.33 KiB)已下载 1195 次。
#9 已发布: 2017/12/26 14:08:41
CBG

CBG

78个赞,共312个帖子。

组: User





HPC_Short.png


HPC Short Revise AR makeup_R1.sm (96.73 KiB)已下载 1252 次。


Best Regards

Carlos
1位用户喜欢此帖子
Davide Carpi 2017/12/27 12:42:00
#10 已发布: 2017/12/26 15:12:25
John Evans

John Evans

0个赞,共10个帖子。

组: User

CBG,
What did you do to free it up?

Subscripts drop in, and everything seems functional and easy to enter.
Is there a different method of creating the function than manually entering it, that makes this work the way your does?

Seriously, thank you.
John
#11 已发布: 2017/12/26 15:57:43
CBG

CBG

78个赞,共312个帖子。

组: User

John:

Well, in this case, the main problem was that the user's function was incorrectly defined.
You just have to follow the rules that are indicated in Smath Studio in the creation of
a function by the user: https://en.smath.info/wiki/User%20functions.ashx.


Regards.

Carlos
#12 已发布: 2017/12/26 22:15:39
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Besides exemplified rules, more get discovered day by day.
Observe this construct: d:= Strip(D) ... it can get D [being]
a defined/assigned entity. Then, wisely, Smath pairs with Strip,
it considers Strip must be assigned too then Strip is considered
a built-in function. In terms of Mathcad terminology, this construction
would have to be in Global definition.
This is just demo. More conveniently, one would plug Strip(,) at top
of the work sheet, collapsed in Utilities.

Jean

Observe.PNG

Utilities Most used [Step Detect].sm (28.49 KiB)已下载 1041 次。
#13 已发布: 2017/12/27 00:29:04
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

Also, can anyone help me with a strategy of dealing with input units and subscripts.


1. Numeral subscript should be banned and deleted from Smath code.
Only one application is defendable => tutor/expose the rk construct.
2. Maths are unitless, therefore should never be used during a construct.
Construct paper/pencil like in the old days. Just append the UnitResult
in the result ... if you don't find => define.
If a user formula/approximation is designed based on "DataUnit", you may express
result in compatible unit. Let's consider my Thermocouple approximation
based on DataUnit [°C], if I append the result °F it will auto-convert.

In the attached example, formulas are pre-configured wrt units as defined.
No more unit in the picture ... bingo done.

Jean

Inst_Colebrook Pipe Data.sm (60.09 KiB)已下载 1235 次。


#14 已发布: 2017/12/27 00:48:30
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

... one more point. When you equate for result, you may encounter mostly two error messages.
x not defined ... or _not defined

x not defined may simply indicate an error in the function call
mysine(x):=monkeybusiness(x)
Mysine(1.23456789)= "x not defined"

"_ not defined" mostly means the scalar algo chain is incorrect.
#15 已发布: 2017/12/27 01:14:05
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

... in Smath 5346 there was another type of common error from plot or from =
"1.23456789987654321" [just to exemplify]
It meant the function could not be plotted/evaluated at this value(ssss)
For other demand, it would evaluate. I din't notice this error message 6179.
This type of error, Mathematica called it "Shadow in Context", giving a list
of values it couldn't evaluate. In other words: "Shadow in Numerical Context"
#16 已发布: 2017/12/27 01:44:03
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

...

AlgoIgnored.PNG
  • 有新帖
  • 无新帖