How to solve it?

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

#101 Опубликовано: 14.07.2018 11:58:28
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I would be interested in doing some tests on this method. Unfortunately, I do not know how to do this.



have you tried this:
1. Close PC
2. Open PC
3. Open Smath ... do nothing
4. Menu bar => Options => Interface => Arguments separator => period, coma, semicolon
5. check OK
6. Close PC.
7. Open PC
8. Open Smath, Code by hand Ber7 Primer or try to open.

Coma.PNG

#102 Опубликовано: 14.07.2018 17:29:16
Nicolae Olaru

Nicolae Olaru

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

Группа: User

Thanks Jean Giraud

It went without restarting the computer. I just restarted SMath after choosing the comma. However, a logical explanation should exist. I'm not saying that the algorithm depends on which separator is used. Will there be any bug or any algorithm problem in this case?!

Thanks Ber7 for the example cascade and for the effort to attach the pdf file as well.

Nicolas
#103 Опубликовано: 14.07.2018 20:54:18
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

It went without restarting the computer. I just restarted SMath after choosing the comma. However, a logical explanation should exist. I'm not saying that the algorithm depends on which separator is used. Will there be any bug or any algorithm problem in this case?!



This algorithm is from public domain, most probably coded for [,]
as this library may use [;] for other coding ... simplist, makes sense.
Thanks Nicolas for confirming the Doctor has saved the patient.

Jean
#104 Опубликовано: 15.07.2018 01:58:41
Nicolae Olaru

Nicolae Olaru

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

Группа: User

Hello.

The doctor saves a patient suffering. It does not matter what the patient says, because the alternative is unfavorable to himself. If the patient makes the effort to confirm, this is primarily a service to science. Thank you Jean Giraud.

Nicolas
#105 Опубликовано: 15.07.2018 07:26:40
Fridel Selitsky

Fridel Selitsky

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

Группа: User

Underdetermined nonlinear system of equations.Three equations with four unknowns.
Visualization of finding the roots

Visual.sm (16 КиБ) скачан 54 раз(а).
#106 Опубликовано: 15.07.2018 13:24:29
Fridel Selitsky

Fridel Selitsky

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

Группа: User

Underdetermined nonlinear system of equations.Five equations with six unknowns.


Underdetermined.sm (52 КиБ) скачан 43 раз(а).
2 пользователям понравился этот пост
Oscar Campo 16.07.2018 07:52:00, Andrey Ivashov 28.07.2018 18:06:00
#107 Опубликовано: 16.07.2018 16:30:32
Nicolae Olaru

Nicolae Olaru

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

Группа: User

Hello

I did some tests. The method is recommended for a system where the number of equations is equal to the number of unknowns. My interest focuses on a method where the number of equations is m, and the number of unknowns is n, with m>n. I'm staying in the study. I'll come back if I find new ideas. Thank you Ber7.

Nicolas
#108 Опубликовано: 17.07.2018 04:52:00
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Hello Nicolas
Wrote

Hello

I did some tests. The method is recommended for a system where the number of equations is equal to the number of unknowns. My interest focuses on a method where the number of equations is m, and the number of unknowns is n, with m>n. I'm staying in the study. I'll come back if I find new ideas. Thank you Ber7.

Nicolas



I hope you would not mind repeating myself. If you need to solve the system of m nonlinear equations in n unknowns (m>n) then you have to use some minimization procedure. This is a simple explanation of least square minimization.

leastsquare.GIF

One could see that if F(x) is quite close to zero, then all the f1(x), f2(x)... are also close to zero. This minimization procedure will also work with m=n, and then you will also have the solution of n equations with n unknowns as well.
I think that al_nleqsolve() can only solve the system where the number of equations is equal to the number of unknowns, which is not what you need.

Regards,
Radovan

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#109 Опубликовано: 17.07.2018 09:33:16
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

My interest focuses on a method where the number of equations is m, and the number of unknowns is n, with m>n


I'm not aware of such methods, but don't deny such inventions.
Let's leave al_nleqsolve on the side for the moment, and revisit the more common
real life where n data points must be fitted via some of so many existing methods.
Like Radovan mentioned, the methods revert to minimizing the SSD [SumSquareDifferences].
At this point, it is essential to learn about the extraordinary property of the Cholesky
solver, not new but so vividely visible in Smath.
It fits directly Lagrange polynomials on minimized SSD.
For more complicated models, in Smath, the refined fit is iterative Conjugate Gradient.

Please, take the time to read the minimalist introduction 7 documents.

Jean

Genfit Rational.sm (55 КиБ) скачан 35 раз(а).
Polynomial fit Methods [linfitCheby].sm (42 КиБ) скачан 41 раз(а).
Genfit Rational Type J_8.sm (57 КиБ) скачан 40 раз(а).
PolyFit QUICK.sm (24 КиБ) скачан 37 раз(а).
Genfit Kirby_2 [Transmute].sm (41 КиБ) скачан 35 раз(а).
Solve al_nleqsolve CSTR.sm (38 КиБ) скачан 46 раз(а).
Polynomial fit Methods [ Rational linfit].sm (62 КиБ) скачан 45 раз(а).

#110 Опубликовано: 17.07.2018 10:39:38
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

My interest focuses on a method where the number of equations is m, and the number of unknowns is n, with m>n



