# I solved the differential equation by eigenvalue​s/eigenvec​tors, how would I solve for the constants from my initial conditions?

조회 수: 1(최근 30일)
Sophia Horner 5 Dec 2019
답변: Navya Seelam 9 Dec 2019
syms lambda
A = [-8/3 0 0; 8/3 -8/2 0; 0 8/2 -8/24];
Id3 = sym([1,0,0;0,1,0;0,0,1])
B = lambda*Id3-A
evs = solve(p)
null(evs(1)*Id3-A)
[evctrs,d] = eig(A)
x0 = [3; 7; 6];
lambda_1 = d(1,1);
lambda_2 = d(2,2);
lambda_3 = d(3,3);
vec_1 = evctrs(:,1);
vec_2 = evctrs(:,2);
vec_3 = evctrs(:,3);
syms C1 C2 C3 t
X = C1*vec_1*exp(-lambda_1*t)+C2*vec_2*exp(-lambda_2*t)+C3*vec_3*exp(-lambda_3*t)
% I have initial conditions x1(0)=3, x2(0)=7, and x3(0)=6, but I am not sure how I would equate them to solve for the constants in my equation.

로그인 to comment.

### 답변(1개)

Navya Seelam 9 Dec 2019
Hi,
You can use vpasolve to solve for C1, C2, C3. Try the following
vpasolve(subs(X(1),t,0)==3,C3) % to solve for C3.
Similarly you can solve for C2 and C3.

#### 댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.