Why I have an error?

Why I have an error? - 消息

#1 已发布: 2024/1/29 16:41:35
Valery Ochkov

Valery Ochkov

67个赞,共716个帖子。

组: 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.29 KiB)已下载 1762 次。
#2 已发布: 2024/1/29 17:31:21
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: 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
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#3 已发布: 2024/1/29 23:12:24
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Vectorize works fine in this document.

Three-Planets.sm (41.7 KiB)已下载 1709 次。
#4 已发布: 2024/1/30 00:28:13
Valery Ochkov

Valery Ochkov

67个赞,共716个帖子。

组: User

Wrote

Vectorize works fine in this document.

Three-Planets.sm (41.7 KiB)已下载 1709 次。



Sorry - no. See please the attach
Three-Planets.sm (39.1 KiB)已下载 1764 次。
#5 已发布: 2024/1/30 21:47:53
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

Sorry - no. See please the attach


As I open your returned document,
both vectorize are red ... click on either one ... Bingo
  • 有新帖
  • 无新帖