Why I have an error?

Why I have an error? - Сообщения

#1 Опубликовано: 29.01.2024 16:41:35
Valery Ochkov

Valery Ochkov

55 сообщений из 633 понравились пользователям.

Группа: 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 КиБ) скачан 70 раз(а).
#2 Опубликовано: 29.01.2024 17:31:21
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: 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 Опубликовано: 29.01.2024 23:12:24
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Vectorize works fine in this document.

Three-Planets.sm (41 КиБ) скачан 64 раз(а).
#4 Опубликовано: 30.01.2024 00:28:13
Valery Ochkov

Valery Ochkov

55 сообщений из 633 понравились пользователям.

Группа: User

Wrote

Vectorize works fine in this document.

Three-Planets.sm (41 КиБ) скачан 64 раз(а).



Sorry - no. See please the attach
Three-Planets.sm (39 КиБ) скачан 79 раз(а).
#5 Опубликовано: 30.01.2024 21:47:53
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Sorry - no. See please the attach


As I open your returned document,
both vectorize are red ... click on either one ... Bingo
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений