Converting Linear Equations to Matrix Form

Hello,
I am trying to convert the following equations into matrix form.
Thanks.

댓글 수: 1

Hi Connor,
You wouldn't need to ask the question here. If you review your lecture notes, you will find the answer there!
Sepehr

댓글을 달려면 로그인하십시오.

답변 (2개)

Bjorn Gustavsson
Bjorn Gustavsson 2021년 2월 24일

0 개 추천

Is k some sort of propagation (time? space?) index and you want to convert these equations into a matrix-format, or are these actually some scalilng-factors?
In case 1:
C = [C11 0 0 0;C21 C22 0 0;0 C32 C33 0;0 0 C43 C44];
ad = [a;d;0;0];
x_next = C*x_curr + ad;
In case 2:
C = [C11*k-(k+1) 0 0 0;C21*k C22*k-(k+1) 0 0;0 C32*k C33*k-(k+1) 0;0 0 C43*k C44*k-(k+1)];
ad = -[a;d;0;0];
x = C\ad;
Think I got this right, not checked or tested.
HTH

댓글 수: 2

Honestly I have not been given any context what k is, just know I need to convert the equations into matrix form.
Before you continue coding you'd better get the context! You need to know if you're implementing a stepper that intends to solve some sort of difference equation (or ordinary differential equations), or if you're supposed to get a solution for a single system of equations. Before you code something you have to know what problem you're supposed to solve.
Regardless of that I've given you solutions to the two plausible variants I could guess, from there it's your job to get the information you need to understand which one to chose.

댓글을 달려면 로그인하십시오.

Hernia Baby
Hernia Baby 2021년 2월 24일
편집: Hernia Baby 2021년 2월 24일

0 개 추천

You need to convert following form.
X(i+1) = C*X(i) + a(i)
Xo = [0 0 0 0]';
X(:,1) = Xo;
C11 = 1;
C21 = 2; C22 = 3;
C32 = 4; C33 = 5;
C43 = 6; C44 = 7;
C = [C11 0 0 0; C21 C22 0 0; 0 C32 C33 0; 0 0 C43 C44]
step_num = 5;
a = zeros(4,step_num);
a(1:2,:) = randn(2, step_num);
i = 1;
while i <= step_num
X = C*X + a(:,i);
i = i + 1;
X
end

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2021년 2월 24일

댓글:

2021년 2월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by