matlab求解超越方程x^2*tan(x) + x^2 = b; 其中b为参数,要求得到含有b的数值解.给出代码!我总共55分,全捐给你了.要求给出在0到正无穷之间的至少前十个解。
来源:学生作业帮助网 编辑:作业帮 时间:2024/12/01 14:18:53
matlab求解超越方程x^2*tan(x) + x^2 = b; 其中b为参数,要求得到含有b的数值解.给出代码!我总共55分,全捐给你了.要求给出在0到正无穷之间的至少前十个解。
matlab求解超越方程x^2*tan(x) + x^2 = b; 其中b为参数,要求得到含有b的数值解.给出代码!
我总共55分,全捐给你了.
要求给出在0到正无穷之间的至少前十个解。
matlab求解超越方程x^2*tan(x) + x^2 = b; 其中b为参数,要求得到含有b的数值解.给出代码!我总共55分,全捐给你了.要求给出在0到正无穷之间的至少前十个解。
clear all
close all
clc
syms x;
f=x^2*tan(x) + x^2;
f=fcnchk( char(f) );
b=-1:100;
sov=[];
for i=1:length(b)
sovi=fsolve(f, b(i));
sov=[sov;sovi];
clc;
end
sov
g = unique(sov);
b=-1:0.1:100;
for i=1:length(b)
y(i)=f(b(i));
end
plot(b, y);
hold on;
plot(g, zeros(1, length(g)), 'k.');
-0.785398163681049
0
0.00486246554641834
2.35619449019213
2.35619449019235
2.35619449009178
5.49778714361504
5.49778714378205
5.49778714378214
8.63937979737193
8.63937979736053
8.63937979732950
11.7809724509617
11.7809724509616
11.7809724509616
11.7809724509617
14.9225651045515
14.9225651045515
14.9225651045515
18.0641577581413
18.0641577581413
18.0641577581413
21.2057504117311
21.2057504117311
21.2057504117311
24.3473430653209
24.3473430653209
24.3473430653209
27.4889357189107
27.4889357189107
27.4889357189107
30.6305283725005
30.6305283725005
30.6305283725005
33.7721210260903
33.7721210260903
33.7721210260903
33.7721210260903
36.9137136796801
36.9137136796801
36.9137136796801
40.0553063332699
40.0553063332699
40.0553063332699
43.1968989868597
43.1968989868597
43.1968989868597
46.3384916404495
46.3384916404495
46.3384916404495
49.4800842940392
49.4800842940392
49.4800842940392
52.6216769476290
52.6216769476290
52.6216769476290
55.7632696012188
55.7632696012188
55.7632696012188
55.7632696012188
58.9048622548086
58.9048622548086
58.9048622548086
62.0464549083984
62.0464549083984
62.0464549083984
65.1880475619882
65.1880475619882
65.1880475619882
68.3296402155780
68.3296402155780
68.3296402155780
71.4712328691678
71.4712328691678
71.4712328691678
74.6128255227576
74.6128255227576
74.6128255227576
77.7544181763474
77.7544181763474
77.7544181763474
77.7544181763474
80.8960108299372
80.8960108299372
80.8960108299372
84.0376034835270
84.0376034835270
84.0376034835270
87.1791961371168
87.1791961371168
87.1791961371168
90.3207887907066
90.3207887907066
90.3207887907066
93.4623814442964
93.4623814442964
93.4623814442964
96.6039740978861
96.6039740978861
96.6039740978861
99.7455667514759
99.7455667514759
楼主的表达似乎有问题,还有b的数值解,以b=1为例,求解如下,如果楼主想多次求解,可以变成矩阵的形式。
solve('x^2*tan(x)+x^2-1','x')
ans =
2.4470505933255074042290858176216
not enough.
¥50, I'll do it.