-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMBtorque.m
More file actions
34 lines (26 loc) · 800 Bytes
/
MBtorque.m
File metadata and controls
34 lines (26 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
classdef MBtorque < MBforce
properties
fun; % time function for N(t)
matlab_file % name of a matlab file defining the torque
end
methods
function obj = MBtorque(varargin)
data = varargin{1};
obj = obj@MBforce(data.id, data.body1, []);
syms t;
obj.fun = matlabFunction(eval(data.fun), 'vars', t);
end
function print(obj)
print@MBforce(obj);
fprintf(' torque function: %s\n', func2str(obj.fun));
end
function Q = eval(obj, t, qi, qdi)
Q = [0;0;obj.fun(t)];
end
end
methods(Static)
function type = getType()
type = 'Torque';
end
end
end