No BSD License  

Highlights from
Calculating blending moment of the shaft

image thumbnail
from Calculating blending moment of the shaft by Riccardo
It calculate blending moment of the shaft when you insert a generic number of forces.

caricaforze
function caricaforze
disp('+------------------------------------------------------------+')
disp('|This software will calculate all the constraint reaction of |')
disp('|your shaft. Next you have the plot of blending moment of the|')
disp('|forces that you have loaded and the plot of the torque screw|')
disp('+------------------------------------------------------------+')
disp('Insert the feature of your forces:');
i=0;nFor=evalin('base','numeroforze');
for i=1:nFor
    fprintf('Write the magnitude of the force number %3i in KN \n',i);
    modulo=input('');
    verso=input('Insert the direction: 0 for Down and 1 for Up \n');
    distanza=input('Write now the distance between this force and the next from Left to Right in mm \n');
    vett(i,:)=[modulo verso distanza];

    % Modifica il segno alle forze dirette verso il basso e scrive
    % ordinatamente il vettore delle forze
    if vett(i,2)==0
        vett(i,1)=-vett(i,1);
    end
    
    % Scrive ordinatamente le coordinate dei punti d'applicazione delle forze e
    % i moduli delle forze all'interno del vettore forze standardizzato e
    % passato poi alla funzione breakup con il nome di vector
    if i==1
        forze(i,:)=[0 vett(i,1) vett(i,3) 0];
    else
        forze(i,:)=[0 vett(i,1) vett(i,3)+forze(i-1,3) 0];
    end
    
    % Butta dentro alle matrici del Workspace il vettore forze e coordinate
    % standardizzato
    assignin('base','forz',forze);
end

for k=1:nFor+1    
    fprintf('Insert the Torque screw in the place # %3i of the shaft in Nm \n',k);
    torc=input('');
    torcente(k)=torc;
end
assignin('base','torcente',torcente);

% Controlla la Distanza tra le Forze e segnala l'errore se la somma delle
% distanze supera la lunghezza totale dell'albero.
lun=evalin('base','lunghezza');
if forze(nFor,3)>lun
    errordlg({'You have surpassed the lenght of your shaft!! You have to write all the right distances again from the beginning.'},'ERROR!!')
    pause;exit
end

% Trova le reazioni vincolari sui 2 vincoli, l'apppoggio e la cerniera
posit0=[0 0];
[reazF0, reazM0]=reaction(forze,posit0);
F0=reazM0/lun;
posit1=[lun 0];
[reazF1, reazM1]=reaction(forze,posit1);
F1=-reazM1/lun;
plotta(F0,F1,lun,forze)

Contact us at files@mathworks.com