diff --git a/OOequipment/RC_TransferFunction.mlx b/OOequipment/RC_TransferFunction.mlx index 0d34e1c..ef29a01 100644 Binary files a/OOequipment/RC_TransferFunction.mlx and b/OOequipment/RC_TransferFunction.mlx differ diff --git a/OOequipment/RLC_TransferFunction.mlx b/OOequipment/RLC_TransferFunction.mlx index f9f205a..9506645 100644 Binary files a/OOequipment/RLC_TransferFunction.mlx and b/OOequipment/RLC_TransferFunction.mlx differ diff --git a/OOequipment/subfiles/RC_TransferFunction_script.m b/OOequipment/subfiles/RC_TransferFunction_script.m index de8eb9a..e5287ab 100644 --- a/OOequipment/subfiles/RC_TransferFunction_script.m +++ b/OOequipment/subfiles/RC_TransferFunction_script.m @@ -44,6 +44,7 @@ if theory_only == false xlabel('Frequency [Hz]','Fontsize',10); legend('Average Measurement','Theory'); grid on + linkaxes([ax1,ax2],'x') %% plot avearage measurement with standard deviation and theory. figure; @@ -68,6 +69,7 @@ if theory_only == false xlabel('Frequency [Hz]','Fontsize',10); legend('Average Measurement','Theory'); grid on + linkaxes([ax1,ax2],'x') %% plot avearage measurement with standard deviation. figure; ax1 = subplot(2,1,1); @@ -85,4 +87,5 @@ if theory_only == false xlabel('Frequency [Hz]','Fontsize',10); legend('Average Measurement'); grid on + linkaxes([ax1,ax2],'x') end \ No newline at end of file diff --git a/OOequipment/subfiles/RLC_TransferFunction_script.m b/OOequipment/subfiles/RLC_TransferFunction_script.m index 944a171..160035c 100644 --- a/OOequipment/subfiles/RLC_TransferFunction_script.m +++ b/OOequipment/subfiles/RLC_TransferFunction_script.m @@ -3,19 +3,22 @@ S = asymptote(S_smaller,S_larger,f,Fc); P = mod(P,pi); figure; -subplot(2,1,1); +ax1 = subplot(2,1,1); semilogx(f,A,f,S) ylabel('Magnitude [dB]','Fontsize',10); xlabel('Frequency [Hz]','Fontsize',10); +xlim([f_start,f_stop]); legend('Theory','Asymptote'); grid on title('RLC-circuit Bodeplot Theory') -subplot(2,1,2); +ax2 = subplot(2,1,2); semilogx(f,P) ylabel('Phase [rad]','Fontsize',10); xlabel('Frequency [Hz]','Fontsize',10); +xlim([f_start,f_stop]); legend('Theory'); grid on +linkaxes([ax1,ax2],'x') %% Run the measurements if theory_only == false @@ -28,24 +31,25 @@ if theory_only == false %% plot average measurement, theory and asymptote. figure; - subplot(2,1,1); + ax1 = subplot(2,1,1); semilogx(data.frequency,20*log10(A_mean),f,A,f,S) ylabel('Magnitude [dB]','Fontsize',10); xlabel('Frequency [Hz]','Fontsize',10); legend('Average Measurement','Theory','Asymptote'); grid on title('RLC-circuit Bodeplot') - subplot(2,1,2); + ax2 = subplot(2,1,2); semilogx(data.frequency,P_mean,f,P) ylabel('Phase [rad]','Fontsize',10); xlabel('Frequency [Hz]','Fontsize',10); legend('Average Measurement','Theory'); grid on + linkaxes([ax1,ax2],'x') %% plot avearage measurement with standard deviation and theory. figure; - ax = subplot(2,1,1); - ax.XScale = 'log'; + ax1 = subplot(2,1,1); + ax1.XScale = 'log'; errorbar(data.frequency,20*log10(A_mean),20*log10(A_std)) hold on semilogx(f,A) @@ -55,8 +59,8 @@ if theory_only == false legend('Average Measurement','Theory','Asymptote'); grid on title('RLC-circuit Bodeplot') - ax = subplot(2,1,2); - ax.XScale = 'log'; + ax2 = subplot(2,1,2); + ax2.XScale = 'log'; errorbar(data.frequency,P_mean,P_std); hold on semilogx(data.frequency,P_mean,f,P) @@ -65,21 +69,23 @@ if theory_only == false xlabel('Frequency [Hz]','Fontsize',10); legend('Average Measurement','Theory'); grid on + linkaxes([ax1,ax2],'x') %% plot avearage measurement with standard deviation. figure; - ax = subplot(2,1,1); - ax.XScale = 'log'; + ax1 = subplot(2,1,1); + ax1.XScale = 'log'; errorbar(data.frequency,20*log10(A_mean),20*log10(A_std)) ylabel('Magnitude [dB]','Fontsize',10); xlabel('Frequency [Hz]','Fontsize',10); legend('Average Measurement'); grid on title('RLC-circuit Bodeplot') - ax = subplot(2,1,2); - ax.XScale = 'log'; + ax2 = subplot(2,1,2); + ax2.XScale = 'log'; errorbar(data.frequency,P_mean,P_std); ylabel('Phase [rad]','Fontsize',10); xlabel('Frequency [Hz]','Fontsize',10); legend('Average Measurement'); grid on + linkaxes([ax1,ax2],'x') end \ No newline at end of file