필터 지우기
필터 지우기

Use MATLAB Editor to create a Linearizing Program

조회 수: 2 (최근 30일)
Jack Glendenning
Jack Glendenning 2016년 5월 4일
댓글: Bhavesh 2016년 5월 11일
Have to Linearize the following ODE using MATLAB Editor:
13y''+0.27y'-0.35/y +3.5=1.2753
y(0)=0
y'(0)=0 for 0<= t <=5

채택된 답변

Bhavesh
Bhavesh 2016년 5월 9일
편집: Bhavesh 2016년 5월 9일
For a 2nd order differential equation of the form - y'' + p(t) y' + q(t)y = g(t) with initial conditions - y(to) = yo and y'(to) = y1
We assign x1 = y; x2 = y0
Step 1) First convert 2nd order equation to an equivalent system of 1st order equations.
  • Let x1 = y and x2 = y'
Thus,
  • x1' = x2
  • x2' = -q(t)x1 - p(t)x2 + g(t)
Step 2) Create and save a .m file which will return a vector-valued function
function xp=eg1(t,x)
xp=zeros(2,1);
xp(1)=x(2);
xp(2)=(0.35/13)*x(1)-(0.27/13)*x(2)+(1.2753/13);
end
Step 3) Call the function by using the command -
[t,x]=ode45('eg1',[0,5],[0,0]);
  댓글 수: 2
Jack Glendenning
Jack Glendenning 2016년 5월 11일
I finally understand now. Thank-you very much Bhavesh! That was very helpful.
Bhavesh
Bhavesh 2016년 5월 11일
It was my pleasure to help you and I am glad that the workaround resolved the issue.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by