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

Notification

Icon
Error

Login


2 Pages12>
Options
Go to last post Go to first unread
Offline sinneD  
#1 Posted : 08 March 2019 00:52:37(UTC)
sinneD


Rank: Advanced Member

Groups: Registered
Joined: 12/03/2011(UTC)
Posts: 101
Location: Chicago

Was thanked: 16 time(s) in 7 post(s)
I am using 0.099 - build 7005

The error highlighting has worked GREAT so far, but today I ran into a case where it is highlighting the wrong equation variable. The error is actually that other variables I am citing are below the equation, but it seems that the first equation variable is getting flagged.

Error-Syntax_Hightlighting.PNG

Edited by moderator 09 March 2019 14:54:39(UTC)  | Reason: Not specified

Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW

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

Offline Andrey Ivashov  
#2 Posted : 09 March 2019 22:27:20(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Hello.

What error message does it show?
Offline Razonar  
#3 Posted : 09 March 2019 23:55:27(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
I guess that the problem is with the if clause, and it's special evaluation method.

Clipboard01.jpg

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 09/03/2019(UTC)
Offline Andrey Ivashov  
#4 Posted : 09 March 2019 23:59:11(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Thank you very much.
Will fix it soon.

Best regards.
Offline sinneD  
#5 Posted : 21 March 2019 11:00:16(UTC)
sinneD


Rank: Advanced Member

Groups: Registered
Joined: 12/03/2011(UTC)
Posts: 101
Location: Chicago

Was thanked: 16 time(s) in 7 post(s)
I noticed something else with this- if the function is defined ABOVE a variable that it uses is defined, then the error highlight triggers.

Then, when the function is evaluated below that, the function is highlighted, and the evaluation is halted too. So the error is flagged and the evaluation of the function is stopped.

Previously, I believe that the function was not evaluated, so that it generated no error. Similarly, the function results would be evaluated after the variable definition.

This is may be a real problem for those of us who define a bunch of equations well above where they get used if the evaluation of them is done after the dependent variables are evaluated or defined.


error-highlight-1.PNG

error-highlight-2.PNG
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline Razonar  
#6 Posted : 21 March 2019 11:55:13(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: sinneD Go to Quoted Post
...
Previously, I believe that the function was not evaluated, so that it generated no error. Similarly, the function results would be evaluated after the variable definition.

This is may be a real problem for those of us who define a bunch of equations well above where they get used if the evaluation of them is done after the dependent variables are evaluated or defined.


Hi sinneD. Without the actual worksheet it's hard to say, but I guess that this it's a feature of SMath (*), and you can prevent the immediate evaluation enclosing CheckIA with a line(...).

Best regards.
Alvaro.

(*) see https://en.smath.com/for...-a-program.aspx#post7966 for example.
Offline sinneD  
#7 Posted : 21 March 2019 15:38:17(UTC)
sinneD


Rank: Advanced Member

Groups: Registered
Joined: 12/03/2011(UTC)
Posts: 101
Location: Chicago

Was thanked: 16 time(s) in 7 post(s)
Here is a snippet from the original file-

error-highlight.sm (13kb) downloaded 15 time(s).

Previously, I recall that the function would evaluate at the end no matter where the function was defined or its evaluation status. I realize that I am asking it to evaluate before all the variables are defined.


error-highlight-3.PNG

Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline alyles  
#8 Posted : 21 March 2019 16:44:12(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 276
United States

Was thanked: 91 time(s) in 57 post(s)
Originally Posted by: sinneD Go to Quoted Post

I realize that I am asking it to evaluate before all the variables are defined.



Why are you doing that? If you remove the evaluation then CheckIA_LC2 at the end evaluates just fine.

Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline Razonar  
#9 Posted : 21 March 2019 17:39:43(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi. Alyles it's right. Just don't force the evaluation in the definition of CheckIA. Don't need line(...) in this case. But this because none of the variables in it's definition have a value. See the effect of line(...) in T.all (with line) and V.all (without line)

Clipboard05.gif

Best regards.
Alvaro.
Offline sinneD  
#10 Posted : 21 March 2019 22:21:38(UTC)
sinneD


Rank: Advanced Member

Groups: Registered
Joined: 12/03/2011(UTC)
Posts: 101
Location: Chicago

Was thanked: 16 time(s) in 7 post(s)
Yes, you are right, there is no reason to evaluate like this. I think I have gotten accustomed to not having the best coding habits, and the are now manifesting themselves. What I also chose to illustrate this might be misleading.

1. When I write logic/evaluations like this, Once I make the first on, I copy-paste for the additional cases I want to check right below the first instance of the equation. That way, if I had to edit the formula at a later date, all the instances would be grouped together.

In this instance, I the thing that am trying to Check Inter-Action for Load Case 2, hence the variable name CheckIA_LC2. The LC1 one was a page or two before that. LC1 and LC2 were one over the other where I first defined LC1.


2. I also usually leave them on the 'right page' that does not print because I only want the results at the end.

I moved the function definition to this part of the calc to try and figure out why the last evaluation was not working and condense the screenshot.

The major point I am trying to make is that previous versions of SMath might throw an error at the function level because the variables were not defined, but did not disable evaluation that is called after the variables have been made.



Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline Razonar  
#11 Posted : 22 March 2019 04:57:30(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: sinneD Go to Quoted Post

