Effacer les filtres
Effacer les filtres

Use MATLAB Editor to create a Linearizing Program

2 vues (au cours des 30 derniers jours)
Jack Glendenning
Jack Glendenning le 4 Mai 2016
Commenté : Bhavesh le 11 Mai 2016
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

Réponse acceptée

Bhavesh
Bhavesh le 9 Mai 2016
Modifié(e) : Bhavesh le 9 Mai 2016
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 commentaires
Jack Glendenning
Jack Glendenning le 11 Mai 2016
I finally understand now. Thank-you very much Bhavesh! That was very helpful.
Bhavesh
Bhavesh le 11 Mai 2016
It was my pleasure to help you and I am glad that the workaround resolved the issue.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Function Creation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by