필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)
How to give step input and plot it to Ansys mass stiffness damping ratio Matrix file (kdense.matrix)??

답변 (1개)

Vidhi Agarwal
Vidhi Agarwal 2024년 2월 28일
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

카테고리

Help CenterFile Exchange에서 Automated Driving Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by