hi, i need your help, y''=xy, y(0)=0 and y(0)=1 this second order DE i can solve in power series method i got recurrence relation
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I can already solve center moving series, but how I can solve 50 and 100 order power series with plot.
This is my code:
h=0
a(0)=0;
a(1)=1;
N=50;
%x=0:0.0001:0.01;
%y=['a0+a1*x+a2*x.^2+...+a50*x^50'];
% plot(x,y, 'g', 'linewidth',1)
for n=2:N
a(n)=(a(n-3)+a(n-2))/(n)*(n-1);
end
disp(a)
0 Kommentare
Antworten (2)
Roger Stafford
am 31 Okt. 2014
Bearbeitet: Roger Stafford
am 31 Okt. 2014
I don't agree with your recurrence equation, Jamila. For the series I get:
y = x + x^4/(3*4) + x*7/(3*4*6*7) + x10/(3*4*6*7*9*10) + ...
This is a very fast converging series, so you should be able make plots of it easily over a far larger range than just 0 to 0.01 .
0 Kommentare
Image Analyst
am 31 Okt. 2014
Your for loop has to start with n=4, and you need to define a(1) through a(3) before the loop starts because you start using a(n-4) immediately within the loop.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!