SMath Studio Forum
»
SMath Studio
»
Questions
»
Variable and Function Names Can't Start With Number
Rank: Advanced Member Groups: Registered
Joined: 25/09/2013(UTC) Posts: 325 Location: IL Was thanked: 19 time(s) in 17 post(s)
|
Attached is an older worksheet for simple span beams. It used to "work". However, now I receive an error "Variable and Function Names Can't Start With Number". I can't seem to find this error. Any help would be greatly appreciated. Thanks! Simple Beam - Function.sm (65kb) downloaded 39 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,647 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
Hello, there are known issues with the iterator name of functions like sum, if that variable was previously defined; just clear it before using inside sum. Simple Beam - Function.sm (65kb) downloaded 59 time(s).Edited by user 09 August 2017 13:13:06(UTC)
| Reason: Not specified |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 25/09/2013(UTC) Posts: 325 Location: IL Was thanked: 19 time(s) in 17 post(s)
|
I see, Thank you!
Alternatively I could have used a different variable name?
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: RFreund "Variable and Function Names Can't Start With Number" That what it means. Since 6179, Sum needs be locally defined.
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,647 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
Originally Posted by: RFreund I see, Thank you!
Alternatively I could have used a different variable name? You can, but you might experience the issue again if that variable is used somewhere and then you call your function Clear() is the most reliable way to act, and won't change the logic of your function even when this issue will be solved |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 25/09/2013(UTC) Posts: 325 Location: IL Was thanked: 19 time(s) in 17 post(s)
|
Thanks for you help. A couple questions:
1. I seem to get a bad result (it is incorrect) as noticed by the units. I'm not sure what's going on there. 2. Where is 'n' being defined in the original function? Or do I need to clear(n) before every sum?
Thanks again!
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: RFreund 1. I seem to get a bad result (it is incorrect) as noticed by the units. I'm not sure what's going on there. 2. Where is 'n' being defined in the original function? Or do I need to clear(n) before every sum?
================================== To me, "Units" is the greatest pest ever invented. I worked all my life with Engineering formulas "pencil/paper" ... formulas designed in the appropriate units. Just a comment There is no error message... what about changing the exponent 'n' in fsin(x,a,n) with something less confusing. Whether your version needs 'Sum' be locally defined or not ? ... you must try the example posted before. Clear(n) does nothing. To clear 'x' in a project, instruct like this x:=Clear(x) ... don't know if it clears within program ? If there is error in the construction and if the construction is too involved it may not report any error at all ... same with Mathcad, can't trace back. What about a minimal pieces to help checking individual results. would be much easier to debug. If you want to clean from the gyzmas '#': easy and not easy Put the selection on the right of a#, press F8 to select all [highlighted gray] Press backspace to remove the # ... it does not clean an exponent and may not clean a long construction. Check each has been cleaned, if not clean manually.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
"Variable and function names can't start with number" [Old work sheet that now produces error] ======================================== That's what you have to isolate first, it was created 5346 or earlier version. If so => the suspect is the Sum(s). Personally, I have dozens of those. Good thing we know how to doctor.
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,647 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
Originally Posted by: RFreund Thanks for you help. A couple questions:
1. I seem to get a bad result (it is incorrect) as noticed by the units. I'm not sure what's going on there. Not really sure what's going on there while the units are correct, but they shows that something is messed up. What is going different is that nested systems are no more joined (at least for the el() function). You can use a couple of nested el(), that however are correct for how the result is built (a system of systems) Originally Posted by: RFreund 2. Where is 'n' being defined in the original function? In the for loops before the sums. Try it on the canvas, the iterator variable is available with his last value outside the loop (by design). Originally Posted by: RFreund Or do I need to clear(n) before every sum? before any sum in which you might not have the control on what is defined before; In this case, the first sum() inside the function, whatever you use or not use n locally, because n might be used on the canvas. If you still want to use n in amid of 2 sums, you have to clear it again before the second sum. However if you forget it the error status shows that something is gone wrong. Edited by user 11 August 2017 02:08:24(UTC)
| Reason: Not specified |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: RFreund Attached is an older worksheet for simple span beams. It used to "work". However, now I receive an error "Variable and Function Names Can't Start With Number". I can't seem to find this error. Any help would be greatly appreciated. ============================================= Please, check the attached: 1. Not a case of clearing anything 2. Changed the nSum for mSum 3. Removed all gyzmas # 4. NO error message I understand nothing in that kind of work, but results make sense even with units. Simple Beam - Copy.sm (64kb) downloaded 23 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 25/09/2013(UTC) Posts: 325 Location: IL Was thanked: 19 time(s) in 17 post(s)
|
@Jean and @Davide thank you both very much for your contributions. I think I understand now.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: RFreund @Jean and @Davide thank you both very much for your contributions. I think I understand now. Do you have the right results ? That was the question. If NOT, you may have to debug the program piecewise. Cheers, Jean
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 25/09/2013(UTC) Posts: 325 Location: IL Was thanked: 19 time(s) in 17 post(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: RFreund Yes, i do, thank you. ==================== Nice you have the right result c/w units. wrt the error message: I can't reproduce it anymore 6179. It seems it has repaired itself, maybe some left over from the coding ... similar left over codes in Mathcad 11. Cheers collab, Jean
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Variable and Function Names Can't Start With Number
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.