Why I can not plot 1-t and 2-d plot?

Why I can not plot 1-t and 2-d plot? - I have 3-d plot! - Messaggi

#1 Pubblicato: 11/12/2023 17:25:07
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

linterp.sm (21,54 KiB) scaricato 1471 volta(e).
#2 Pubblicato: 11/12/2023 18:01:43
Вячеслав Мезенцев

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

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

As a temporary solution:

Click to enlarge

linterp-xyplot-using-defined-argument.sm (21,7 KiB) scaricato 1548 volta(e).

interp(), ... functions from Mathcad Toolbox still have a bug. The implementation used does incorrect interpolation on some intervals. I don't know how to fix this yet, because the algorithm was restored according to the article and perhaps it was done incorrectly.
Russia ☭ forever, Viacheslav N. Mezentsev
2 utenti hanno apprezzato questo post
Valery Ochkov 11/12/2023 23:17:00, Alvaro 13/12/2023 00:10:00
#3 Pubblicato: 11/12/2023 18:49:37
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Благодарствую!
And what is it?
Spline-Bug.png
See the 3-d plot in attach without this bug!linterp.sm (21,44 KiB) scaricato 1512 volta(e).

#4 Pubblicato: 11/12/2023 19:25:45
Вячеслав Мезенцев

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

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Это и есть баг в численном алгоритме. К сожалению, требуется основательная переработка алгоритма для выяснения причины такого поведения. Я не силён в кубических сплайнах, в их реализации.
Эта проблема также ведёт к неправильной интерполяции в решателях ОДУ, которые кроме табличного решения предлагают и интерполированные функции. Там используется интерполятор из Mathcad Toolbox.
После реализации этих функций я делал только примитивные тесты и ошибка не была вовремя обнаружена.
Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
Valery Ochkov 11/12/2023 23:17:00
#5 Pubblicato: 11/12/2023 21:53:52
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Wrote

Это и есть баг в численном алгоритме. К сожалению, требуется основательная переработка алгоритма для выяснения причины такого поведения. Я не силён в кубических сплайнах, в их реализации.
Эта проблема также ведёт к неправильной интерполяции в решателях ОДУ, которые кроме табличного решения предлагают и интерполированные функции. Там используется интерполятор из Mathcad Toolbox.
После реализации этих функций я делал только примитивные тесты и ошибка не была вовремя обнаружена.


Это не просто баг. Это, как говаривал ваш катькин Ельцин, какая-то загогулина!


#6 Pubblicato: 11/12/2023 23:30:38
Martin Kraska

Martin Kraska

1.361 apprezzamenti in 2.275 post.

Gruppo: Moderator

Wrote

Это и есть баг в численном алгоритме. К сожалению, требуется основательная переработка алгоритма для выяснения причины такого поведения. Я не силён в кубических сплайнах, в их реализации.
Эта проблема также ведёт к неправильной интерполяции в решателях ОДУ, которые кроме табличного решения предлагают и интерполированные функции. Там используется интерполятор из Mathcad Toolbox.
После реализации этих функций я делал только примитивные тесты и ошибка не была вовремя обнаружена.



Is that bug only related to non-equidistant points? In that case, the functions would still be good enough for the ode solvers, at least for rkfixed()
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#7 Pubblicato: 12/12/2023 19:56:30
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: User

Wrote

Is that bug only related to non-equidistant points ?


The lspline(X,Y) produces the wrong vector
k ... [0 3 0 0 0.6629 ...suite OK]
k ... [0 0.6629 ...suite OK]
Put the right vector in interp(k,X,Y,x) fails.
Simply a bug ... reflexive double bug.
My Smath Solver 30405 document is fine,
Interpolate, 1rst Derivative, 2nd Derivative, Integrate.
Jean.

#8 Pubblicato: 12/12/2023 21:02:48
Вячеслав Мезенцев

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

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Wrote

The lspline(X,Y) produces the wrong vector


Jean Giraud produces useless messages.

Click to enlarge
Russia ☭ forever, Viacheslav N. Mezentsev
2 utenti hanno apprezzato questo post
Alvaro 13/12/2023 00:08:00, overlord 12/12/2023 22:40:00
#9 Pubblicato: 13/12/2023 12:42:54
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Hi Viacheslav. It seems that the Mathcad lspline actually it is a cubic spline. That as conclusion comparing lspline with the maple spline function. Thus, it has the Martin's restriction: x values must to be equally spaced (but that is not required for maple algorithms). Actually, that's looks like the best option for working with ODE's, especially for boundary conditions about the derivative of the spline function.

Maple spline function.sm (23,01 KiB) scaricato 1499 volta(e).

Best regards.
Alvaro.
#10 Pubblicato: 13/12/2023 13:21:26
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Spline.png

#11 Pubblicato: 13/12/2023 13:23:24
Вячеслав Мезенцев

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

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Wrote

It seems that the Mathcad lspline actually it is a cubic spline.



I will remind you of this document, which describes how the functions work. My implementation of interpolation has an error, but the coefficients themselves seem to be calculated correctly.
In Mathcad the first three numbers encode the type of spline. Jean doesn't know about this.

Cubic spline interpolation using Mathcad (2009).pdf (256,71 KiB) scaricato 2764 volta(e).
Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
Alvaro 13/12/2023 14:59:00
#12 Pubblicato: 13/12/2023 14:58:24
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Hi Viacheslav.

Wrote

Wrote

It seems that the Mathcad lspline actually it is a cubic spline.



I will remind you of this document, which describes how the functions work.

Cubic spline interpolation using Mathcad (2009).pdf (256,71 KiB) scaricato 2764 volta(e).



Yes, my comment is about that the lspline and pspline names could be sort of confusing, because, as the report says, mathcad's lspline, pspline and cspline are all "cubic splines". The "l" in "lspline" is not for linear interpolation, but for linear ends conditions, also called natural conditions. The "p" is for parabolic, and the "c" for cubic, all meaning ends conditions too.

natural.png

lspline.png

Thus, Mathcad lspline is not related with SMath linterp or maple spline(X,Y,x,linear)

Wrote

In Mathcad the first three numbers encode the type of spline. Jean doesn't know about this.



As usual. Yes, I know. You can also find here an adaptive spline interpolation using that encoding.

Best regards.
Alvaro.
#13 Pubblicato: 13/12/2023 15:08:28
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

branch.png
1 utenti hanno apprezzato questo post
Oscar Campo 14/12/2023 23:28:00
#14 Pubblicato: 13/12/2023 22:13:05
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: User

Wrote

Yes, my comment is about that the lspline and pspline names could be sort of confusing, because, as the report says, mathcad's lspline, pspline and cspline are all "cubic splines". The "l" in "lspline" is not for linear interpolation, but for linear ends conditions, also called natural conditions. The "p" is for parabolic, and the "c" for cubic, all meaning ends conditions too.


Well tutored Alvaro.
Easy to explore more from late Samples.
l & p have most remarkable effect in the start region.
Under the hood, l_spline is the interpolator ODEsolve.

#15 Pubblicato: 14/12/2023 06:34:41
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: User

Wrote

My implementation of interpolation has an error,


Use the Smath code ... visit late Samples.
As an independent Smath document, can be traced
to doctor your original error.
Simply implement the Mathsoft interpolation code.



#16 Pubblicato: 14/12/2023 08:44:53
overlord

overlord

600 apprezzamenti in 1.381 post.

Gruppo: Moderator

Wrote

In Mathcad the first three numbers encode the type of spline. Jean doesn't know about this


I myself don't know a lot of things.
Yet I don't post useless messages just to reply.
I guess most people don't, except Jean.
More unacceptable part is, sometimes he posts false information.
Especially on engineering questions/samples.
And insist on that wrong claims like his life depends on it.
I am afraid he will cause something catastrophic in real life.
  • Nuovi post
  • Nessun nuovo post