NonlinearSolvers plugin

NonlinearSolvers plugin - BDQRF, Bisection, Brent's, Broyden's, Newton-Raphson, Ridder's, Secant, Homotopy - Messages

#221 Posted: 10/29/2016 3:29:16 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Wrote

That's not a bug Radovan:

=>...For the free finding solutions, IC must be either 0 or 1
[1 to releive from "divide by zero"]<= ... {previous message}
Maybe you are not up to date vs Davide ?

Jean



I was using SMath 0.98.6128 an NonlinerSolver 1.1.6099.14159

Regards,
Ra
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#222 Posted: 5/16/2017 1:20:27 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Wrote

Thank you guys, these examples are very useful to fix the bugs in this plugin

I'm working to a new version of the code, almost totally refactored.
Looking at your examples seems there are several things to fix in my preprocessor; with some tweak, it is able to solve it.

2016-10-24 18_27_07-SMath Studio - [FindRoot.sm_].png

now I just have to find some consistant way to make it working always



Davide, any progress about this plugin and its new version?

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#223 Posted: 5/16/2017 3:00:19 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

Davide, any progress about this plugin and its new version?

Regards,
Radovan



Hello Radovan!

More or less, I'm trying to make it working on the numerical functions (those containing if/else, etc...), requires some more refactoring, I'll see if I can focus on this plugin in the coming weeks...
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
Radovan Omorjan 5/16/2017 4:34:00 PM
#224 Posted: 5/16/2017 11:32:46 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Maybe, I don't understand much in there ?

Jean

Page1 Unknown Solve.sm (30 KiB) downloaded 70 time(s).
#225 Posted: 5/17/2017 10:11:59 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Wrote

Maybe, I don't understand much in there ?

Jean

Page1 Unknown Solve.sm (30 KiB) downloaded 70 time(s).


Helo Jean,

You should define f(x) not f(u). See the file, please. Was that your question?

Page1%20Unknown%20Solve-2-corr.sm (34 KiB) downloaded 74 time(s).

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#226 Posted: 5/19/2017 8:55:47 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Hello Radovan,

Example in context works fine for me. Integrator is now "scalar" 6179.
It enables the Fourier Quantum double integral, though awfully slow.
For N =31, CoC takes > 2hrs [Win 7 1.6 GHz]. ∫(x) comes from Maple.

Jean

Integral Curve Nuance.sm (26 KiB) downloaded 72 time(s).
#227 Posted: 4/13/2018 1:13:37 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Hello SMath Community, need some help with findroot() function.

I wrote a formula (biaxial bending in a column) to calculate unknown input loads based on known response. A key to practical use of the formula is to solve for unknown response based on known input loads (backwards of what formula does). When using findroot() for this purpose i run into error:
FidRoot-CustomFormulaSolution.sm (537 KiB) downloaded 56 time(s).
FidRoot-CustomFormulaSolution.png
What am i doing wrong?

Thanks!
#228 Posted: 4/13/2018 1:36:36 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

FindRoot, as well as other solvers of NS plugin, is not friend of eval, if/else or in general anything that requires a strict numerical evalution to be performed... that's a thing I'm working on (long overdue, I know...)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 users liked this post
sergio 4/13/2018 4:14:00 PM, Alexander O. Melnik 4/15/2018 12:39:00 PM
#229 Posted: 12/11/2018 8:14:58 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

I don't know when these changes happened but my current observation of Findroot's behaviour seems to be different from earlier versions:

  • Just evaluate: displays result vector and executes embedded assignment

  • Assign and evaluate in the same region: Error (symbolic evaluation reveals that the expression isn't executed but just stored as if it was inside line())

  • Assign and evaluate in separate regions: displays result vector and executes embedded assignment upon display.

  • Assign wrapped in eval() and evaluate in the same region: displays result vector and executes embedded assignment (here, eval() seems to be a friend of FindRoot())


In the sheet below I tried to demonstrate how to solve a system of equations using FindRoot() as alternative to Solve(). However, I am not sure how to explain the behaviour to the students. Should we generally avoid assignment with integrated evaluation for the time being?

2018-12-12 00_06_28-SMath Studio - [Kerbformzahl Lochstab Biegung FKM.sm_].png

Kerbformzahl Lochstab Biegung FKM.sm (700 KiB) downloaded 50 time(s).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 users liked this post
sergio 12/12/2018 6:13:00 AM, Radovan Omorjan 12/12/2018 9:02:00 AM
#230 Posted: 12/11/2018 9:27:22 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

Should we generally avoid assignment with integrated evaluation for the time being?



Yes, they should be avoided. There are several known issues while using implicit assignments, I plan to remove them when I'll have the possibility to commit a major update to this plugin.

Moreover now SMath Studio supports multiple assignments by matrices on LHS, therefore it shouldn't be a big loss.

2018-12-12 01_26_35-Window.png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#231 Posted: 12/11/2018 9:41:25 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Wrote

Should we generally avoid assignment with integrated evaluation for the time being?



Yes, they should be avoided. There are several known issues while using implicit assignments, I plan to remove them when I'll have the possibility to commit a major update to this plugin.

Moreover now SMath Studio supports multiple assignments by matrices on LHS, therefore it shouldn't be a big loss.



Perhaps I wasn't clear enough. My example doesn't show any problem with embedded/implicit assignment (at least nothing obvious). What I mean is if you write an assignment with := and in the same region ask for display by = . This one seems to be a problem. Maybe, the two features are related, I don't know.

If you drop integrated/implicit assignment, perhaps would be a good idea to return a set of boolean equations which can be used with at(), just like with Solve(). Then you can easily operate with multiple solutions without having to clear inbetween.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#232 Posted: 2/10/2019 11:22:32 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Be my guest if you want to solve it


A similar problem problem kept the Mathsoft Collaboratory [mostly Jean]
busy for a while, solving for 22 variables. That was possible finally
from Given/Find with infinitely many trial/error constraints.
Given/Find Mathcad 8 Pro solves for 250
Given/Find Mathcad 11 solves for 400 but not of that nature
Given/Find MCD 11 solves for 399 in for loop as the next call
benefits of the previous estimates. That was done solving a DE
of variable coefficients as functions [something like Frobenius]

The Mathsoft 22 variables surely does not exist anymore in my old box
as it was "secret" about what is was. Maybe the Originator said 'thaks'
but not sure as commonly Done-Gone !
Yet, I don't completely understand the problem and its generation.

Cheers Radovan ... Jean


1 users liked this post
Radovan Omorjan 2/12/2019 12:22:00 PM
#233 Posted: 2/10/2019 1:29:08 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Be my guest if you want to solve it



Assuredly not a profitable guest !
I don't understand much in there.

Primer38-doomed.sm (39 KiB) downloaded 52 time(s).
Primer38-doomed_1.sm (44 KiB) downloaded 45 time(s).
1 users liked this post
Radovan Omorjan 2/12/2019 12:22:00 PM
#234 Posted: 2/10/2019 1:45:22 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Wrote

Wrote

Be my guest if you want to solve it



Assuredly not a profitable guest !
I don't understand much in there.

Primer38-doomed.sm (39 KiB) downloaded 52 time(s).
Primer38-doomed_1.sm (44 KiB) downloaded 45 time(s).



Thank you Jeaan for your efforts, but I think we do not understand each other. This is not a fitting problem but finding roots of nonlinear system of equations

38doomed.PNG

The solution was found in Mathcad - this post - and some other software but never in SMath

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#235 Posted: 2/10/2019 5:59:18 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote



Here is the same problem solved in Mathcad

Regards,
Radovan



Hi. Can you show the guess values for x and y? And k before Find too. I get a very different k value. Remember that for numerical procedures, guess values are part of the solution, not of the problem.
Thanks in advance.

Best regards.
Alvaro.
#236 Posted: 2/11/2019 5:43:53 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Wrote

Wrote



Here is the same problem solved in Mathcad

Regards,
Radovan



Hi. Can you show the guess values for x and y? And k before Find too. I get a very different k value. Remember that for numerical procedures, guess values are part of the solution, not of the problem.
Thanks in advance.

Best regards.
Alvaro.



Thank you Alvaro for your interest in these problems. Here is the file once more.

Primer38-doomed1.sm (31 KiB) downloaded 46 time(s).

This is a system of nonlinear algebraic equations. If one takes a look at the calculation here it is obvious that any gradient algorithm for solving this system will fail. Therefore, some non-gradient method might solve this (direct solving or some minimization procedure). There are some functions in the NonlinearSolvers plugin, but unfortunately, there is no update of them for a long time and many of them do not work anymore. All of these years I mentioned that we need here some well tested and robust library incorporated in SMath regarding these problems. There are no other plugins which will address these problems (AFAIK) and I am not sure that will ever be any.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 users liked this post
Alvaro Diaz Falconi 2/11/2019 7:32:00 AM
#237 Posted: 2/11/2019 4:16:54 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

This is a system of nonlinear algebraic equations. If one takes a look at the calculation here it is obvious that any gradient algorithm for solving this system will fail. Therefore, some non-gradient method might solve this (direct solving or some minimization procedure). There are some functions in the NonlinearSolvers plugin, but unfortunately, there is no update of them for a long time and many of them do not work anymore. All of these years I mentioned that we need here some well tested and robust library incorporated in SMath regarding these problems. There are no other plugins which will address these problems (AFAIK) and I am not sure that will ever be any.


1. You seem not happy of the result by plugging [x, y] from the other software.
Did you enter enough decimals ? or that software is short of more ?
2. The Smath FindRoots is not robust in there but it can reproduce results
from your source software with more decimals that you collected.
3. Presumably the software is Matlab ?
4. In short: for a fixed Phi, you are attempting to solve pairwise [x,y]
as you scan over 'z'. Isn't true that any pairwise [x,y] will find a valid
solution or closely ? Stated otherwise: the unique non trivial pair [x,y]
is extremely sensitive to initials. That reminds me the Mathcad rootScanner
that I designed for some extremely sensitive initials. But that one tool
is only for one variable.

Cheers Radovan ... Jean

Primer38-doomed1[Solve paiWise].sm (10 KiB) downloaded 42 time(s).

#238 Posted: 2/11/2019 4:54:05 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Did you enterenough decimals ?


PairWise.PNG
1 users liked this post
Radovan Omorjan 2/12/2019 12:22:00 PM
#239 Posted: 2/11/2019 5:53:56 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello Jean,

The solution is from Mathcad (Given/Find)

With an increased number of decimals.

decimals.PNG

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#240 Posted: 2/11/2019 10:45:36 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Hello Jean,

The solution is from Mathcad (Given/Find)
With an increased number of decimals.


That was my guess, no shame borrowing the hammer as needed.
γRK(T,x):=eval(program) ... > 4 times faster.
Cheers Radovan ... Jean

  • New Posts New Posts
  • No New Posts No New Posts