Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello, 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 Edited by user 08 May 2013 15:07:07(UTC)
| Reason: Not specified File Attachment(s): omorr attached the following image(s): |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
1 user thanked omorr for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 10/12/2009(UTC) Posts: 249 Location: Cali, Colombia Was thanked: 87 time(s) in 66 post(s)
|
Thanks 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?
Regards,
Oscar
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello Oscar, Originally Posted by: oscampo Thanks 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 ). There are many functions for this problem. Here is the previous example with the functions for the nonlinear equation solving from the mentioned plugin. Regards, Radovan Edited by user 08 May 2013 19:06:25(UTC)
| Reason: Not specified File Attachment(s): omorr attached the following image(s): |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 10/12/2009(UTC) Posts: 249 Location: Cali, Colombia Was thanked: 87 time(s) in 66 post(s)
|
Ok, 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.
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Originally Posted by: oscampo Ok, 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 |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 30/03/2011(UTC) Posts: 393
Was thanked: 132 time(s) in 113 post(s)
|
Originally Posted by: oscampo Ok, 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.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 10/12/2009(UTC) Posts: 249 Location: Cali, Colombia Was thanked: 87 time(s) in 66 post(s)
|
Originally Posted by: kilele 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. Yes, I have this plugin installed and also the another ones are updated. I don't know way this issue happens
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Hello,
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
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello 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 in SMath yet. I know that integration and differentiation of noisy data are quiet standard procedures, but if you like to do that in SMath - you have to think twice. As far as I know, there is no smoothing functions present yet. Regards, Radovan |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
No matter how much maths you will attempt, 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
|
2 users thanked Jean Giraud for this useful post.
|
on 17/09/2015(UTC), on 17/09/2015(UTC)
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Hello Radovan, 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
|
1 user thanked Jean Giraud 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)
|
Differentiation of splines is all done in the thread "Cubic Splines Read More"
|
|
|
|
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.