# ModelingToolkit.jl trows error: statement is ambigous

Hi everyone, I’m new to Julia so maybe the problem that I’ve anecountered is preatty trivial.
Basically I have two main problem with the simple symbolic equation expressing the kinetic energy of a rigid body satellite.

• FIrst: I don’t know how to multiplicate a symbolic value by a scalar one.
• Second: the code part with: omega’(RIc*R’)*omega trows an error telling me that it is ambigous and here I got stucked and I’ve not found a solution so far.

Davide

``````using DifferentialEquations
using ModelingToolkit

@parameters I[1:3,1:3]  mc[1,1] mu[1,1]
@variables t r[1:3,1](t) angle[1:3,1](t)

D = Differential(t)

R= [cos(angle[1]).*cos(angle[3])-cos(angle[2]).*sin(angle[1]).*sin(angle[3])      sin(angle[1]).*cos(angle[3])+cos(angle[2]).*cos(angle[1]).*sin(angle[3])    sin(angle[2]).*sin(angle[3])
-cos(angle[1]).*sin(angle[3])-cos(angle[2]).*sin(angle[1]).*cos(angle[3])     -sin(angle[1]).*sin(angle[3])+cos(angle[2]).*cos(angle[1]).*cos(angle[3])   sin(angle[2]).*cos(angle[3])
sin(angle[2]).*sin(angle[3])                                          -sin(angle[2]).*cos(angle[1])                                       cos(angle[2])]

d_angle = D(angle)
v = D(r)

omega = [d_angle[2].*cos(angle[1])+d_angle[3].*sin(angle[2]).*sin(angle[1])
d_angle[2].*sin(angle[1])-d_angle[3].*sin(angle[2]).*cos(angle[1])
d_angle[1]+d_angle[3].*cos(angle[2])]

Tc = 0.5 *v'*(mc*v) + 0.5*omega'*(R*Ic*R')*omega
``````

What’s the error?

I have two different errors:

• The First one when I insert in the terminal the following part of the equation: 0.5 *v’ * (mc * v). And the error I get is: MethodError: no method matching *(::Float64, ::Symbolics.ArrayOp{Matrix{Num}})
• The second one I get is: MethodError: *(::LinearAlgebra.Adjoint{Num, Vector{Num}}, ::Symbolics.Arr{Num, 2}) is ambiguous.
when I write in the terminal the following: omega’ * (R * Ic * R’ ) * omega

Hope I was clear.

What’s the error message?