Cannot Calculate Error Message

Cannot Calculate Error Message - Functions return a "Cannot calculate" error message - Сообщения

#1 Опубликовано: 18.04.2018 19:05:31
Ryan Freund

Ryan Freund

19 сообщений из 339 понравились пользователям.

Группа: User

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 (20 КиБ) скачан 65 раз(а).
#2 Опубликовано: 18.04.2018 19:37:38
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

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 please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Опубликовано: 18.04.2018 22:55:27
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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

#4 Опубликовано: 19.04.2018 12:03:09
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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 !



#5 Опубликовано: 20.04.2018 12:47:32
Andrey Ivashov

Andrey Ivashov

2270 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

Hello.

Just remove first line from fMOIF(s#,n1#,n2#) definition:
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.
#6 Опубликовано: 20.04.2018 13:24:24
Arie

Arie

93 сообщений из 285 понравились пользователям.

Группа: User

Wrote


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
1 пользователям понравился этот пост
Andrey Ivashov 20.04.2018 16:06:00
#7 Опубликовано: 20.04.2018 15:16:59
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

Hello.

Just remove first line from fMOIF(s#,n1#,n2#) definition:

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://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Andrey Ivashov 20.04.2018 16:06:00
#8 Опубликовано: 20.04.2018 15:30:34
Ryan Freund

Ryan Freund

19 сообщений из 339 понравились пользователям.

Группа: User

Цитата

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).
1 пользователям понравился этот пост
Andrey Ivashov 20.04.2018 16:06:00
#9 Опубликовано: 20.04.2018 21:34:02
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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 (20 КиБ) скачан 44 раз(а).
Image Spot Dalmatian.sm (18 КиБ) скачан 36 раз(а).


#10 Опубликовано: 21.04.2018 13:46:28
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

... matrices construct by themselves.

Calipers.PNG
#11 Опубликовано: 21.04.2018 23:30:51
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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]

#12 Опубликовано: 24.04.2018 19:58:00
Ryan Freund

Ryan Freund

19 сообщений из 339 понравились пользователям.

Группа: User

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 (190 КиБ) скачан 51 раз(а).
#13 Опубликовано: 24.04.2018 20:13:55
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

Wrote

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 (190 КиБ) скачан 51 раз(а).



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?)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#14 Опубликовано: 24.04.2018 22:50:17
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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"
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений