Minimization of a definite integral

2 views (last 30 days)
Shz713
Shz713 on 30 Nov 2015
Commented: Shz713 on 30 Nov 2015
I want to find out the unknown parameter (x) by minimizing the error norm of the equations attached. The objective is to fined value of sai (greek letter).
  • Syy, S1y and S2y are column vectors (power spectral density)
  • H1_bar and H2_bar have trigonometric equation defined based on sai-->which have an integer values *L is length-->have an integer values*0-1st resonant frequency is the range of integration
I tried using fminbnd but I cannot define the integral when I'm creating an anonymous function. Also, I did define sai as syms but when I ran fminbnd I got a few errors. I need some guidance on how may I get the minimum value of sai. Should I define integration separately or can be embedded in the optimization command? Any suggestions is warmly appreciated.

Answers (1)

Torsten
Torsten on 30 Nov 2015
Create an .m file to define the function to be minimized and call MATLAB's "integral" within this function to evaluate the integral depending on zeta.
Best wishes
Torsten.
  4 Comments
Shz713
Shz713 on 30 Nov 2015
if true
D_1 = load ('d_1.txt'); %vertical acceleration @ initial
D_3 = load ('d_3.txt'); %vertical acceleration @ end
Fi_1 = load ('fi_1.txt'); %rotational acceleration @ initial
Fi_3 = load ('fi_3.txt'); %rotational acceleration @ end
D_2 = load ('d2.txt'); % vertical acceleration at middle
u_1 = D_1 + D_3;
u_2 = Fi_1 - Fi_3;
sub_length = 39.3; %length of internal substructure in meter-> 25sec measurement used
fs = 20; %sampling frequency Hz
ts= 1/fs; %intervals between data points/distance between data points
N = length (u_1); %number of data points
tmax= (N-1)*ts;
t = 0:ts:tmax; %time-step size
YY = abs (fft (D_2)); %FFT of signal
Y_1 = abs (fft (u_1)); %abs gives magnitude spectrum, otherwise shows complex numbers
Y_2 = abs (fft (u_2));
bin_num = 0:N-1; %by default bins are added by one in Matlab->(N-1)bins are started from zero not one
Syy= YY.* conj(YY); % power spectral density (PSD)
S1y = Y_1.*conj (YY); % cross spectral density (CSD)
S2y = Y_2.*conj (YY);
fbins = bin_num*fs/N; %shows frequencies in Hz
%syms sai; %creates a symbolic variable in workspace with the value sai assigned to sai
%y=sym('y') is equivalent to above
% J= max(fbins);
subplot (3,1,1);
% plot(bin_num,Syy,'r');
plot(fbins,Syy,'m');
xlabel('Frequency (Hz)');
ylabel('Power/Frequency (dB/Hz)');
title ('Syy (\Omega)');
subplot (3,1,2);
plot(fbins,S1y,'r');
xlabel('Frequency (Hz)');
ylabel('Power/Frequency (dB/Hz)');
title ('S1y (\Omega)');
subplot (3,1,3);
plot(fbins,S2y,'g');
xlabel('Frequency (Hz)');
ylabel('Power/Frequency (dB/Hz)');
title ('S2y (\Omega)');
syms sai
% error_norm = @ (sai) (Syy - ((h1_bar * S1y) + (h2_bar * sub_length * S2y))) ^ 2; error_norm = @ (sai) (Syy - ((0.5*(((sin (sai)+ sinh(sai))/((sin(sai)*cosh(sai))+(cos(sai)*sinh(sai))))) .* S1y) + ... (((-1 / (4 * sai)) (((cos (sai)- cosh(sai))/((sin(sai)*cosh(sai))+(cos(sai)*sinh(sai))))) * sub_length) . S2y))) .^ 2;
% h1_bar = 0.5*(((sin (sai)+ sinh(sai))/((sin(sai)*cosh(sai))+(cos(sai)*sinh(sai))))); % h2_bar = (-1 / (4 * sai)) *(((cos (sai)- cosh(sai))/((sin(sai)*cosh(sai))+(cos(sai)*sinh(sai)))));
min_sai = fminbnd (error_norm,0,3); end I tried first to define sai (zeta) as symbolic but I cannot use it in optimization. So I created anonymous function handle for zeta. Now I am not sure where to define optimization and integration. end

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!