function postprocessing_plots(IDDATA, CMDATA, PPDATA) %{ Function for ploting the results defined from the postproceesing. -------------------------------------------------------------------------- Syntax : postprocessing_plots(IDDATA, CMDATA, FDDATA) -------------------------------------------------------------------------- File Description : -------------------------------------------------------------------------- %} % ------------------------------------------------------------------------ % humeral head coordinates in the glenoid frame figure subplot(2,2,3); p1 = plot(IDDATA.t(1:size(IDDATA.t,2)-1),... 1e3*PPDATA.HHT(:,1:size(IDDATA.t,2)-1),... 'linewidth', 1); p1(1).Color = 'r';p1(2).Color = 'g';p1(3).Color = 'b'; grid on; title('HHT in glenoid frame, displacement[mm]',... 'fontsize', 11, ... 'fontweight', 'bold', ... 'fontname', 'sansserif'); xlabel('time [s]','fontsize',10,'fontweight','bold'); ylabel('displacement [mm]','fontsize',10,'fontweight','bold'); Motion3 = legend('pos-ant','inf-sup','lat-med','Location','best'); set(Motion3,'FontSize',10); % humeral head velocities in the glenoid frame subplot(2,2,4); p2 = plot(IDDATA.t(1:size(IDDATA.t,2)-1),... 1e3*PPDATA.HHT_D(:,1:size(IDDATA.t,2)-1),... 'linewidth', 1); p2(1).Color = 'r';p2(2).Color = 'g';p2(3).Color = 'b'; grid on; title('HHT in glenoid frame, velocity [mm/s]',... 'fontsize', 11, ... 'fontweight', 'bold', ... 'fontname', 'sansserif'); xlabel('time [s]','fontsize',10,'fontweight','bold'); ylabel('velocity [mm/s]','fontsize',10,'fontweight','bold'); Motion4 = legend('pos-ant','inf-sup','lat-med','Location','best'); set(Motion4,'FontSize',10); % plot the resultant contact force associated with the 6DOF and 3DOF joint models subplot(2,2,1); p3 = plot(IDDATA.t(1:size(IDDATA.t,2)-1),... PPDATA.F_resultant_magnitude(1,1:size(IDDATA.t,2)-1),... IDDATA.t(1:size(IDDATA.t,2)-1),... IDDATA.JointReactionMagnitude(1,1:size(IDDATA.t,2)-1),... 'linewidth', 1); p3(1).Color = 'r';p3(2).Color = 'b' grid on; xlabel('time [s]','fontsize',10,'fontweight','bold'); ylabel('contact force [N]','fontsize',10,'fontweight','bold'); Motion5 = legend('6DOF joint','3DOF joint','Location','best'); title('contact force [N]',... 'fontsize', 11, ... 'fontweight', 'bold', ... 'fontname', 'sansserif'); set(Motion5,'FontSize',10); % plot the maximum deformation with time subplot(2,2,2); p4 = plot(IDDATA.t(1:size(IDDATA.t,2)-1),... 1e3*PPDATA.max_deformation(1:size(IDDATA.t,2)-1),... 'linewidth', 1); p4(1).Color = 'b'; grid on; xlabel('time [s]','fontsize',10,'fontweight','bold'); ylabel('deformation [mm]','fontsize',10,'fontweight','bold'); %Motion6 = legend('6DOF joint','3DOF joint','Location','best'); title('cartilage deformation [mm]',... 'fontsize', 11, ... 'fontweight', 'bold', ... 'fontname', 'sansserif'); %set(Motion6,'FontSize',10); % ------------------------------------------------------------------------ % ------------------------------------------------------------------------ % projection view of the humeral head translations on the glenoid fossa HHT_MIG = figure; HHT_MIGAxis = axes('units', 'normalized', 'position', [0.1, 0.1, 0.8, 0.8]); % left distance, bottom distance, width, height CurrentDirectory = pwd; fossa = imread([CurrentDirectory, '/input figures/fossa_try4.png'], 'png'); set(HHT_MIG, 'CurrentAxes', HHT_MIGAxis); image(fossa); box off; axis off; axis equal hold on axes('units', 'normalized', 'position', [0.12, 0.12, 0.8, 0.8]); colorcode = linspace(1,10,length(PPDATA.HHT(1,1:size(IDDATA.t,2)-1))); scatter(1e3*PPDATA.HHT(1,1:size(IDDATA.t,2)-1),... 1e3*PPDATA.HHT(2,1:size(IDDATA.t,2)-1),[],colorcode,... 'LineWidth',1.5);box off;axis off; % scatter(1e3*IDDATA.Coordinate_Evolution(4,1:size(IDDATA.t,2)-1),... % 1e3*IDDATA.Coordinate_Evolution(5,1:size(IDDATA.t,2)-1),[],colorcode,... % 'LineWidth',1.5);box off;axis off; viscircles([0 0],30,'LineStyle','none'); axis equal; title('migration of the humeral head on the glenoid fossa',... 'fontsize', 11, ... 'fontweight', 'bold', ... 'fontname', 'sansserif'); return