Objectives: Develop a GUI that finds the steady?state displacements of a spring?
ID: 2998171 • Letter: O
Question
Objectives: Develop a GUI that finds the steady?state displacements of a spring?mass system.
m[(d^2)(x)]/[(d^2)(t)] = Fd - Fu
t arrow pointing right >> infintiy: [(d^2)(x)]/[(d)(t^2)] = 0 >> Fd - Fu = 0
This is the link of the image
https://www.dropbox.com/s/j0oqcet9m5mmr2d/Project%201%20-%20Fall%2014.pdf?dl=0
Minimum Features:
GUI should handle any number of mass and springs
GUI reads at least: masses (mi), mass position of zero elongation (x0,i) spring connections, spring
constants (kj), g sliding bar(enable analysis at different g forces)
Sets up and solves systems of linear equations for spring?mass system.
Displays a diagram of the system, including normalized box size based on mass and color?coded
mass based on final displacement
Bar plot with the displacement of each mass
Saves the output in a text file.
Scripts should be well?documented.
Allowed MATLAB functions: plot (and plot related functions), get, set, rectangle, round, msgbox,
disp, fprintf, format, input, ones, zeros, ceil, floor, strcmp. You are not allowed to use the
Explanation / Answer
clc;
close all;
clear all;
N=input(' input number of mass points ');
K=zeros(1,N);
mass=zeros(N,N);
stiff=zeros(N,N);
for j=1:N;
mass(j)=input('mass ');
x_0(j)=input('intial position ');
M(j)=input('number of springs ');
for i=1:M(j);
spring_coeff(j,i)=input('spring coeffcient');
end
K(1,j)=sum(spring_coeff(j,:));
end
for j=1:N;
K(1,j)=sum(spring_coeff(j,:));
for i=1:N;
if i==j
mass(i,j)=M(j);
else
mass(i,j)=0;
end
if i==j;
if i==1;
stiff(i,j)=-K(1,j)-K(1,j+1)
K(1,j+1)
stiff(i,j+1)=K(1,j+1);
elseif i==N
stiff(i,j)=-K(1,j);
stiff(i,j-1)=-K(1,j);
else
stiff(i,j)=-K(1,j)-K(1,j+1);
stiff(i,j-1)=K(1,j);
stiff(i,j+1)=K(1,j+1);
end
end
end
end
follow the link for gui
http://www.mathworks.in/discovery/matlab-gui.html
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.