Multi-Variable Function Error, variable not defined

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

#1 Posted: 12/25/2017 6:06:56 PM
John Evans

John Evans

0 likes in 10 posts.

Group: 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 Posted: 12/25/2017 7:11:16 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 KiB) downloaded 86 time(s).
#3 Posted: 12/25/2017 7:27:04 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

... that one fresh from the bakery.

2D Plot Tip Setup Critical.sm (60 KiB) downloaded 65 time(s).
#4 Posted: 12/25/2017 7:40:45 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

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

Image Formated LABEL [Oxyhemoglobin].sm (17 KiB) downloaded 58 time(s).
#5 Posted: 12/26/2017 2:44:18 AM
John Evans

John Evans

0 likes in 10 posts.

Group: User

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

Jean Giraud

983 likes in 6866 posts.

Group: 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 Posted: 12/26/2017 12:00:20 PM
John Evans

John Evans

0 likes in 10 posts.

Group: User

Jean,
Thanks for the assistance. Please find attached the file I started that contains the error.
HPC Short Revise AR makeup.sm (96 KiB) downloaded 38 time(s).

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 Posted: 12/26/2017 2:04:55 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 KiB) downloaded 39 time(s).
#9 Posted: 12/26/2017 2:08:41 PM
CBG

CBG

77 likes in 312 posts.

Group: User





HPC_Short.png


HPC Short Revise AR makeup_R1.sm (96 KiB) downloaded 49 time(s).


Best Regards

Carlos
1 users liked this post
Davide Carpi 12/27/2017 12:42:00 PM
#10 Posted: 12/26/2017 3:12:25 PM
John Evans

John Evans

0 likes in 10 posts.

Group: 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 Posted: 12/26/2017 3:57:43 PM
CBG

CBG

77 likes in 312 posts.

Group: 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 Posted: 12/26/2017 10:15:39 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 KiB) downloaded 40 time(s).
#13 Posted: 12/27/2017 12:29:04 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 KiB) downloaded 31 time(s).


#14 Posted: 12/27/2017 12:48:30 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 Posted: 12/27/2017 1:14:05 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 Posted: 12/27/2017 1:44:03 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

...

AlgoIgnored.PNG
  • New Posts New Posts
  • No New Posts No New Posts