System of linear equations

Hello
I have this system of linear equations (5 eq & 5 unknowns), and i want to know how I can get U1/Ub (transfer function) using the matlab? Since doing it by hand is a tedious process. I appreciate if you can show me the code I must use.

4 Comments

FRame matrices with coefficients of unknown first....and then use \.
@KSSV, I suspect the question is seeking a symbolic answer rather than a numerical solution to a concrete case with known coefficients. The latter is trivial. The former is akin to what one might do with Mathematica.
let me repharase my question; i don't want to solve the linear system of equation. What I attached is actually th laplace of math model. I want to understand how to use matlab to re-arrange terms the equations and substitue them in each other so at the end i get Transfer functions of U1/Ub, U2/Ub, U3/Ub and U4/Ub.
I appreciate if anyone can help me with this.
Look at the Symbolic Maths toolbox.
https://au.mathworks.com/help/symbolic/solve-a-system-of-algebraic-equations.html

Sign in to comment.

Answers (2)

I want to understand how to use matlab to re-arrange terms the equations and substitue them in each other so at the end i get Transfer functions of U1/Ub, U2/Ub, U3/Ub and U4/Ub.’
Considering the first equation:
syms ms cs uq us ks kq Us U1 Ub s
Eqn1 = Us*(ms*s^2 + cs*s + (uq+us)) == U1*(cs*s + ks) + kq*Ub; % Possibility #1
Eqn1 = Us*(ms*s^2 + cs*s + (kq+ks)) == U1*(cs*s + ks) + kq*Ub; % Possibility #2
Eqn1a = isolate(Eqn1, U1)
the result is:
U1 == -(Ub*kq - Us*(ms*s^2 + cs*s + kq + ks))/(ks + cs*s)
and since ‘Ub’ is not a factor of every term in the RHS (neither is ‘Us’), the result you want is not possible, at least for this equation.
You might be able to solve the system for ‘U1’ through ‘U4’ (I will let you type all of them in), and then derive the relevant transfer functions, however I am not optimistic.
I will let you do that experiment.

Asked:

MN
on 4 Dec 2020

Commented:

on 4 Dec 2020

Community Treasure Hunt

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

Start Hunting!