Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline John Evans  
#1 Posted : 26 December 2017 00:06:56(UTC)
John Evans


Rank: Member

Groups: Registered
Joined: 14/12/2017(UTC)
Posts: 10
United States
Location: Florida

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

Edited by user 26 December 2017 00:38:26(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 26 December 2017 01:11:16(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
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 (187kb) downloaded 62 time(s).
Offline Jean Giraud  
#3 Posted : 26 December 2017 01:27:04(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
... that one fresh from the bakery.

2D Plot Tip Setup Critical.sm (61kb) downloaded 39 time(s).
Offline Jean Giraud  
#4 Posted : 26 December 2017 01:40:45(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
... did you miss that one ?
Smath is gorgeous for publishing !

Image Formated LABEL [Oxyhemoglobin].sm (18kb) downloaded 36 time(s).
Offline John Evans  
#5 Posted : 26 December 2017 08:44:18(UTC)
John Evans


Rank: Member

Groups: Registered
Joined: 14/12/2017(UTC)
Posts: 10
United States
Location: Florida

Jean,
I am still not seeing where the simple function went wrong. Why the error?
John
Offline Jean Giraud  
#6 Posted : 26 December 2017 16:07:41(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: John Evans Go to Quoted Post
Jean,
I am still not seeing where the simple function went wrong. Why the error?
John

Please, attach the WS for doctoring.

MachError.PNG

Offline John Evans  
#7 Posted : 26 December 2017 18:00:20(UTC)
John Evans


Rank: Member

Groups: Registered
Joined: 14/12/2017(UTC)
Posts: 10
United States
Location: Florida

Jean,
Thanks for the assistance. Please find attached the file I started that contains the error.
HPC Short Revise AR makeup.sm (97kb) downloaded 20 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.
Offline Jean Giraud  
#8 Posted : 26 December 2017 20:04:55(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: John Evans Go to Quoted Post
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 (99kb) downloaded 19 time(s).
Offline CBG  
#9 Posted : 26 December 2017 20:08:41(UTC)
CBG


Rank: Advanced Member

Groups: Registered
Joined: 14/10/2015(UTC)
Posts: 308

Was thanked: 77 time(s) in 58 post(s)




HPC_Short.png


HPC Short Revise AR makeup_R1.sm (97kb) downloaded 25 time(s).


Best Regards

Carlos
thanks 1 user thanked CBG for this useful post.
on 27/12/2017(UTC)
Offline John Evans  
#10 Posted : 26 December 2017 21:12:25(UTC)
John Evans


Rank: Member

Groups: Registered
Joined: 14/12/2017(UTC)
Posts: 10
United States
Location: Florida

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
Offline CBG  
#11 Posted : 26 December 2017 21:57:43(UTC)
CBG


Rank: Advanced Member

Groups: Registered
Joined: 14/10/2015(UTC)
Posts: 308

Was thanked: 77 time(s) in 58 post(s)
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
Offline Jean Giraud  
#12 Posted : 27 December 2017 04:15:39(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
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 (29kb) downloaded 17 time(s).
Offline Jean Giraud  
#13 Posted : 27 December 2017 06:29:04(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: John Evans Go to Quoted Post
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 (61kb) downloaded 16 time(s).


Offline Jean Giraud  
#14 Posted : 27 December 2017 06:48:30(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
... 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.
Offline Jean Giraud  
#15 Posted : 27 December 2017 07:14:05(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
... 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"
Offline Jean Giraud  
#16 Posted : 27 December 2017 07:44:03(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
...

AlgoIgnored.PNG
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.