Unable to assign to variable in SS 0.98.5981 when using FindRoot Function

Unable to assign to variable in SS 0.98.5981 when using FindRoot Function - Messages

#1 Posted: 5/18/2016 9:20:15 AM
NDTM Amarasekera

NDTM Amarasekera

130 likes in 352 posts.

Group: User

Wrote

Hi
The "Open Channel Design" file attached earlier had erros inside the program section in calculating the critical slopes for each bed width. The corrected program is attached now.
Regret any inconvenience.



Now I observe that the result of FindRoot function unable to assign to a variable in attached SS file.
Test_FindRoot-1.sm (40 KiB) downloaded 53 time(s).

Above file was extracted from the original file Channel Design-using FindRoot-R1.sm (206 KiB) downloaded 43 time(s). for testing, but both had the same problem
under SS 0.98.5981. However, it was perfectly OK when I uploaded on 18th Oct. 2015 (cannot remember the SS version).

As Andrey has suggested, I did a clean installtion of SS, but the problem still exists.

Another isuue is also shown in the image.

Screenshot - Unit problem.png
Look within!... The secret is inside you. Best Regards Eng. NDTM Amarasekera - Sri Lanka
#2 Posted: 5/18/2016 10:05:46 AM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Wrote

Wrote

Hi
The "Open Channel Design" file attached earlier had erros inside the program section in calculating the critical slopes for each bed width. The corrected program is attached now.
Regret any inconvenience.



Now I observe that the result of FindRoot function unable to assign to a variable in attached SS file.
Test_FindRoot-1.sm (40 KiB) downloaded 53 time(s).

Above file was extracted from the original file Channel Design-using FindRoot-R1.sm (206 KiB) downloaded 43 time(s). for testing, but both had the same problem
under SS 0.98.5981. However, it was perfectly OK when I uploaded on 18th Oct. 2015 (cannot remember the SS version).

As Andrey has suggested, I did a clean installtion of SS, but the problem still exists.

Another isuue is also shown in the image.

Screenshot - Unit problem.png



Your worksheet will work in latest stable release 5935. The error you are facing is likely due http://smath.info/bts/Issues/IssueDetail.aspx?id=2318; I have a worksheet that is broken due to this and Andrey said he will fix it in the next nightly.

Regarding 3m - 2m = m, well I do hope Andrey will fix this - it is clearly an undesired behaviour.
#3 Posted: 5/18/2016 10:07:09 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

It works, version 5346 UNofficial distribution

Forum FindRoots.gif
#4 Posted: 5/18/2016 11:38:04 AM
NDTM Amarasekera

NDTM Amarasekera

130 likes in 352 posts.

Group: User

Thanks Alex and Jean for the clarifications. I tried in SS 5935 but not successful.
I hope these issues will be resolved by Andrey at his earliest.

Many thanks to Andrey for your great efforts and contributions in this regard.
Look within!... The secret is inside you. Best Regards Eng. NDTM Amarasekera - Sri Lanka
#5 Posted: 5/19/2016 7:06:54 PM
Andrey Ivashov

Andrey Ivashov

2270 likes in 3734 posts.

Group: Super Administrator

Thank you! I will check this before next stable release.

But for now it can be fixed by plug-ins developer as I've suggested here: http://en.smath.info/forum/yaf_postsm33336_SMath-Studio-0-98-5973--09-May-2016.aspx#post33336

Let me know if any help from my side required.

Regards.
1 users liked this post
Davide Carpi 5/19/2016 7:52:00 PM
#6 Posted: 5/20/2016 12:09:19 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Wrote

Wrote

Hi
The "Open Channel Design" file attached earlier had erros inside the program section in calculating the critical slopes for each bed width. The corrected program is attached now.
Regret any inconvenience.



Now I observe that the result of FindRoot function unable to assign to a variable in attached SS file.
Test_FindRoot-1.sm (40 KiB) downloaded 53 time(s).

Above file was extracted from the original file Channel Design-using FindRoot-R1.sm (206 KiB) downloaded 43 time(s). for testing, but both had the same problem
under SS 0.98.5981. However, it was perfectly OK when I uploaded on 18th Oct. 2015 (cannot remember the SS version).

As Andrey has suggested, I did a clean installtion of SS, but the problem still exists.

Another isuue is also shown in the image.

Screenshot - Unit problem.png



A working fix is to use line() in the function definition. Hope this helps Andrey to find a permanent fix.

Test_FindRoot-1.sm (40 KiB) downloaded 42 time(s).
1 users liked this post
Davide Carpi 5/20/2016 2:05:00 PM
#7 Posted: 5/20/2016 4:46:55 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Wrote



A working fix is to use line() in the function definition. Hope this helps Andrey to find a permanent fix.

Test_FindRoot-1.sm (40 KiB) downloaded 42 time(s).



Well I tried... It is still not possible to assign a value to a variable using FindRoot(). This nightly is officially broken for me - I NEED A WORKING SOLVER.

Back to stable release...

BugFR.sm (6 KiB) downloaded 67 time(s).
BugFR.png

#8 Posted: 5/20/2016 5:41:17 PM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Currently the solution indicated by Andrey applied without other changes makes the function not working even when used in the left side (makes the example file provided by ndtma not working at all); however seems the right way, I'm working on a solution based on this approach.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#9 Posted: 5/26/2016 7:54:14 PM
Andrey Ivashov

Andrey Ivashov

2270 likes in 3734 posts.

Group: Super Administrator

So, new build is here: http://en.smath.info/forum/yaf_postsm34488_SMath-Studio-0-98-5990--26-May-2016.aspx#post34488

It has corrections related to this topic.

I suggest to update plug-ins according to this comment: http://en.smath.info/forum/yaf_postsm33336_SMath-Studio-0-98-5973--09-May-2016.aspx#post33336

I you have to use not updated plug-in please give a chance to eval() function:
fixed_file_def.png

Why these changes are done:
diff_5990.png

Regards.
1 users liked this post
Davide Carpi 5/26/2016 8:05:00 PM
#10 Posted: 5/26/2016 8:06:17 PM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Thank you Andrey

I'm reworking the core of this plugin, will be back ASAP.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#11 Posted: 5/26/2016 11:20:58 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

This still does not work:
Wrote


BugFR.sm (6 KiB) downloaded 67 time(s).
BugFR.png



I am a little needy here, because without a working FindRoot() function I am left without a solver that I can use to assign values to variables. I do this all the time in tasks similar to... How many stirrups do I need in this RC beam?

Hope you guys can get me the FIndRoot() back :-)

... A peculiar occurrence. If you place the cursor inside the first red box and hit Ctrl + >, the 2nd red box will evaluate correctly. Magic!!???
#12 Posted: 6/2/2016 2:19:47 PM
Andrey Ivashov

Andrey Ivashov

2270 likes in 3734 posts.

Group: Super Administrator

Finally fixed.
Please check the latest nightly build (Note: it is required to download of the latest Nonlinear Solvers plug-in).
2 users liked this post
Davide Carpi 6/2/2016 3:32:00 PM, Alexander O. Melnik 6/2/2016 4:20:00 PM
#13 Posted: 6/2/2016 3:27:00 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Can someone please check this file?
BugFR.sm (6 KiB) downloaded 67 time(s).


It still does not work with 0.98.5997 and updated non-linear solvers on my machine

Thanks!
#14 Posted: 6/2/2016 3:35:00 PM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Thank you Andrey

Wrote

Can someone please check this file?
BugFR.sm (6 KiB) downloaded 67 time(s).


It still does not work with 0.98.5997 and updated non-linear solvers on my machine

Thanks!


It works as it should. You assign A.v in the first solution, thus in the second (C:...) there's nothing to solve. Use Clear(A.v) after the first to make it working the 2nd.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Alexander O. Melnik 6/2/2016 4:21:00 PM
#15 Posted: 6/2/2016 4:19:55 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Wrote

Thank you Andrey

Wrote

Can someone please check this file?
BugFR.sm (6 KiB) downloaded 67 time(s).


It still does not work with 0.98.5997 and updated non-linear solvers on my machine

Thanks!


It works as it should. You assign A.v in the first solution, thus in the second (C:...) there's nothing to solve. Use Clear(A.v) after the first to make it working the 2nd.



Thank you, I was not aware that FindRoot() automatically asssigns the result to a variable. I guess I was just stirring mud here..

Actually if this is correct this feature might be undesirable. What if you wooul like to solve a list of equations that have same variable? You will have to use "clear" every time...

Thank you Andrey!!!
#16 Posted: 6/2/2016 4:49:28 PM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

I know, and there are several other drawbacks related to this feature; as mentioned in the BTS some days ago about one of these drawbacks, in the next plugin version this feature will be removed. Boolean equal in initial guess will means "use these values as initial guess for that unknown".
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Alexander O. Melnik 6/2/2016 4:55:00 PM
#17 Posted: 6/3/2016 2:55:30 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

with Smath 5346 UNofficial release. No idea if it makes sense ?

Forum FindRoots 5346.gif
#18 Posted: 6/5/2016 7:19:30 PM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Wrote

with Smath 5346 UNofficial release. No idea if it makes sense ?

Forum FindRoots 5346.gif



I cannot reproduce neither with version 1.0999.5 of the plugin nor with later versions (strange). I suppose it may have sense, in some way, since undefined variables are store as names. However the second result is wrong, so something definitely goes wrong in that case :/

If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
  • New Posts New Posts
  • No New Posts No New Posts