Why I have an error?

Why I have an error? - Messages

#1 Posted: 1/29/2024 4:41:35 PM
Valery Ochkov

Valery Ochkov

55 likes in 633 posts.

Group: User

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).
#2 Posted: 1/29/2024 5:31:21 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

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
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
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Vectorize works fine in this document.

Three-Planets.sm (41 KiB) downloaded 60 time(s).
#4 Posted: 1/30/2024 12:28:13 AM
Valery Ochkov

Valery Ochkov

55 likes in 633 posts.

Group: User

Wrote

Vectorize 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
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Sorry - no. See please the attach


As I open your returned document,
both vectorize are red ... click on either one ... Bingo
  • New Posts New Posts
  • No New Posts No New Posts