The major point I am trying to make is that previous versions of SMath might throw an error at the function level because the variables were not defined, but did not disable evaluation that is called after the variables have been made.


Hi. For that behavior you need the line, as in the attached: in red because can't evaluate numerically at this position in the worksheet, but give the correct result many times when it's variables have values.

Clipboard05.gif

Best regards.
Alvaro.
Offline Jean Giraud  
#12 Posted : 22 March 2019 06:59:47(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)
On the other hand, besides version/version, just copying from other is generally
not the best approach. Modular stand alone pieces is better and easier to debug.
You seem to complicate matters, then complain.
Smath kernel is exceptionally powerful and convivial, long learning curve.
Offline sinneD  
#13 Posted : 27 March 2019 21:10:53(UTC)
sinneD


Rank: Advanced Member

Groups: Registered
Joined: 12/03/2011(UTC)
Posts: 101
Location: Chicago

Was thanked: 16 time(s) in 7 post(s)
Jean Giraud-

I take exception to your response, especially your statement that I am nothing more than a 'complicator' and a 'complainer'. That goes against the respectful, collaborative discourse that I have grown to expect from this community.

The calculation sheets that I am using as examples to highlight the issues I am seeing I developed many years ago, under different versions and I am re-utilizing and updating them now with the latest manufacturer information.

I believe that there is a problem with this new feature, and I am discovering it through a sequence of repetitive calculations. Those of us who are NOT the best programmers are the ones who benefit the most from this, but unfortunately the ones who are going to experience the bugs/issues more since we are the ones who make the most mistakes.

Here is another example, written from SCRATCH that again highlights an issue with the error checking. I am trying to re-write an old MathCad sheet I wrote under version 11 in SMath.

The only copying and pasting going on here is I build complicated formulas incrementally to ensure that I can back check the terms by hand before the final equation and output. You can see the progression in the worksheet.

I am mystified why the equation is halting evaluation and noting that the N.cols variable is undefined, yet I can call it above and below the statement.


https://i.imgur.com/oRWzAWy.png

PileFactorError2.PNG

PileFactorMCad.PNG

PileRedux_Factor.sm (7kb) downloaded 18 time(s).

Edited by user 27 March 2019 21:14:57(UTC)  | Reason: Not specified

Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline PompelmoTell  
#14 Posted : 27 March 2019 21:56:55(UTC)
PompelmoTell


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2011(UTC)
Posts: 319
Man
Italy
Location: italy

Was thanked: 109 time(s) in 93 post(s)
It is not very consistent to use the same name for constants of fixed value and for the variables of a function. If you do, the evaluation of the function makes no sense except in symbolic form (as I did here).

PileRedux_Factor_ser.sm (8kb) downloaded 16 time(s).

sergio
thanks 1 user thanked PompelmoTell for this useful post.
on 28/03/2019(UTC)
Offline churichuro  
#15 Posted : 27 March 2019 22:23:28(UTC)
churichuro


Rank: Advanced Member

Groups: Registered
Joined: 27/03/2019(UTC)
Posts: 75
Mexico
Location: coah

Was thanked: 27 time(s) in 22 post(s)


this work for me.
Offline sinneD  
#16 Posted : 28 March 2019 02:19:31(UTC)
sinneD


Rank: Advanced Member

Groups: Registered
Joined: 12/03/2011(UTC)
Posts: 101
Location: Chicago

Was thanked: 16 time(s) in 7 post(s)
Sergio & churichuro-

Thank you both for your responses.

The original MathCad i wrote maybe 12-13 years ago. I am trying to update it.

The equation was defined for graphing using the series i and j.

At the end, I find the explicit value by defining the actual numbers.

I am confused by why the EXACT same code works on your end but not on mine.
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline alyles  
#17 Posted : 28 March 2019 02:27:24(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 276
United States

Was thanked: 91 time(s) in 57 post(s)
Originally Posted by: sinneD Go to Quoted Post


I am confused by why the EXACT same code works on your end but not on mine.


It's not the exact same code. Sergio uses symbolic evaluation (Ctrl + .) Same as right click clicking expression, changing optimization to symbolic.
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
thanks 1 user thanked alyles for this useful post.
on 28/03/2019(UTC)
Offline sinneD  
#18 Posted : 28 March 2019 03:42:38(UTC)
sinneD


Rank: Advanced Member

Groups: Registered
Joined: 12/03/2011(UTC)
Posts: 101
Location: Chicago

Was thanked: 16 time(s) in 7 post(s)
I did not think of the symbolic evaluation. Thank you.
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline churichuro  
#19 Posted : 28 March 2019 04:09:11(UTC)
churichuro


Rank: Advanced Member

Groups: Registered
Joined: 27/03/2019(UTC)
Posts: 75
Mexico
Location: coah

Was thanked: 27 time(s) in 22 post(s)
the difference is in evaluation (=), that is after the definitions.
do this in two step and then no error is show
Offline CBG  
#20 Posted : 28 March 2019 06:55:52(UTC)
CBG


Rank: Advanced Member

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

Was thanked: 77 time(s) in 58 post(s)
This is an approach, maybe Jean or Alvaro, can Doctor it

PileRedux_Factor.png

PileRedux_Factor_CBG.sm (21kb) downloaded 16 time(s).



Best Regards

Carlos
Users browsing this topic
Guest
2 Pages12>
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.