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! - Mensajes

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

Valery Ochkov

67 me gusta en 713 mensajes.

Grupo: User

linterp.sm (21,54 KiB) descargado 1468 vez(es).
#2 Publicado: 11/12/2023 18:01:43
Вячеслав Мезенцев

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

1.558 me gusta en 1.868 mensajes.

Grupo: Moderator

As a temporary solution:

Click to enlarge

linterp-xyplot-using-defined-argument.sm (21,7 KiB) descargado 1544 vez(es).

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
A 2 usuarios les gustó este mensaje
Valery Ochkov 11/12/2023 23:17:00, Alvaro 13/12/2023 0:10:00
#3 Publicado: 11/12/2023 18:49:37
Valery Ochkov

Valery Ochkov

67 me gusta en 713 mensajes.

Grupo: User

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

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

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

1.558 me gusta en 1.868 mensajes.

Grupo: Moderator

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

Valery Ochkov

67 me gusta en 713 mensajes.

Grupo: User

Wrote

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


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


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

Martin Kraska

1.361 me gusta en 2.275 mensajes.

Grupo: 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 Publicado: 12/12/2023 19:56:30
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: 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 Publicado: 12/12/2023 21:02:48
Вячеслав Мезенцев

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

1.558 me gusta en 1.868 mensajes.

Grupo: Moderator

Wrote

The lspline(X,Y) produces the wrong vector


Jean Giraud produces useless messages.

Click to enlarge
Russia ☭ forever, Viacheslav N. Mezentsev
A 2 usuarios les gustó este mensaje
Alvaro 13/12/2023 0:08:00, overlord 12/12/2023 22:40:00
#9 Publicado: 13/12/2023 12:42:54
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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) descargado 1497 vez(es).

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

Valery Ochkov

67 me gusta en 713 mensajes.

Grupo: User

Spline.png

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

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

1.558 me gusta en 1.868 mensajes.

Grupo: 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) descargado 2757 vez(es).
Russia ☭ forever, Viacheslav N. Mezentsev
A 1 usuarios les gustó este mensaje
Alvaro 13/12/2023 14:59:00
#12 Publicado: 13/12/2023 14:58:24
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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) descargado 2757 vez(es).



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 Publicado: 13/12/2023 15:08:28
Valery Ochkov

Valery Ochkov

67 me gusta en 713 mensajes.

Grupo: User

branch.png
A 1 usuarios les gustó este mensaje
Oscar Campo 14/12/2023 23:28:00
#14 Publicado: 13/12/2023 22:13:05
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: 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 Publicado: 14/12/2023 6:34:41
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: 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 Publicado: 14/12/2023 8:44:53
overlord

overlord

600 me gusta en 1.381 mensajes.

Grupo: 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.
  • Nuevos mensajes
  • Sin mensajes nuevos