Commit f7b07415 authored by Gidon Lucian Bauer's avatar Gidon Lucian Bauer 🏳
Browse files

Plot mit Schnittpunkten

parent f60addce
......@@ -2,44 +2,51 @@
clear; clc; close all;
%%
FBv = linspace(0, 20000);
FBv_over_Fz = linspace(0, 0.6);
FBv_over_Fz = linspace(0, 0.6, 10000);
figure(1);
tiledlayout(1,2);
ideal_FBh_over_Fz = ideal_breaking_dist(FBv_over_Fz);
real_FBh_over_Fz = real_breaking_dist(FBv_over_Fz);
nexttile;
hold on;
plot(FBv, ideal_breaking(FBv));
xlabel('F_B_,_v');
ylabel('z');
title('Ideal breaking');
hold off;
diff = abs(ideal_FBh_over_Fz - real_FBh_over_Fz);
intersectsx = [];
intersectsy = [];
j = 1;
for i = 1:length(diff)
if (diff(i) <= 1e-5)
intersectsx(j) = FBv_over_Fz(i);
intersectsy(j) = real_FBh_over_Fz(i);
j = j+1;
end
end
nexttile;
figure(1);
hold on;
plot(FBv_over_Fz, breaking_dist(FBv_over_Fz));
plot(FBv_over_Fz, ideal_FBh_over_Fz, 'DisplayName', 'ideal');
plot(FBv_over_Fz, real_FBh_over_Fz, 'DisplayName', 'real');
plot(intersectsx, intersectsy, 'x', 'Color', 'k', 'DisplayName', 'intersects');
for k = 1:(j-1)
text(intersectsx(k), intersectsy(k), ['\leftarrow (', num2str(intersectsx(k)), ', ', num2str(intersectsy(k)), ')']);
end
xlabel('F_B_,_v / F_z');
ylabel('F_B_,_h / F_z');
title('Distribution');
legend();
hold off;
function [FBh_over_Fz] = breaking_dist(FBv_over_Fz)
lh = 2;
h = 1.75;
l = 5;
function [FBh_over_Fz] = real_breaking_dist(FBv_over_Fz)
m = 0.6559;
FBh_over_Fz = -(lh/(2*h)) + sqrt((lh/(2*h))^2 + FBv_over_Fz * (l/h)) - FBv_over_Fz;
FBh_over_Fz = m .* FBv_over_Fz;
end
function [fid] = ideal_breaking(FBv)
function [FBh_over_Fz] = ideal_breaking_dist(FBv_over_Fz)
lh = 2;
h = 1.75;
l = 5;
m = 12000;
g = 9.81;
Fz = m * g;
fid = -(lh/(2*h)) + sqrt((lh/(2*h))^2 + (FBv*l)/(Fz*h));
FBh_over_Fz = -(lh/(2*h)) + sqrt((lh/(2*h))^2 + FBv_over_Fz * (l/h)) - FBv_over_Fz;
end
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment