How to apply a step input and plot it on Ansys mass stiffness damping ratio Matrix file (kdense.matrix)??

4 visualizaciones (últimos 30 días)
How to give step input and plot it to Ansys mass stiffness damping ratio Matrix file (kdense.matrix)??

Respuestas (1)

Vidhi Agarwal
Vidhi Agarwal el 28 de Feb. de 2024
Hi,
I understand you have query regarding giving and plotting the step response for your Ansys mass stiffness damping ratio Matrix file.
You can follow the steps below to plot the step response:
  1. Read the matrix file: Read the content of kdense.matrix file into MATLAB. Possible ways to read the file are: load(), fopen().
  2. Extract the matrices.
  3. Create a state space Model: Convert the mass, stiffness, and damping matrices into a state-space representation. The state-space model is a mathematical model of a physical system that is represented by a set of input, output, and state variables related by first-order differential equations.
  4. Apply a step input using “step” function of MATLAB.
  5. Plot the response using “plot” function of MATLAB.
For Example:
% Sample mass, damping, and stiffness matrices for a two-degree of freedom system
M = [2 0; 0 1.5]; % Mass matrix (kg)
C = [0.1 0; 0 0.2]; % Damping matrix (Ns/m)
K = [30 -10; -10 20]; % Stiffness matrix (N/m)
% Number of degrees of freedom
n = size(M, 1);
% Convert to state-space representation
% State-space matrices A, B, C, D
A = [zeros(n), eye(n); -M\K, -M\C];
B = [zeros(n, 1); inv(M)*[1; 0]];
C = [eye(n), zeros(n)];
D = zeros(n, 1); % Assuming no direct feedthrough
sys = ss(A, B, C, D);
% Apply a step input and plot the response
% Define a time vector for the simulation
timeVector = 0:0.01:10; % From 0 to 10 seconds with a step of 0.01 seconds
[y, t] = step(sys, timeVector);
figure;
plot(t, y(:,1)); % Response of the first degree of freedom
hold on;
plot(t, y(:,2)); % Response of the second degree of freedom

Community Treasure Hunt

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

Start Hunting!

Translated by