Feb 23 2023
Worked backwards from a desired distance making the following assumptions:
We want the torpedo to travel 0.5m or about 20” 0.2m or about 8”
Torpedo mass of 10g
Compression of the spring by 1 cm or 0.01m
Damping/drag coefficient of 0.1
Calculations redone in next table
Worked backwards from the speed of the torpedo after launch to find desired speed
|
Wrote out ODE of the spring in launching action |
|
|
Did not solve on my calculator as the notes suggest—was giving a domain error. Instead, I solved the system on MATLAB to find the minimum spring constant with the desired velocity. |
% Lindsay Wright % RoboSubSpring.m % State Space for Spring and Water Damping % Last Modified: 2/23/23
%Some assumptions: a drag coefficient of 0.01 Ns/m, pushback of 1 cm at the %start t=0.001:0.001:0.1; kPlot=zeros(1,length(0.005:0.005:0.5)); vPlot=zeros(1,length(0.005:0.005:0.5));
for i=1:length(t) kPlot(i)=((pi/2/t(i))^2+25)/100; vPlot(i)=(pi/2)*0.01/t(i)*exp(-5*t(i)); end
figure plot(t,kPlot) xlabel('launch time (s)') ylabel('Spring Constant (N/m)')
figure plot(t,vPlot) xlabel('launch time (s)') ylabel('Velocity (m/s)')
table=zeros(3,length(t)); table(1,:)=t; table(2,:)=kPlot; table(3,:)=vPlot; disp(table) |
Conclusion: Need a minimum spring constant of 2750 N/m That is a powerful spring! |
Changing the distance requirement to 0.2m (about 8”) makes the needed initial velocity 2 m/s
This yields a spring constant of ~500 N/m
|
Changing the distance requirement to 0.3m (about 1’) makes the needed initial velocity 3 m/s
This yields a spring constant of ~1000 N/m or ~560 lbs/in |
close all; clear; clc;
% Lindsay Wright
% RoboSubSpring.m
% State Space for Spring and Water Damping
% Last Modified: 2/25/23
%Some assumptions: a drag coefficient of 0.01 Ns/m, pushback of 1 cm at the
%start
t=0.001:0.001:0.1;
kPlot=zeros(1,length(0.005:0.005:0.5));
vPlot=zeros(1,length(0.005:0.005:0.5));
for i=1:length(t)
kPlot(i)=((pi/2/t(i))^2+25)/100;
vPlot(i)=(pi/2)*0.03/t(i)*exp(-5*t(i)); %changed 0.01 kg to 0.03 kg
end
desired_travel = 5; % in meters
diff_val = abs(desired_travel*ones(1,length(t))-vPlot);
index = find(min(diff_val) == diff_val);
%index = find(vPlot == );
figure
hold on
plot(t,kPlot)
plot(t(index),kPlot(index),'LineStyle', 'none','Marker','o','MarkerSize',5,'MarkerFaceColor','red','MarkerEdgeColor','none')
hold off
xlabel('launch time (s)')
ylabel('Spring Constant (N/m)')
figure
hold on
plot(t,vPlot)
plot(t(index),vPlot(index),'LineStyle', 'none','Marker','o','MarkerSize',5,'MarkerFaceColor','red','MarkerEdgeColor','none')
hold off
xlabel('launch time (s)')
ylabel('Velocity (m/s)')
table=zeros(3,length(t));
table(1,:)=t;
table(2,:)=kPlot;
table(3,:)=vPlot;
%disp(table)
fprintf('need: %07.4f N/m or %08.4f lb/in to travel: %07.4f meters\n',kPlot(index),kPlot(index)*8.8507457676,vPlot(index))
20230301
Calculations redone to account for differences in mass. Also realized I made an error in calculating the roots of the characteristic equation, yielding a smaller spring constant than expected.
|
|
|
|
% Lindsay Wright % RoboSubSpring.m % State Space for Spring and Water Damping % Last Modified: 3/1/23 %Some assumptions: a drag coefficient of 0.01 Ns/m, pushback of 1 cm at the %start t=0.001:0.001:0.1; kPlot=zeros(1,length(0.005:0.005:0.5)); vPlot=zeros(1,length(0.005:0.005:0.5)); for i=1:length(t) kPlot(i)=((pi/2/t(i))^2+25/9)*3/100; vPlot(i)=(pi/2)*0.01/t(i); %changed 0.01 kg to 0.03 kg end desired_travel = 0.3; % in meters diff_val = abs(desired_travel*ones(1,length(t))-vPlot); index = find(min(diff_val) == diff_val); %index = find(vPlot == ); figure hold on plot(t,kPlot) plot(t(index),kPlot(index),'LineStyle', 'none','Marker','o','MarkerSize',5,'MarkerFaceColor','red','MarkerEdgeColor','none') hold off xlabel('launch time (s)') ylabel('Spring Constant (N/m)') figure hold on plot(t,vPlot) plot(t(index),vPlot(index),'LineStyle', 'none','Marker','o','MarkerSize',5,'MarkerFaceColor','red','MarkerEdgeColor','none') hold off xlabel('launch time (s)') ylabel('Velocity (m/s)') table=zeros(3,length(t)); table(1,:)=t; table(2,:)=kPlot; table(3,:)=vPlot; %disp(table) fprintf('need: %07.4f N/m or %08.4f lb/in to travel: %07.4f meters\n',kPlot(index),kPlot(index)*8.8507457676,vPlot(index)) |
Or, ~1.89 lb/in |