Vectorization of expressions containing dot products

Vectorization of expressions containing dot products - 消息

#1 已发布: 2023/8/16 15:49:01
Martin Kraska

Martin Kraska

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

组: Moderator

This topic is an offspring of this topic on equation solving.

The problem is that the cross product in SMath can't handle operators which aren't vectors but for instance a product of a symbolic name and a normalized vector.

The initial proposal: Mark the symbolic names as units (these are always applied stored as part of the elements, never as a common factor)

This, however, excluded solvers like FindRoot() and roots().

Alvaro demonstrated a way to handle the issue without using Maxima and without marking the unknowns as units. (row 2 column 2 in the attached grid of tests)

Yet, even though this is a remarkable example SMath command, I am reluctant to recommend that approach to my students.
The issue is that this approach requires the vectorize() function combined with very special conditions:
- a very special way to normalize vectors
- at a certain step the expression must be stored in a variable.
If one of these conditions isn't met, then applying vectorize() silently produces wrong results.

On the other hand, when accepting unit-like unknowns, then you have no restrictions except that you are forbidden to apply vectorization to expressions which are itself vector operations (e.g. the normalization). Plus, you are restricted to either matrix inversion or Maxima Solve()

So I still recommend two adjustments:
- Improve the SMath cross product. The sheet below shows that with a proper cross product we don't need to mark the unknowns as units.
- Accept units as names of unknowns in the FindRoot() solver (if specified at the left hand side of the unknown=guess equations).

Still, unit-shaped unknowns are a bit strange to me, so a robust alternative is still welcome.

2023-08-16 20_38_40-SMath Solver - [issues.sm].png
issues.sm (103.7 KiB)已下载 1732 次。







Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1位用户喜欢此帖子
Alvaro 2023/8/17 06:34:00
  • 有新帖
  • 无新帖