answer different on MATLAB than the expected answer

조회 수: 2 (최근 30일)
Hamzah Al-Hamidi
Hamzah Al-Hamidi 2021년 11월 16일
댓글: Paul 2021년 11월 16일
i have used this code to solve ODE
syms y(x)
Q_22= (diff(y,x,3))- (diff(y,x,2))== 6;
disp('The solution is:')
The solution is:
ySol(x) = simplify(dsolve(Q_22))
ySol(x) = 
But the expected answer i needed to be is as following :
these are the steps of solving it :

채택된 답변

Paul
Paul 2021년 11월 16일
Mathematically, the answers are the same because the Ci are abitrary constants (absent any othe conditions on the solution). So the mapping from the Matlab solution to your solution is:
C1 + C2 - 6 -> C1
C1 - 6 -> C2
C3 -> C3
Or did you realize this and you just want to manipulate the Matlab solution to be in the same form as yours?
  댓글 수: 2
Hamzah Al-Hamidi
Hamzah Al-Hamidi 2021년 11월 16일
I want to manipulate it
Paul
Paul 2021년 11월 16일
If you know the answer you're going for, at least after seeing the form of ySol, you can manipulate manually
syms y(x)
Q_22= (diff(y,x,3))- (diff(y,x,2))== 6;
ySol(x) = simplify(dsolve(Q_22))
ySol(x) = 
syms C1 C2 C3 K1 K2 K3
ySol = subs(ySol,[C1+C2-6,C1-6,C3],[K1 K2 K3])
ySol(x) = 
ySol = subs(ySol,[K1 K2 K3],[C1 C2 C3])
ySol(x) = 
Automating this process would be more work, assuming it's even feasible.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by