How to solve it?

How to solve it? - Сообщения

#61 Опубликовано: 06.07.2018 08:35:30
Nicolae Olaru

Nicolae Olaru

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

Группа: User

Hello.

I think it would not be bad for Davide to verify my algorithm (it does not correspond in any case to the syntactic precepts used in SMath) to append it and add it to its other models, from where I saw the Levenberg-Marquardt method missing . I will not have claims. What Martin has suggested to me is useless in this case. In the file below I tried to apply LevenbergMarquardt(3) to the simple example of 3 unknown 3 equations that appears in the picture in message # 54. An error occurred.

Nicolas
Untitled.sm (5 КиБ) скачан 36 раз(а).
#62 Опубликовано: 06.07.2018 10:02:17
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

You can try Maple region from MapleWrapper plugin (updated).

2018-07-06_18-03-00.png
2018-07-06_18-00-22.png


with(stats):
ans:=op(2,fit[leastsquare[[x,y],y=a*x^2+b*x+c]]([[10,15,17,19],[3,4,5,6]])):
Russia ☭ forever, Viacheslav N. Mezentsev
2 пользователям понравился этот пост
Radovan Omorjan 06.07.2018 12:39:00, frapuano 06.07.2018 15:23:00
#63 Опубликовано: 06.07.2018 11:43:20
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Hello.

I think it would not be bad for Davide to verify my algorithm (it does not correspond in any case to the syntactic precepts used in SMath) to append it and add it to its other models, from where I saw the Levenberg-Marquardt method missing . I will not have claims.What Martin has suggested to me is useless in this case. In the file below I tried to apply LevenbergMarquardt(3) to the simple example of 3 unknown 3 equations that appears in the picture in message # 54. An error occurred.

Nicolas



Your About LM algorithm is not ready for publishing.
seemingly you got result in 6671, but fails 6179.
norme(,) looks strange 6671 ... and unknown
norme(,) 6179 is by the bible books.

This example gives 9 decimals in native Smath.

Solve GivenFind MCD Example.sm (21 КиБ) скачан 40 раз(а).

Levenberg-Marquardt [Nicolas].sm (38 КиБ) скачан 41 раз(а).

#64 Опубликовано: 06.07.2018 17:20:23
Martin Kraska

Martin Kraska

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

Группа: Moderator

In the given case LM works with symbolic optimization, but not with numeric. Also, z=0 does not work as initial value.

lm.png
lm.sm (5 КиБ) скачан 40 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#65 Опубликовано: 06.07.2018 20:03:21
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

In the given case LM works with symbolic optimization, but not with numeric. Also, z=0 does not work as initial value.



Thanks Martin,

Will surely be useful in real applications.
Beats Mathcad in simplicity !

Jean
#66 Опубликовано: 07.07.2018 03:37:06
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Wrote

In the given case LM works with symbolic optimization, but not with numeric. Also, z=0 does not work as initial value.

lm.png
lm.sm (5 КиБ) скачан 40 раз(а).



The same problem could be solved with many other functions in NonlinearSolvers plugin including the intended FindRoot() as the principal one. Unfortunately, it seems that strictly numerical problems are still problematic and questionable.

Regards,
Radovan

lmext.sm (16 КиБ) скачан 43 раз(а).
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#67 Опубликовано: 07.07.2018 10:34:26
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

The same problem could be solved with many other functions in NonlinearSolvers plugin including the intended FindRoot() as the principal one. Unfortunately, it seems that strictly numerical problems are still problematic and questionable.

Regards,
Radovan



Of all those plugin solvers, they all work ± equivalent.
In this examples , FindRoot(,,,) = Mathcad.
But only Broyden solves for both sets of solutions
Yes, there are two sets of solutions because of z^2
Thanks Radovan.

Broyden.PNG

Solve GivenFind Broyden.sm (23 КиБ) скачан 35 раз(а).

#68 Опубликовано: 07.07.2018 13:00:17
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Sorry Jean, that was not my point. I thought on something like this one.

nlinsys.PNG

SMath can not solve strictly numerically this and similar problems. I wish I was wrong, but I mentioned this quite a lot of times. I am not sure if I was not understood or simply SMath can not cope with this.

Regards,
Radovan

EDIT: Actually, Davide mentioned this in this post
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#69 Опубликовано: 07.07.2018 13:41:40
Nicolae Olaru

Nicolae Olaru

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

Группа: User

Hello.

From the point of view of symbolic, versus numeric optimization, something should be done to automate such a choice. From the point of view of the algorithms, I am very little experienced. If the algorithm proposed by me can be processed, including with the help of the skilled ones, then fine. My point of view is that SMath is still a non-livelier ground in terms of resolving non-linear systems containing more than two equations. Practically my skill is to effectively use such algorithms and not to produce them. I just launched a challenge and I would be happy if something new in SMath emerged.

Nicolas
1 пользователям понравился этот пост
Fridel Selitsky 07.07.2018 15:51:00
#70 Опубликовано: 07.07.2018 15:37:15
Nicolae Olaru

Nicolae Olaru

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

Группа: User

Wrote

In the given case LM works with symbolic optimization, but not with numeric. Also, z=0 does not work as initial value. ...


I do not even achieve symbolic optimization.

LM_.PNG
#71 Опубликовано: 07.07.2018 18:26:30
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I do not even achieve symbolic optimization.



Try FindRoot NUMERIC. It solves for 3 sets of initials.

FindRoot3sets.PNG
#72 Опубликовано: 08.07.2018 05:29:33
Nicolae Olaru

Nicolae Olaru

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

