Question: Solve system of ODE in Matrix form


I need to solve a system of ode in matrix. I've been trying with the proc instruction for three days, but it doesn't work! (I'm quite new into Maple).

My system as the form:

M*y'' + C*y' + K*y = F.

M,C,K are matrix of (n*n) (n is between 2 and 200 depending of the problem). y is the unknown, a vector of n degrees of freedom depending of time. F is a Vector of n components.

I've try with:

p = proc(n,t,Y,YP)

YP[1] = Y[2]

YP[2] = M^(-1)*(F-C*Y[2]-K*Y[1])


then I call dsolve with the Initial Conditions:



And I get this Error message:

Error, (in LinearAlgebra:-MatrixVectorMultiply) invalid input: LinearAlgebra:-MatrixVectorMultiply expects its 2nd argument, Options, to be of type Vector[column] but received 0.

I will be very thankful if someone can help me with this!

Please Wait...