Differentiation of splines - An example - Сообщения
Here is another example I wanted to solve for a long time in SMath. Actually, you can not have a real numerical derivatives in SMath and I also mentioned that few times. If the expression is a bit more complex, there is quite a chance of getting into trouble with derivatives. Moreover, you can not find numerical derivatives of a spline function in SMath. Here is an example where I used Gradient.CD() from the BETANonlinearSolvers (see this thread - this plugin includes many other "derivative free" numerical procedures). I do not know any other more elegant way to solve these kind of problems in SMath. Although it was mentioned here BETANonlinearSolvers among many other things, I just put this example here because I wanted to get it into attention once more.
Regards,
Radovan
interpdiff.sm (12 КиБ) скачан 107 раз(а).
I'm trying to work with your file but the solve function gives me a "index out of matrix bounds" error, you know what would be the problem?
Regards,
Oscar
WroteThanks Omorr, really it's an elegant form.
I'm trying to work with your file but the solve function gives me a "index out of matrix bounds" error, you know what would be the problem?
I do not know, sorry. It works for me. Actually, my point was that the differentiation in SMath is problematic - actually there is no pure numerical differentiation at all (there is a numerical integration procedure but SMath's symbolic engine does not have symbolical integration yet). If you want to solve a nonlinear equation, just use the mentioned plugin (SMath's solve() and roots() might give us a hedeack sometimes

Regards,
Radovan
My problem is due to optimization type. For me, your file only works with "optimization none" except for Brent method, which doesn't works with none optimization method.
WroteOk, Omorr,
My problem is due to optimization type. For me, your file only works with "optimization none" except for Brent method, which doesn't works with none optimization method.
Sorry, I do not know what is the reason of this behavior

Regards,
radovan
WroteOk, Omorr,
My problem is due to optimization type. For me, your file only works with "optimization none" except for Brent method, which doesn't works with none optimization method.
Did you installed customFunctions plugin ? it is required for the beta version.
You may want to try the mono version until Davide and Andrey publish the stable versions, I guess your problems might be related to having several installations.
WroteDid you installed customFunctions plugin ? it is required for the beta version.
You may want to try the mono version until Davide and Andrey publish the stable versions, I guess your problems might be related to having several installations.
Yes, I have this plugin installed and also the another ones are updated. I don't know way this issue happens
Here is another example I wanted to solve for a long time in SMath. Actually, you can not have a real numerical derivatives in SMath and I also mentioned that few times. If the expression is a bit more complex, there is quite a chance of getting into trouble with derivatives. Moreover, you can not find numerical derivatives of a spline function in SMath. Here is an example where I used Gradient.CD() from the BETANonlinearSolvers (see this thread - this plugin includes many other "derivative free" numerical procedures). I do not know any other more elegant way to solve these kind of problems in SMath. Although it was mentioned here BETANonlinearSolvers among many other things, I just put this example here because I wanted to get it into attention once more.
Regards,
Radovan
____________________________________________________
Hello Radovan,
linterp, cinterp, aiterp are strictly interpolating functions in Smath.
Most evidently from old codes from times numerical methods didn't exist.
It is on my RemToDo from Mathcad. It might be possible to convert.
If successful, cubic splines will be true scalar functions.
On the other end, linterp as a function is just useless for derivatives
because linterp as a function is not analytical up to 2nd order derivatives.
To the contrary, scalar cubic spline is analytical.
In fact, cubic spline has little interst unless you have clean data set from
functions. But that is sratching the left ear with the right hand.
Again, sampled data sets are naturally noisy from the quantizing numerical
capture as well as from the nature of the experiment. That means that for
derivative, you must smooth in some way, otherwise green grass wlii grow in
your work sheet.
To the contrary of the derivative monkey business, integration of noisy
sampled data sets come out of clicking fingers with extraordinary perfection.
A while ago, I posted the finite differences derivatives & integration.
Cheers Collab, nice to read you.
Jean
Thank you for your comment, and I hope I understood your point.
I agree with you that if you have a noisy cloud of data, the things are going to be problematic in SMath. As you said "scratching the left ear with the right hand"

As far as I know, there is no smoothing functions present yet.
Regards,
Radovan
basic cubic spline are NOT differentiable.
In there, if the data points would be "exact"
error in the fit is acceptable for practical use.
Jean
Polynomial fit_D[x].sm (17 КиБ) скачан 76 раз(а).
I got deceived by "ainterp", it does a por job on few points, Ah !
It may have unxplored utilities.
BTW: The XY plot is not the gear to plot: linterp, ainterp, cinterp
The XY plot is strictly limited to plot "true function(s)".
Basically, it plot some default number [maybe 99]of linear segments
It has an unknown spline joint [OriginLab style], thus it plots
crappy stuff. From recollection, Excel joints Bézier ?
More spline is RemToDo [sometimes].
Cheers Collab(s), Jean
Utilities XY plot.sm (16 КиБ) скачан 63 раз(а).
-
Новые сообщения
-
Нет новых сообщений