Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The problem is that diff(a_V_ra,t) is giving you a column vector and vector([0,0,-g]) is giving you a row vector. Further, Sage sees the first as a matrix and the second as a vector. You can fix this using .column() as you did earlier in your code.

a_a_ra = diff(a_V_ra,t)+vector([0,0,-g]).column()


[ cos(psi)*D[0](v)(t)]
[                  -g]

My full code is:

var('psi t g')
v = function('v',t)


r_V_ra = vector([v,0,0])
a_V_ra = R_ra*r_V_ra.column()
a_a_ra = diff(a_V_ra,t)+vector([0,0,-g]).column()