Plotting Airy equation using matlab

5 ビュー (過去 30 日間)
adlavishwajeeth reddy
adlavishwajeeth reddy 2020 年 6 月 4 日
How can I plot the airy function?
code used
syms y(t)
dsolve(diff(y, 2) - t*y == 0)
ezplot(dsolve , [-2,2])
This is the error observed
ans =
C1*airy(0, t) + C2*airy(2, t)
Warning: Empty equation.
> In dsolve (line 205)
In B4 (line 5)
Unable to perform assignment because the left and right sides have a different number of elements.
Error in ezplotfeval/applyfun (line 76)
z(i) = feval(f,x(i));
Error in ezplotfeval (line 63)
z = applyfun(x);
Error in ezplot>ezplot1 (line 486)
[y, f, loopflag] = ezplotfeval(f, x);
Error in ezplot (line 158)
[hp, cax] = ezplot1(cax, f{1}, vars, labels, args{:});
Error in sym/ezplot (line 78)
h = ezplot(fhandle(f),varargin{:});%#ok<EZPLT>
Error in B4 (line 5)
ezplot(dsolve , [-2,2])

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020 年 6 月 4 日
Here is one of the possible solution codes:
syms y(t)
Dy=diff(y,1);
D2y=diff(y, 2);
A=dsolve(D2y - t*y == 0, y(0)==1, Dy(0)==2);
ezplot(A, [-2, 2]); % or % fplot(A, [-2,2])
Note that to plot Airy function you'd need to specify the initial conditions.
  1 件のコメント
adlavishwajeeth reddy
adlavishwajeeth reddy 2020 年 6 月 4 日
Thank you sir

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by