MATLAB Solving MATLAB Matrix Equations for 4 Variables

Click For Summary
To solve a matrix equation involving four variables in MATLAB, begin by expressing the equations in matrix form. The provided input defines a vector V with four equations, each containing the variables I1 through I4. To compute these variables, utilize MATLAB's symbolic toolbox, specifically the "solve" function. Define the symbolic variables I1, I2, I3, and I4 using the 'syms' command. Then, set up each equation in the format required by the solve function. For example, the first equation can be expressed as 'V(1) - R1*I1 - j*(1/(omega*C1))*(I1-I2) + j*omega*L2*(I1-I3) - E1'. This method will allow you to find the values of I1 through I4 effectively.
Appa
Messages
15
Reaction score
0
I'm having trouble working my way through a MATLAB problem. How can I solve a matrix equation for four different variables?

Here is my input: (I know all variables except I1 through I4)

V = [(R1*I1 -j*(1/(omega*C1))*(I1-I2) +j*omega*L2*(I1-I3)-E1);
(-j*(1/(omega*C1))*(I2-I1) +j*omega*L1*I2 -j*(1/(omega*C2))*(I2-I4));
(j*omega*L3*I3 +j*omega*L2*(I3-I1) -j*(1/(omega*C3))*(I3-I4));
(-j*(1/(omega*C3))*(I4-I3) -j*(1/(omega*C2))*(I4-I2) +R2*I4 -E2)]

So how do I compute my needed variables out? The answer is propably simple, but I'm a complete beginner with MATLAB, and I really need help with this!

P.S. the integer j is the imaginary unit.
 
Physics news on Phys.org
Well the obvious starting point is to put your set of linear equations in matrix form. Is that the part you're stuck on?
 
Try the symbolic toolbox "solve" function?

Looks like you have 4 equations is V is a <4x1>, so you'll have four symbolic variables I1-I4.

eg.

[type what your other values are for omega, etc.]
syms I1 I2 I3 I4
solve('V(1) - R1*I1 -j*(1/(omega*C1))*(I1-I2) +j*omega*L2*(I1-I3)-E1', ...)

should tell you what I1-4 are, I think.
 

Similar threads

  • · Replies 29 ·
Replies
29
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 26 ·
Replies
26
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
22
Views
4K