1 Pages (5 items)
Why I have an error? - Messages
#1 Posted: 1/29/2024 4:41:35 PM
When x1(t)=sin(t) - no problem.
When x1(t) is my function - an error!
See please the attach.
Three-Planets (Mathcad Block).sm (38 KiB) downloaded 61 time(s).
When x1(t) is my function - an error!
See please the attach.
Three-Planets (Mathcad Block).sm (38 KiB) downloaded 61 time(s).
#2 Posted: 1/29/2024 5:31:21 PM
This is because the solution functions are defined using interpolation. The interpolation functions have the X and Y vectors and the value of x as arguments. You try to provide a vector for x. Vectorize can handle only matrix arguments of the same size and successively calls the function with the j-th element of each vector.
So vectorize would require your x vector to be of the same size as the data vectors. Even in this case this probably will fail because the data would be reduced to a single X_i and Y_i.
Therefore, you have to use a loop.
![2024-01-29 10_30_32-SMath Solver - [Three-Planets (Mathcad Block).sm_].png](/en-US/file/xaHeCk/2024-01-29-10_30_32-SMath-Solver---_Three-Planets-_Mathcad-Block__sm___png)
So vectorize would require your x vector to be of the same size as the data vectors. Even in this case this probably will fail because the data would be reduced to a single X_i and Y_i.
Therefore, you have to use a loop.
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Posted: 1/29/2024 11:12:24 PM
#4 Posted: 1/30/2024 12:28:13 AM
WroteVectorize works fine in this document.
Three-Planets.sm (41 KiB) downloaded 60 time(s).
Sorry - no. See please the attach
Three-Planets.sm (39 KiB) downloaded 70 time(s).
#5 Posted: 1/30/2024 9:47:53 PM
WroteSorry - no. See please the attach
As I open your returned document,
both vectorize are red ... click on either one ... Bingo
1 Pages (5 items)
-
New Posts
-
No New Posts