Can anyone explain what this question means?

Write a program which runs as a function from the command line to find the equilibrium positions of the masses by solving Kx = b. Your program must plot the total length of the system as a function of k1/k2. Your plot should extend far enough to make clear any limiting values of the total length.
So I thought that I would get the user to input the k1 and k2 values within the function, because thats all they need to find the equilibrium positions. But if I only get one k1 and k2 values that would give me an equilibrium position how would i be able to plot that? It would just be a point.
And if we want a range of numbers then why would I create a function that asks for one input
Maybe I understand the question wrong but any help would be greatly appreciated

8 Comments

Please be more specific. Show your code, show your problems
I haven't written my code yet. But the question is regarding a coupled mass spring system.
This is what I have so far
Question: Write a program which runs as a function from the command line to find the equilibrium positions of the masses by solving Kx = b. Your program must plot the total length of the system as a function of k1/k2. Your plot should extend far enough to make clear any limiting values of the total length.
My solution so far
Solution
K = your_matrix
b = your_vector
x = K\b;
Simple?
Thank you, I did that part so far but I was mostly curious about the plotting part. How would I go about doing that?
Hm.
Maybe there should be a loop? Many k1 and k2
It's really confusing, and you're saying that the loop should be around the values of k1 and k2?
How would I go about doing that? How would I create a vector thats says 0, 1, 2, 3, 4,.............k1, 98, 99, 100
Like I would want the k1 and k2 values to be in the center of the vector
Something like that:
N = 20;
[x,y,z] = deal(zeros(1,N));
k1 = values?
k2 = values?
for i = 1:N
K = matrix
b = vector
X = K\b
x(i) = X(1);
y(i) = X(2);
z(i) = X(3);
end
plot3(x,y,z,'.r') % surface?
Thank you so much!

Sign in to comment.

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Asked:

on 15 Feb 2020

Commented:

on 15 Feb 2020

Community Treasure Hunt

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

Start Hunting!