フィルターのクリア

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 ビュー (過去 30 日間)
jamila nizamani
jamila nizamani 2014 年 10 月 31 日
編集済み: Roger Stafford 2014 年 10 月 31 日
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)

回答 (2 件)

Roger Stafford
Roger Stafford 2014 年 10 月 31 日
編集済み: Roger Stafford 2014 年 10 月 31 日
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 .

Image Analyst
Image Analyst 2014 年 10 月 31 日
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.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by