%String Vibration
%Clean the working space and close all open figures
clear all
close all

  disp('String Vibration')
  lw = 2; 
  set(0, 'DefaultAxesFontSize', 14);
  fs = 14;
  msize = 10;
% end of preabmle--------------------------------------
omega   = @(T, M, L)    1/2 * (M * L/T)^(-1/2);
  %-----------partial derivatives 
omega1T = @(T, M, L)    1/4 * (T * M * L)^(-1/2);
omega2T = @(T, M, L)   -1/8 * (T^3 * M * L)^(-1/2);
omega1M = @(T, M, L)   -1/4 * (M^3 * L/T)^(-1/2);
omega2M = @(T, M, L)    3/8 * (M^5 * L/T)^(-1/2);
omega1L = @(T, M, L)   -1/4 * (L^3 * M/T)^(-1/2);
omega2L = @(T, M, L)    3/8 * (L^5 * M/T)^(-1/2);

muL = 0.5;     sig2L = 0.0001;
muT = 70;      sig2T = 0.16;  
muM = 0.001;   sig2M = 10^(-8);


muomega = omega(muT, muM, muL) + 1/2 * ( ...
   omega2T(muT, muM, muL)* sig2T + ...
   omega2M(muT, muM, muL)* sig2M + ...
   omega2L(muT, muM, muL)* sig2L) 


sig2omega = ...
   (omega1T(muT, muM, muL))^2 * sig2T + ...
   (omega1M(muT, muM, muL))^2 * sig2M + ...
   (omega1L(muT, muM, muL))^2 * sig2L  

%    omega1T(muT, muM, muL)
%    omega1M(muT, muM, muL)
%    omega1L(muT, muM, muL) 
% 
%    omega2T(muT, muM, muL)
%    omega2M(muT, muM, muL)
%    omega2L(muT, muM, muL) 
 
   
% muomega = 187.8117
% sig2omega = 91.2857

