SMath Studio Forum
»
SMath Studio
»
Questions
»
Multi-Variable Function Error, variable not defined
Rank: Member Groups: Registered
Joined: 14/12/2017(UTC) Posts: 10 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) Edited by user 26 December 2017 00:38:26(UTC)
| Reason: Not specified
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 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).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
|
|
|
|
Rank: Member Groups: Registered
Joined: 14/12/2017(UTC) Posts: 10 Location: Florida
|
Jean, I am still not seeing where the simple function went wrong. Why the error? John
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: John Evans Jean, I am still not seeing where the simple function went wrong. Why the error? John Please, attach the WS for doctoring.
|
|
|
|
Rank: Member Groups: Registered
Joined: 14/12/2017(UTC) Posts: 10 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? I just tried to render the units out of the function, but to no avail.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: John Evans 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).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 14/10/2015(UTC) Posts: 308
Was thanked: 77 time(s) in 58 post(s)
|
|
1 user thanked CBG for this useful post.
|
|
|
Rank: Member Groups: Registered
Joined: 14/12/2017(UTC) Posts: 10 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
|
|
|
|
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
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 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 Utilities Most used [Step Detect].sm (29kb) downloaded 17 time(s).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: John Evans 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).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 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.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 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"
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
...
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Multi-Variable Function Error, variable not defined
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.