Группа: User

Bonjour Jean Giraud

I think it was a mere chance that the FindRoot algorithm solved that system. Try the system in the first picture. You will get the error "Cannot solve. Try using a more specific algorithm". Actually, that's what it is all about. Taking into account all the existing plugins, you need to test a wide variety of possible "more specific" algorithms. But by putting six equations of my system in the form of the image, I finally managed to get a first result using the LevenbergMarquardt algorithm (3) - even if I had to wait almost a minute and 37 seconds. It is illustrated in the second image. What did I actually do? I actually chose three disparate points on the first curve (one with a special shape) and three more on the second curve and formed a system of 6 equations. I have managed to solve it, as shown in the second picture, but the solution is far from the (very precise) found by MathCAD. As soon as I have attached another equation (the seventh) that actually represents a constraint on the system, I have not gotten anything, as shown in the third image. In this sense, it is also necessary to work in SMath. First of all you need to find more efficient algorithms for constrained systems. Then you must necessarily find a way for the program to automatically choose between all possible algorithms, only the applicable one. Let's look at things in the following way. The FindRoot algorithm in SMath could be the GivenFind algorithm in MathCAD. This must actually be a special algorithm to choose the applicable method. Among the applicable methods algorithms with constraints should also be included. Only in this way the work of a researcher using SMath as a tool can be effective. It must be borne in mind that the researcher is not necessarily an excellent mathematician of analysis, but perhaps only one of the occasions, who only attempts to obtain the results that interest him in a particular process. Otherwise, all my respect for everyone, and all the best.

Nicolas.

X1.PNG

X2.PNG

X3.PNG
#73 Опубликовано: 08.07.2018 10:20:19
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I have managed to solve it, as shown in the second picture, but the solution is far from the (very precise) found by MathCAD.



1. What is Levenberg-Marquardt ?
An invented gadget solver for some of the casual case of their researchers.
2. Please attach the Smath for the 2nd 6 var example.
3. Mathcd 11 GivenFind solves for 299 simple demand [finite differences DE]
4. The most exhaustive algebraic case MCD 11 solved 22 ... it toke weeks
It had to be associated with lot of < ...> . Straight equalities aren't
solvable by simple algebra.
5. Your base model is not algebraic, thus you can expect infinitely many sols.
That is so true that your LM apparent solution is just one of infinitely many.
6. FindRoot solves your 1rst example.

In your examples, there is the common pitfall ... Explain:
You can't have more accuracy than the given, in this case example [1]
FindRoot epsilon 0.00001. The LM 10^-15 has no meaning at all
Two different results that do sanity identical.
What is the accuracy of pi*0.123 ? Answer => 3 decimals
What is the accuracy of pi *(123/1000) ? Answer => as many decimals as pi

Cheers Nicolas ... Jean

Page1 Nicolas.sm (19 КиБ) скачан 38 раз(а).


1 пользователям понравился этот пост
sergio 08.07.2018 12:43:00
#74 Опубликовано: 08.07.2018 13:27:12
Jean Giraud

Jean Giraud

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

Группа: User

... here is your 2nd example.
Two solvers => two sets of solutions among infinitely many possible
from not available infinitely many not yet invented solvers.
What is ! true ! in your proposal ? two sets of experimental values
The model you fabricate may be correct, but not enough experimental data.
If projects are secret or not allowed to be public, public forum
is not the place to expect productive help.

page2Nicolas.PNG

Page2 Nicolas.sm (41 КиБ) скачан 28 раз(а).
#75 Опубликовано: 08.07.2018 15:46:17
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Another solver from Alglib. I just copied from this post.

al_nleqaolve-corr.PNG

al_nleqsolve-corr.sm (19 КиБ) скачан 41 раз(а).

This is a gradient algorithm. You need Jacobian, unfortunately, which might be quite complicated sometimes and often can give us headaches.

Regards,
Radovan

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#76 Опубликовано: 08.07.2018 17:03:51
Nicolae Olaru

Nicolae Olaru

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

Группа: User

Hello.

You do not have to mind Jean Giraud. In the last two posts you made me understand a lot of things. In fact, that's what I wanted from this topic. Thank you very much. Thank you all.

Nicolas.
#77 Опубликовано: 08.07.2018 19:48:19
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Another solver from Alglib. I just copied from this post.



Thanks Radovan, interesting.
Levenberg-Marquardt is one solver, that fails this example.
You can only conclude you have solved if there is a way to
sanity out of doubt. In short, solving is more than some numbers

Jean

Solve Given_Find [CO2_6179].sm (38 КиБ) скачан 39 раз(а).
#78 Опубликовано: 09.07.2018 05:07:45
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

You are welcome Jean,

We should not forget roots() which was one of the first functions in SMath of its kind.

roots.GIF

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#79 Опубликовано: 09.07.2018 10:01:59
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

You are welcome Jean,

We should not forget roots() which was one of the first functions in SMath of its kind.



Thanks Radovan,

... refreshed/updated both versions.

Solve Given_Find [CO2_6179].sm (36 КиБ) скачан 36 раз(а).
#80 Опубликовано: 09.07.2018 16:22:53
Fridel Selitsky

Fridel Selitsky

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

Группа: User

Determination of the coordinates of the links of spatial
mechanisms by the Alglib solver


PrimerAlgib.sm (63 КиБ) скачан 49 раз(а).
3 пользователям понравился этот пост
NDTM Amarasekera 09.07.2018 22:26:00, Radovan Omorjan 09.07.2018 17:04:00, frapuano 10.07.2018 12:39:00
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений