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 : 19 April 2018 01:05:31(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)
Since updating to Version 0.99.6671 (07 April 2018)

Several functions now return a "Cannot Calculate" error.
Any thoughts?

Thanks in advance!

Analysis - Fastener Group Elastic Vector Method.sm (21kb) downloaded 42 time(s).

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

Offline Davide Carpi  
#2 Posted : 19 April 2018 01:37:38(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1329 time(s) in 875 post(s)
seems the problem is in matrix(0;#) (probably related with this), not sure if intentional or not.

Clear(r#) does the job BTW.
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Jean Giraud  
#3 Posted : 19 April 2018 04:55:27(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: RFreund Go to Quoted Post
Since updating to Version 0.99.6671 (07 April 2018)

Several functions now return a "Cannot Calculate" error.
Any thoughts?

Thanks in advance!

... Smath 6179 ... just make the input/output coherent wrt units

Fastener.PNG

Offline Jean Giraud  
#4 Posted : 19 April 2018 18:03:09(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: RFreund Go to Quoted Post
Since updating to Version 0.99.6671 (07 April 2018)

Several functions now return a "Cannot Calculate" error.
Any thoughts?

Switching from 5346 => 6179 created lot of similar "errors",
all sorts of error messages, sometimes easy to correct.
My point here is otherwise, some work sheet can not be repaired.
Once a work sheet is corrupted, I must copy/paste section by section
in blank sheet, up until reconstruction is complete.
Moral: avoid too huge document !



Offline Andrey Ivashov  
#5 Posted : 20 April 2018 18:47:32(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.

Just remove first line from fMOIF(s#,n1#,n2#) definition:
Code:
r#:matrix(0,n1#)


Why it was added? It does nothing for further calculation. What is a reason for it?
It is not a first time when I see code like matrix(0,0) and actually I do not understand what is it for... SMath Studio never had a possibility to generate a matrix of zero elements.

Best regards.
Offline alyles  
#6 Posted : 20 April 2018 19:24: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: Andrey Ivashov Go to Quoted Post

It is not a first time when I see code like matrix(0,0) and actually I do not understand what is it for... SMath Studio never had a possibility to generate a matrix of zero elements.


I'm not sure what the intent was in this example, but I've used empty matrices before in Matlab. At least in my experiences, it's been used to represent an empty set. It can be useful when try to extract/filter/search through large data sets. You can perform the same sort of function in SMath but you either have to use the IsDefined() function and add an extra condition in your program or create a "dummy" value at index 1 then remember to ignore it.

Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
thanks 1 user thanked alyles for this useful post.
on 20/04/2018(UTC)
Offline mkraska  
#7 Posted : 20 April 2018 21:16:59(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,985
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: Andrey Ivashov Go to Quoted Post
Hello.

Just remove first line from fMOIF(s#,n1#,n2#) definition:
Code:
r#:matrix(0,n1#)


Why it was added? It does nothing for further calculation. What is a reason for it?
It is not a first time when I see code like matrix(0,0) and actually I do not understand what is it for... SMath Studio never had a possibility to generate a matrix of zero elements.

Best regards.


I don't know why the topic starter did it. He seems to allocate a matrix with no rows and then uses linear indexing.
Initializing matrices with no rows or columns is required for subsequent build-up of the contents using stack or augment in a loop.
See Handbuch page 130/131 for examples.

Now that implicit loops are available, this type of generating matrices may loose popularity. Yet initializing with an empty matrix is a safe way to enable assignment to elements (as using Clear() would be).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 20/04/2018(UTC)
Offline RFreund  
#8 Posted : 20 April 2018 21:30:34(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)
Quote:
Why it was added? It does nothing for further calculation. What is a reason for it?
It is not a first time when I see code like matrix(0,0) and actually I do not understand what is it for...


I used matrix(0,0) in this instance to make sure that r# is "clear". Now that I can use the clear() function I don't need to do this. However, I do use matrix(0,0) in other functions in order to "stack" or "augment" other matrices into the (0,0) matrix. Which is what Martin has described.

So will matrix(0,0) return and error in all cases now? If yes, what is the best way to build up a matrix that starts with nothing? I use this in other functions and I believe is also utilized in Martin's beam calculation snippet (great snippet by the way).
thanks 1 user thanked RFreund for this useful post.
on 20/04/2018(UTC)
Offline Jean Giraud  
#9 Posted : 21 April 2018 03:34:02(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: RFreund Go to Quoted Post
what is the best way to build up a matrix that starts with nothing?

Matrix/vector don't start with nothing, they self-build from some sort of applied calculations.
If the algorithm is a recursive composition, it may be true that it needs an initial something.
A good such example is Mandelbrot [in Samples, partially solved].
On the other hand, many, very many visitors depose the problem with too little or insuuficient
indications to help track their route to failure.

Utilities Matrix Sequence[N].sm (21kb) downloaded 20 time(s).
Image Spot Dalmatian.sm (19kb) downloaded 20 time(s).


Offline Jean Giraud  
#10 Posted : 21 April 2018 19:46:28(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)
... matrices construct by themselves.

Calipers.PNG
Offline Jean Giraud  
#11 Posted : 22 April 2018 05:30:51(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: RFreund Go to Quoted Post
what is the best way to build up a matrix that starts with nothing?

Something that is nothing in numerical maths is NaN
NaN => Not a Number.
From recollection, Tom used NaN:= 10^-307
because Tom didn't purchase DAEP [2003 ... $ 350]

Offline RFreund  
#12 Posted : 25 April 2018 01:58:00(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 seem to have the same error statement with this worksheet, but I don't define an "empty" matrix.

Sorry to be a pest, any thoughts on this?
Thanks again
Analysis - Beam - Simple Span - V3.sm (191kb) downloaded 28 time(s).
Offline Davide Carpi  
#13 Posted : 25 April 2018 02:13:55(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: RFreund Go to Quoted Post
I seem to have the same error statement with this worksheet, but I don't define an "empty" matrix.

Sorry to be a pest, any thoughts on this?
Thanks again
Analysis - Beam - Simple Span - V3.sm (191kb) downloaded 28 time(s).


This is because in GetMax you are trying to build a matrix on x1# (that seems to be a variable named x#, this triggers the error)

Use Clear(x1#) or don't pass the second argument (why was needed?)

Edited by user 25 April 2018 02:17:21(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  
#14 Posted : 25 April 2018 04:50:17(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: Davide Carpi Go to Quoted Post
I seem to have the same error statement with this worksheet, but I don't define an "empty" matrix.


Smath 6179 generates no error "can not calculate"
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.