Troubleshooting MathCAD: Rotation of Body Vector About an Axis

Click For Summary
SUMMARY

The discussion focuses on troubleshooting a function in MathCAD that defines the rotation of a body vector about an axis. The user encountered an error stating "This array index is invalid for this array" due to incorrect indexing of the vector u, specifically using 1-based indexing instead of MathCAD's 0-based indexing. The solution involved correcting the indexing in the function definition to align with MathCAD's requirements. This highlights the importance of understanding array indexing in MathCAD when defining functions.

PREREQUISITES
  • Understanding of MathCAD syntax and functions
  • Knowledge of vector mathematics and rotation
  • Familiarity with matrix operations in MathCAD
  • Concept of array indexing, specifically 0-based indexing
NEXT STEPS
  • Review MathCAD documentation on function definitions and array indexing
  • Explore matrix rotation techniques in MathCAD
  • Learn about vector transformations and their applications
  • Investigate common errors in MathCAD and their solutions
USEFUL FOR

This discussion is beneficial for engineers, mathematicians, and students using MathCAD for computational tasks involving vector rotations and matrix operations.

TheJCBand
Messages
10
Reaction score
0
I'm not sure if this is the right place for this question, but I didn't see a forum specifically about software.

I'm trying to define a function in MathCAD that describes the rotation of a body vector about an axis u by an angle ɸ. What I've typed in is:

R(ɸ,u):= [ 3x3 matrix where each element is a function of ɸ and u ]

When I try evaluating the function for a given ɸ and u, it gives me the error "This array index is invalid for this array."
It sounds like the program thinks the parentheses indicate a an array index instead of the arguments of the function. Does anyone have any suggestions?

Thanks.
 
Physics news on Phys.org
I figured out the problem. My function R used indexes of the vector u, and the first index is 0 in MathCAD, and I using 1, so there was a u3 in the function, which didn't exist.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 21 ·
Replies
21
Views
4K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 15 ·
Replies
15
Views
2K
Replies
4
Views
2K
  • · Replies 10 ·
Replies
10
Views
4K