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 RFreund  
#1 Posted : 09 August 2017 06:09:56(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 325
United States
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).

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

Offline Davide Carpi  
#2 Posted : 09 August 2017 11:20:11(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 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
Offline RFreund  
#3 Posted : 09 August 2017 13:53:43(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 325
United States
Location: IL

Was thanked: 19 time(s) in 17 post(s)
I see, Thank you!

Alternatively I could have used a different variable name?
Offline Jean Giraud  
#4 Posted : 09 August 2017 17:18:06(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: RFreund Go to Quoted Post
"Variable and Function Names Can't Start With Number"


That what it means. Since 6179, Sum needs be locally defined.

SumLocalDefinition.PNG
Offline Davide Carpi  
#5 Posted : 09 August 2017 17:21:20(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: RFreund Go to Quoted Post
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

2017-08-09 16_19_37-SMath Studio - [Simple Beam - Function.sm_].png

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
Offline RFreund  
#6 Posted : 10 August 2017 05:46:13(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 325
United States
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!
Offline Jean Giraud  
#7 Posted : 10 August 2017 15:14:02(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: RFreund Go to Quoted Post
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.

Conditional.PNG
Offline Jean Giraud  
#8 Posted : 10 August 2017 18:28:49(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 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.
Offline Davide Carpi  
#9 Posted : 11 August 2017 02:00:27(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: RFreund Go to Quoted Post
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)
2017-08-11 00_38_33-SMath Studio - [Simple Beam - Function.sm_].png

Originally Posted by: RFreund Go to Quoted Post
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).
2017-08-11 00_53_19-SMath Studio - [Page1_].png

Originally Posted by: RFreund Go to Quoted Post
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
Offline Jean Giraud  
#10 Posted : 11 August 2017 05:05:51(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: RFreund Go to Quoted Post
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).
Offline RFreund  
#11 Posted : 15 August 2017 04:49:08(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 325
United States
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.
Offline Jean Giraud  
#12 Posted : 15 August 2017 06:32:27(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: RFreund Go to Quoted Post
@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

Offline RFreund  
#13 Posted : 15 August 2017 13:50:06(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 325
United States
Location: IL

Was thanked: 19 time(s) in 17 post(s)
Yes, i do, thank you.
Offline Jean Giraud  
#14 Posted : 15 August 2017 17:22:39(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: RFreund Go to Quoted Post
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

Users browsing this topic
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.