Thank you for making this video. It's good to have content that demonstrates modelling concepts with simple, accessible examples. Here is the GNU Octave version of the code (it requires a little setup ...installation of control and symbolics packages and configuration with Python and Sympy... ChatGPT is your friend): m1 = 1; m2 = 1; k1 = 5; k2 = 5; b = 1; syms s U; A = [m1*s^2 + b*s + k1 + k2, -b*s - k2; -b*s - k2, m2*s^2 + b*s + k2]; B = [k1*U; 0]; x_s = A \ B; % Substitute U with 1 to simplify the expressions x_s = subs(x_s, U, 1); % Extract numerator and denominator manually [num1, den1] = numden(x_s(1)); [num2, den2] = numden(x_s(2)); % Convert symbolic expressions to numeric coefficients num1_coeffs = double(coeffs(num1, s, 'All')); den1_coeffs = double(coeffs(den1, s, 'All')); num2_coeffs = double(coeffs(num2, s, 'All')); den2_coeffs = double(coeffs(den2, s, 'All')); % Create transfer functions G1 = tf(num1_coeffs, den1_coeffs); G2 = tf(num2_coeffs, den2_coeffs); % Define the time vector and input signal t = 0:0.1:30; u = sin(t); % Simulate the system response x = lsim(G1, u, t); y = lsim(G2, u, t); % Plot the results plot(t, x); hold on; plot(t, y); hold off;
This is not a MIMO system. MIMO systems can not have single transfer functions and single input-output relationships. Instead, you may have G(s) from y1 to u1, y1 to u2, etc.
Thank you for making this video. It's good to have content that demonstrates modelling concepts with simple, accessible examples. Here is the GNU Octave version of the code (it requires a little setup ...installation of control and symbolics packages and configuration with Python and Sympy... ChatGPT is your friend):
m1 = 1; m2 = 1; k1 = 5; k2 = 5; b = 1;
syms s U;
A = [m1*s^2 + b*s + k1 + k2, -b*s - k2; -b*s - k2, m2*s^2 + b*s + k2];
B = [k1*U; 0];
x_s = A \ B;
% Substitute U with 1 to simplify the expressions
x_s = subs(x_s, U, 1);
% Extract numerator and denominator manually
[num1, den1] = numden(x_s(1));
[num2, den2] = numden(x_s(2));
% Convert symbolic expressions to numeric coefficients
num1_coeffs = double(coeffs(num1, s, 'All'));
den1_coeffs = double(coeffs(den1, s, 'All'));
num2_coeffs = double(coeffs(num2, s, 'All'));
den2_coeffs = double(coeffs(den2, s, 'All'));
% Create transfer functions
G1 = tf(num1_coeffs, den1_coeffs);
G2 = tf(num2_coeffs, den2_coeffs);
% Define the time vector and input signal
t = 0:0.1:30;
u = sin(t);
% Simulate the system response
x = lsim(G1, u, t);
y = lsim(G2, u, t);
% Plot the results
plot(t, x);
hold on;
plot(t, y);
hold off;
This is not a MIMO system. MIMO systems can not have single transfer functions and single input-output relationships. Instead, you may have G(s) from y1 to u1, y1 to u2, etc.
You are right on this case.
Hi, maybe you could help me with an exercise on the transfer function of a circuit? 🙏