Look closely at this Curvator, not so easy to fit an overall data set.
In fact, the system is 16 equations for 4 data points.
The derivative adjusts the curvature.

Jean

Spline Curvator.sm (27 КиБ) скачан 40 раз(а).

#111 Опубликовано: 17.07.2018 11:12:13
Jean Giraud

Jean Giraud

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

Группа: User

... revisit Cholesky SSD solver.

Cholesky.PNG
#112 Опубликовано: 17.07.2018 20:37:48
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

I think that al_nleqsolve() can only solve the system where the number of equations is equal to the number of unknowns



2018-07-18_04-30-59.png
Russia ☭ forever, Viacheslav N. Mezentsev
#113 Опубликовано: 18.07.2018 00:10:21
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

... revisit Cholesky SSD solver.



This version is an adaptive fit, worth the visit.

Jean

Polynomial fit_Cholesky.sm (47 КиБ) скачан 49 раз(а).
#114 Опубликовано: 21.07.2018 14:22:16
Nicolae Olaru

Nicolae Olaru

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

Группа: User

Hello.

I have insisted on the LM algorithm and I chose three points on each of the different curves represented by the vectors used as data. I wanted to see how far SMath could go by solving a system of nonlinear equations. I have arrived at the system in the image, taking the basis of the first four vectors, namely a1, b1, c1, d1. I have not tried other combinations, for example vectors a1, b1, c1, e1, etc. Under these circumstances, I can say that the results obtained are satisfactory to the good. Based on a 10-point rating system, I would write the result between 7 and 8. What first of all thanks me is that the algorithm could find this solution, starting from a sufficiently remote approximation. With the approximate solution in the picture, the calculation lasted about four and a half minutes. I still do not have the skill to use graphics. I would be glad if someone would recommend examples and tutorials in this regard. For the moment I made the graphical comparisons using the results obtained with SMath in MathCAD. Any equation added to the system in the image leads to errors, including system constraint. I'll continue the tests. Regards.

Nicolas.

Test.PNG

LM1_.sm (13 КиБ) скачан 35 раз(а).
#115 Опубликовано: 22.07.2018 23:26:16
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I would be glad if someone would recommend examples and tutorials in this regard. For the moment I made the graphical comparisons using the results obtained with SMath in MathCAD.



The model function looks out the blue, at least can't be proved valid.
What do you get from Mathcad ?
If you get better sanity check from Mathcad, then Smath LM is under-designed.

LM1_.sm (35 КиБ) скачан 32 раз(а).
#116 Опубликовано: 23.07.2018 04:49:10
Nicolae Olaru

Nicolae Olaru

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

Группа: User

Hello.

I continued the tests and wanted to see how SMath could lead. I have tried to define the function in a recurring way, as in the attached picture. The first observation was (as in the other test) that for more distant values of the Ug parameter the algorithm gives errors. Then, although I was able to solve a system of 18 equations (even 19 in one of the attempts), the increase of the number over 20 is also accompanied by errors. A sign that the solution is close to reality is the value of the variable from the exponent, which is naturally very close to 1.5. I think the convergence criteria should be strengthened for the LM algorithm in SMath. Although I have succeeded in introducing several equations in the calculation, however, the result of the first test was better. This is because the equations in that case have been selected based on the results already known to me in MathCAD.

Wrote

... If you get better sanity check from Mathcad, then Smath LM is under-designed.



I did not mean to say that. But just as for the Levenberg-Marquardt algorithm in SMath, there is still room for improvement.

Wrote


The model function looks out the blue, at least can't be proved valid.



A mathematical program should not only be considered for those with the highest mathematical skills. If you know how many engineers put on the scale just the empirical arguments revealed by the most palpable practice and run away when it comes to math! That's why I consider MathCAD an excellent program for wide categories of professionals. It's easy to drive even for the most inexperienced. I use the method of viewing on the graph rather for checking. I find it easier to compare two graphical curves than two inexpressive vectors. Therefore, being very little experienced in this regard regarding SMath, I preferred a check in MathCAD. Otherwise, all the best.

Nicolas.

Test._.PNG

LM1__.sm (44 КиБ) скачан 32 раз(а).
#117 Опубликовано: 23.07.2018 10:40:35
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I find it easier to compare two graphical curves than two inexpressive vectors.



... then: why not resume the project with some plot ?

ia.PNG
#118 Опубликовано: 23.07.2018 15:38:00
Nicolae Olaru

Nicolae Olaru

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

Группа: User

Hello.

Wrote

... then: why not resume the project with some plot ?...



I just said it. Because I have not yet formed the necessary skills for SMath.

Nicolas.
#119 Опубликовано: 24.07.2018 10:29:58
Fridel Selitsky

Fridel Selitsky

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

Группа: User

ola_nicolas, I just slightly reduced the code of your program.


Nicolas.sm (12 КиБ) скачан 37 раз(а).
#120 Опубликовано: 24.07.2018 13:38:41
Fridel Selitsky

Fridel Selitsky

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

Группа: User

However, AlgLib Solver works faster and depends little on X0 matrix.See # 29
https://en.smath.info/forum/yaf_topics32_Extensions.aspx
Overdetermined.sm (15 КиБ) скачан 51 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений