NonlinearSolvers plugin

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

#221 Pubblicato: 29/10/2016 15:29:16
Radovan Omorjan

Radovan Omorjan

325 apprezzamenti e 1 disapprezzamenti in 2.052 post.

Gruppo: 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 Pubblicato: 16/05/2017 13:20:27
Radovan Omorjan

Radovan Omorjan

325 apprezzamenti e 1 disapprezzamenti in 2.052 post.

Gruppo: 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 Pubblicato: 16/05/2017 15:00:19
Davide Carpi

Davide Carpi

1.443 apprezzamenti in 2.936 post.

Gruppo: 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 utenti hanno apprezzato questo post
Radovan Omorjan 16/05/2017 16:34:00
#224 Pubblicato: 16/05/2017 23:32:46
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: User

Maybe, I don't understand much in there ?

Jean

Page1 Unknown Solve.sm (30,3 KiB) scaricato 1803 volta(e).
#225 Pubblicato: 17/05/2017 10:11:59
Radovan Omorjan

Radovan Omorjan

325 apprezzamenti e 1 disapprezzamenti in 2.052 post.

Gruppo: Moderator

Wrote

Maybe, I don't understand much in there ?

Jean

Page1 Unknown Solve.sm (30,3 KiB) scaricato 1803 volta(e).


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,64 KiB) scaricato 2112 volta(e).

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

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: 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) scaricato 1670 volta(e).
#227 Pubblicato: 13/04/2018 13:13:37
Alexander O. Melnik

Alexander O. Melnik

127 apprezzamenti in 498 post.

Gruppo: 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,63 KiB) scaricato 1730 volta(e).
FidRoot-CustomFormulaSolution.png
What am i doing wrong?

Thanks!
#228 Pubblicato: 13/04/2018 13:36:36
Davide Carpi

Davide Carpi

1.443 apprezzamenti in 2.936 post.

Gruppo: 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 utenti hanno apprezzato questo post
sergio 13/04/2018 16:14:00, Alexander O. Melnik 15/04/2018 12:39:00
#229 Pubblicato: 11/12/2018 20:14:58
Martin Kraska

Martin Kraska

1.361 apprezzamenti in 2.275 post.

Gruppo: 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,43 KiB) scaricato 1706 volta(e).
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
2 utenti hanno apprezzato questo post
sergio 12/12/2018 06:13:00, Radovan Omorjan 12/12/2018 09:02:00
#230 Pubblicato: 11/12/2018 21:27:22
Davide Carpi

Davide Carpi

1.443 apprezzamenti in 2.936 post.

Gruppo: 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 Pubblicato: 11/12/2018 21:41:25
Martin Kraska

Martin Kraska

1.361 apprezzamenti in 2.275 post.

Gruppo: 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.
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#232 Pubblicato: 10/02/2019 11:22:32
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: 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 utenti hanno apprezzato questo post
Radovan Omorjan 12/02/2019 12:22:00
#233 Pubblicato: 10/02/2019 13:29:08
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: 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,31 KiB) scaricato 1619 volta(e).
Primer38-doomed_1.sm (44,63 KiB) scaricato 1556 volta(e).
1 utenti hanno apprezzato questo post
Radovan Omorjan 12/02/2019 12:22:00
#234 Pubblicato: 10/02/2019 13:45:22
Radovan Omorjan

Radovan Omorjan

325 apprezzamenti e 1 disapprezzamenti in 2.052 post.

Gruppo: 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,31 KiB) scaricato 1619 volta(e).
Primer38-doomed_1.sm (44,63 KiB) scaricato 1556 volta(e).



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 Pubblicato: 10/02/2019 17:59:18
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: 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 Pubblicato: 11/02/2019 05:43:53
Radovan Omorjan

Radovan Omorjan

325 apprezzamenti e 1 disapprezzamenti in 2.052 post.

Gruppo: 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,96 KiB) scaricato 1653 volta(e).

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 utenti hanno apprezzato questo post
Alvaro 11/02/2019 07:32:00
#237 Pubblicato: 11/02/2019 16:16:54
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: 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,31 KiB) scaricato 1481 volta(e).

#238 Pubblicato: 11/02/2019 16:54:05
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: User

Wrote

Did you enterenough decimals ?


PairWise.PNG
1 utenti hanno apprezzato questo post
Radovan Omorjan 12/02/2019 12:22:00
#239 Pubblicato: 11/02/2019 17:53:56
Radovan Omorjan

Radovan Omorjan

325 apprezzamenti e 1 disapprezzamenti in 2.052 post.

Gruppo: 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 Pubblicato: 11/02/2019 22:45:36
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: 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

  • Nuovi post
  • Nessun nuovo post