Jacobi polynomials in MATLAB

7 ビュー (過去 30 日間)
R shah
R shah 2016 年 7 月 5 日
コメント済み: R shah 2016 年 7 月 7 日
i want to execute jacobi polynomials for N = j-3 where j= 0, 1,...,4, a = b = 3 and x = -0.655, the code according to my knowledge will be,
syms j
a= 3;
b=3;
for j = 0:4
display (jacobiP(j-3,3,3,-0.655))
end
but this code isn't working kindly guide me.

回答 (1 件)

Karan Gill
Karan Gill 2016 年 7 月 6 日
Your first argument "j-3" is negative for j=0,1,2. That's what the error message says: A nonnegative integer or a symbol is expected.
If you replace "j-3" with "j" it works.
syms j
a= 3;
b=3;
for j = 0:4
jacobiP(j,3,3,-0.655)
end
ans =
1
ans =
-2.6200
ans =
3.5765
ans =
-2.8153
ans =
0.4398
  2 件のコメント
R shah
R shah 2016 年 7 月 6 日
thx sir, but i know this information i also know that jacobi polynomials are defined for n >= 0 but when we take the third derivative of jacobi polynomial we got the jacobi P(j-3, a+3, b+3, -0.655) i've taken the case when a = 0 and b = 0 so i must have to evaluate jacobiP(j-3, 3,3,-0.655). should i consider the values:
0 for j = 0
0 for j = 1
0 for j = 2
-2.,815 for j = 3
0.4398 for j = 4
R shah
R shah 2016 年 7 月 7 日
whats wrong if i take this code for above problem
clc; clear all
syms j
a = 3 ;
b = 3 ;
for j = 0:4
if j-3 == -3:-1
display(jacobiP(j-3,3,3,0.655) == 0)
else
display(jacobiP(j-3,3,3,0.655))
end
end

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePolynomials についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by