Multi-Variable Function Error, variable not defined

Multi-Variable Function Error, variable not defined - Cannot determine where the error is in this function - Сообщения

#1 Опубликовано: 25.12.2017 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 Опубликовано: 25.12.2017 19:11:16
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 КиБ) скачан 86 раз(а).
#3 Опубликовано: 25.12.2017 19:27:04
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

... that one fresh from the bakery.

2D Plot Tip Setup Critical.sm (60 КиБ) скачан 65 раз(а).
#4 Опубликовано: 25.12.2017 19:40:45
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

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

Image Formated LABEL [Oxyhemoglobin].sm (17 КиБ) скачан 58 раз(а).
#5 Опубликовано: 26.12.2017 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 Опубликовано: 26.12.2017 10:07:41
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 Опубликовано: 26.12.2017 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 КиБ) скачан 38 раз(а).

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 Опубликовано: 26.12.2017 14:04:55
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 КиБ) скачан 39 раз(а).
#9 Опубликовано: 26.12.2017 14:08:41
CBG

CBG

77 сообщений из 312 понравились пользователям.

Группа: User





HPC_Short.png


HPC Short Revise AR makeup_R1.sm (96 КиБ) скачан 49 раз(а).


Best Regards

Carlos
1 пользователям понравился этот пост
Davide Carpi 27.12.2017 12:42:00
#10 Опубликовано: 26.12.2017 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 Опубликовано: 26.12.2017 15:57:43
CBG

CBG

77 сообщений из 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 Опубликовано: 26.12.2017 22:15:39
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 КиБ) скачан 40 раз(а).
#13 Опубликовано: 27.12.2017 00:29:04
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 КиБ) скачан 31 раз(а).


#14 Опубликовано: 27.12.2017 00:48:30
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 Опубликовано: 27.12.2017 01:14:05
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 Опубликовано: 27.12.2017 01:44:03
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

...

AlgoIgnored.PNG
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений