How would I visually represent my State Space Model?

7 vues (au cours des 30 derniers jours)
Kez
Kez le 14 Nov 2023
Commenté : Star Strider le 15 Nov 2023
I have made a program to determine the state space model of a ball and beam system. I wanted to visualise the output as I believe a graph is more beneficial than a series of matricies. However, I do not know how.
I was thinking of shoowing the displacement along the beam across time
Below is my program , any advice would be appreciated.
clear;
close all;
clc;
%% Setting Base Parameters %%
m = 0.5; % Allows Input for Mass of Ball %
R = 0.02; % Allows Input for Radius of Ball %
d = 1; % Allows Input for Lever Arm offset of Ball %
g_acc = 9.8; % Sets Value of Gravitational acceleration %
L = 10; % Allows Input for Beam Length %
Mu = 0.35; % Allows Input for Co-efficient of Friction %
Fr = -(Mu*m*g_acc); % Calculates Friction of the Beam %
T = 10; % Allows viewing of system within a specific time frame %
%% Solid Ball System %%
%% Calculation for Solid Ball Transfer Function %%
R2 = R^2;
J = (2/5)*m*R2; % Calculates Moment of Inertia %
s = tf('s');
SB_TF = -(m*g_acc*d)/(L*(J/R2)+m*(s^2))
%% Graphing Transfer Function of Solid Ball %%
%% Linearised State Space Model of Solid Ball %%
H = - m*g_acc/(J/(R^2) + m); % Characteristic Equation %
A = [0 1 0 0;
0 0 H 0;
0 0 0 1;
0 0 0 0];
B = [0 0;
0 ((1/(J/(R^2) + m))*Fr);
0 0;
1 0];
C = [1 0 0 0];
D = 0*C*B;
SB_Fr = ss(A, B, C, D)
  9 commentaires
Kez
Kez le 15 Nov 2023
Ah ok, I see the concern. I followed and with help from another MATLAB user Sam, modified where nececarry the srcipt found on this tutuorial:
Star Strider
Star Strider le 15 Nov 2023
O.K. Since that works, go with it.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by