Следующее показывает полный пример файла компонента с аннотацией и получившимся библиотечным блоком и диалоговым окном. Файл изображения, custom_spring.jpg, расположен в той же папке как файл компонента. Этим примером является рисунок всех методов, описанных в Настройке Имени блока и Внешнего вида.
component spring
% Rotational Spring
% This block implements a simple rotational spring.
annotations
Icon = 'custom_spring.jpg';
end
nodes
r = foundation.mechanical.rotational.rotational; % rod
c = foundation.mechanical.rotational.rotational; % case:right
end
parameters
k = { 10, 'N*m/rad' }; % Spring rate
end
variables
theta = { 0, 'rad' }; % Deformation
t = { 0, 'N*m' }; % Torque
w = { 0, 'rad/s' }; % Angular velocity
end
branches
t : r.t -> c.t;
end
equations
assert(k>0)
w == r.w - c.w;
t == k * theta;
w == theta.der;
end
end


