%
% File: flexc.m
% Controller for flexible beam simulation
% Created by Marc Bodson. Last revised: 05/23/25
%
% Control computations
%
% TO BE FILLED
%
% Store the results
%
if ip<=npoints
    ts(ip)=t;phis(ip)=phi;phirefs(ip)=phiref;ths(ip)=theta;
    if (imotor>imax);imotor=imax;end
    if (imotor<-imax);imotor=-imax;end
    imotors(ip)=imotor;
    ip=ip+1;
end
if ip>npoints;done=1;end   % Stop the simulation when done