to find root of transcendental equation
18 次查看(过去 30 天)
显示 更早的评论
As from below program i need to confirm The roots are α = {2.7859,5.5215,7.9573} . how to find
a=0:0.01:9;
y1=sqrt(64-a.^2);
y2=-1.*a.*cot(a);
plot(a,y1)
grid on
hold on
plot(a, y2)
ylim([0, 12])
1 个评论
Dyuman Joshi
2023-5-9
Numerically you won't be able to find the exact values, more so as the data has 2 digit precision and the values you want to obtain have 4 digit precision.
As you can see below, for tolerance of 0.1 for step-size 0.01, you get 2 out of 3 intersection points -
a=0:0.01:9;
y1=sqrt(64-a.^2);
y2=-1.*a.*cot(a);
a(abs(y1-y2)<0.1)
For step-size 1e-4 and tolerance 1e-3, you get 4 different roots
a=0:0.0001:9;
y1=sqrt(64-a.^2);
y2=-1.*a.*cot(a);
a(abs(y1-y2)<0.001)
Even solve() is unable to find a solution symbolically, and returns a numeric solution via vpasolve. Note that vpasolve only returns a single solution for non-polynomial equations
syms x
assume(x>=0 & x<=9)
f1(x)=sqrt(64-x.^2);
f2(x)=-1.*x.*cot(x);
sol = solve(f1-f2==0, x)
You can call vpasolve() multiple times by setting 'Random' as true to obtain the solutions -
for k=1:5
s = double(vpasolve(f1-f2==0, x, [0 9], 'Random', true))
end
plot(a,y1)
grid on
hold on
plot(a, y2)
ylim([0, 12])
回答(1 个)
Matt J
2023-5-9
As from below program i need to confirm The roots are α = {2.7859,5.5215,7.9573}
If you only need to confirm the roots, just plug them in and check:
dy=@(a) sqrt(64-a.^2) + a.*cot(a);
dy([2.7859,5.5215,7.9573])
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Number Theory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
