フィルターのクリア

Why doesn't get a numerical value

1 回表示 (過去 30 日間)
dcydhb dcydhb
dcydhb dcydhb 2018 年 12 月 27 日
編集済み: madhan ravi 2018 年 12 月 27 日
i have assigned all the Variable that i have to assign,but why not get a numerical value?
codes are as this
%此处如果不行可以单独拿出来
clc;
clear all;
close all;
syms n a d
%sn=n*pi/2*diff(besseli(0,n*pi*a/d),a)/(besseli(0,n*pi*a/d))
sn=(pi^2*n^2*besseli(1, (pi*a*n)/d))/(2*d*besseli(0, (pi*a*n)/d));
h=2;%水深
D1=0.8060;%圆柱吃水深度
a=2.2497;%圆柱半径
%d=h-D1;%圆柱底部到水底的距离
d=1.1940;
s0=vpa(subs(sn,n,0),5)
s1=vpa(subs(sn,n,1),5)
s2=vpa(subs(sn,n,2),5)
%s0=0.;
%s1=3.76552;
%s2=15.8176;
and the result are as this
s0 =
0.0
s1 =
(4.9348*besseli(1.0, (3.1416*a)/d))/(d*besseli(0.0, (3.1416*a)/d))
s2 =
(19.739*besseli(1.0, (6.2832*a)/d))/(d*besseli(0.0, (6.2832*a)/d))
>>
why

回答 (1 件)

madhan ravi
madhan ravi 2018 年 12 月 27 日
編集済み: madhan ravi 2018 年 12 月 27 日
Use should use subs() all at once (instead your variables are still symbolic) but below is another work around :
%此处如果不行可以单独拿出来
clc;
clear all;
close all;
syms n
h=2;%水深
D1=0.8060;%圆柱吃水深度
a=2.2497;%圆柱半径
%d=h-D1;%圆柱底部到水底的距离
d=1.1940;
%sn=n*pi/2*diff(besseli(0,n*pi*a/d),a)/(besseli(0,n*pi*a/d))
sn=(pi^2*n^2*besseli(1, (pi*a*n)/d))/(2*d*besseli(0, (pi*a*n)/d));
s0=vpa(subs(sn,n,0),5)
s1=vpa(subs(sn,n,1),5)
s2=vpa(subs(sn,n,2),5)
Gives:
s0 =
0.0
s1 =
3.7655
s2 =
15.818

カテゴリ

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

タグ

製品


リリース

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by