Use MATLAB Editor to create a Linearizing Program

2 次查看(过去 30 天)
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