SMath Studio Forum
»
SMath Studio
»
Questions
»
Why I can not plot 1-t and 2-d plot?
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 06/04/2023(UTC) Posts: 338 Was thanked: 26 time(s) in 25 post(s)
|
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
As a temporary solution: linterp-xyplot-using-defined-argument.sm (22kb) downloaded 7 time(s).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. Edited by user 12 December 2023 00:08:32(UTC)
| Reason: Not specified |
Russia ☭ forever Viacheslav N. Mezentsev |
2 users thanked uni for this useful post.
|
on 12/12/2023(UTC), on 13/12/2023(UTC)
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 06/04/2023(UTC) Posts: 338 Was thanked: 26 time(s) in 25 post(s)
|
Благодарствую! And what is it? See the 3-d plot in attach without this bug! linterp.sm (22kb) downloaded 5 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
Это и есть баг в численном алгоритме. К сожалению, требуется основательная переработка алгоритма для выяснения причины такого поведения. Я не силён в кубических сплайнах, в их реализации. Эта проблема также ведёт к неправильной интерполяции в решателях ОДУ, которые кроме табличного решения предлагают и интерполированные функции. Там используется интерполятор из Mathcad Toolbox. После реализации этих функций я делал только примитивные тесты и ошибка не была вовремя обнаружена. |
Russia ☭ forever Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 06/04/2023(UTC) Posts: 338 Was thanked: 26 time(s) in 25 post(s)
|
Originally Posted by: uni Это и есть баг в численном алгоритме. К сожалению, требуется основательная переработка алгоритма для выяснения причины такого поведения. Я не силён в кубических сплайнах, в их реализации. Эта проблема также ведёт к неправильной интерполяции в решателях ОДУ, которые кроме табличного решения предлагают и интерполированные функции. Там используется интерполятор из Mathcad Toolbox. После реализации этих функций я делал только примитивные тесты и ошибка не была вовремя обнаружена. Это не просто баг. Это, как говаривал ваш катькин Ельцин, какая-то загогулина!
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,986 Was thanked: 1124 time(s) in 721 post(s)
|
Originally Posted by: uni Это и есть баг в численном алгоритме. К сожалению, требуется основательная переработка алгоритма для выяснения причины такого поведения. Я не силён в кубических сплайнах, в их реализации. Эта проблема также ведёт к неправильной интерполяции в решателях ОДУ, которые кроме табличного решения предлагают и интерполированные функции. Там используется интерполятор из 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() |
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: mkraska 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.
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
Originally Posted by: Jean Giraud The lspline(X,Y) produces the wrong vector Jean Giraud produces useless messages. |
Russia ☭ forever Viacheslav N. Mezentsev |
2 users thanked uni for this useful post.
|
on 13/12/2023(UTC), on 13/12/2023(UTC)
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
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 (24kb) downloaded 8 time(s).Best regards. Alvaro. Edited by user 13 December 2023 18:52:05(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 06/04/2023(UTC) Posts: 338 Was thanked: 26 time(s) in 25 post(s)
|
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
Originally Posted by: Razonar 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 (257kb) downloaded 39 time(s). |
Russia ☭ forever Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Hi Viacheslav. Originally Posted by: uni 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. Thus, Mathcad lspline is not related with SMath linterp or maple spline(X,Y,x,linear) Originally Posted by: uni 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.
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 06/04/2023(UTC) Posts: 338 Was thanked: 26 time(s) in 25 post(s)
|
|
1 user thanked OchkovVF for this useful post.
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: Razonar 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.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: uni 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.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/07/2013(UTC) Posts: 1,128 Was thanked: 509 time(s) in 339 post(s)
|
Originally Posted by: uni 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.
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Why I can not plot 1-t and 2-d plot?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.