用matlab编程求出y=-0.0855*x^3+0.0245*x^2+0.4983*x+0.4855 的的反函数,并y等于(0,1)的随机数时x的值
展开全部
>> syms x y
>> x=solve('y=-0.0855*x^3+0.0245*x^2+0.4983*x+0.4855')
x =
1.9518134734714195060968427132375/(((5.8479532163742690058479532163743*y - 3.1183913579587682140554409344666)^2 - 7.4355814434024474123676612805896)^(1/2) - 5.8479532163742690058479532163743*y + 3.1183913579587682140554409344666)^(1/3) + (((5.8479532163742690058479532163743*y - 3.1183913579587682140554409344666)^2 - 7.4355814434024474123676612805896)^(1/2) - 5.8479532163742690058479532163743*y + 3.1183913579587682140554409344666)^(1/3) + 0.09551656920077972709551656920078
0.09551656920077972709551656920078 + (((5.8479532163742690058479532163743*y - 3.1183913579587682140554409344666)^2 - 7.4355814434024474123676612805896)^(1/2) - 5.8479532163742690058479532163743*y + 3.1183913579587682140554409344666)^(1/3)*(- 0.86602540378443864676372317075294*i - 0.5) + (1.6903200514749938066147015794976*i - 0.97590673673570975304842135661875)/(((5.8479532163742690058479532163743*y - 3.1183913579587682140554409344666)^2 - 7.4355814434024474123676612805896)^(1/2) - 5.8479532163742690058479532163743*y + 3.1183913579587682140554409344666)^(1/3)
0.09551656920077972709551656920078 + (((5.8479532163742690058479532163743*y - 3.1183913579587682140554409344666)^2 - 7.4355814434024474123676612805896)^(1/2) - 5.8479532163742690058479532163743*y + 3.1183913579587682140554409344666)^(1/3)*(0.86602540378443864676372317075294*i - 0.5) + (- 1.6903200514749938066147015794976*i - 0.97590673673570975304842135661875)/(((5.8479532163742690058479532163743*y - 3.1183913579587682140554409344666)^2 - 7.4355814434024474123676612805896)^(1/2) - 5.8479532163742690058479532163743*y + 3.1183913579587682140554409344666)^(1/3)
>> y=rand(1)
y =
0.8147
>> subs(x)
ans =
2.1596 - 0.0000i
0.6944 + 0.0000i
-2.5675 - 0.0000i
个人建议,先对原函数拟合,再就反函数。如何???????
用matlab工具箱进行拟合,可以得到,用指数函数拟合的结果:
General model Power2:
f(x) = a*x^b+c
Coefficients (with 95% confidence bounds):
a = -0.0833 (-0.08339, -0.08321)
b = 3.005 (3.005, 3.005)
c = 11.88 (10.34, 13.42)
Goodness of fit:
SSE: 1829
R-square: 1
Adjusted R-square: 1
RMSE: 4.342
可得到拟合函数为:
y=-0.0833*x^3.005 +11.88;
>> x=solve('y=-0.0855*x^3+0.0245*x^2+0.4983*x+0.4855')
x =
1.9518134734714195060968427132375/(((5.8479532163742690058479532163743*y - 3.1183913579587682140554409344666)^2 - 7.4355814434024474123676612805896)^(1/2) - 5.8479532163742690058479532163743*y + 3.1183913579587682140554409344666)^(1/3) + (((5.8479532163742690058479532163743*y - 3.1183913579587682140554409344666)^2 - 7.4355814434024474123676612805896)^(1/2) - 5.8479532163742690058479532163743*y + 3.1183913579587682140554409344666)^(1/3) + 0.09551656920077972709551656920078
0.09551656920077972709551656920078 + (((5.8479532163742690058479532163743*y - 3.1183913579587682140554409344666)^2 - 7.4355814434024474123676612805896)^(1/2) - 5.8479532163742690058479532163743*y + 3.1183913579587682140554409344666)^(1/3)*(- 0.86602540378443864676372317075294*i - 0.5) + (1.6903200514749938066147015794976*i - 0.97590673673570975304842135661875)/(((5.8479532163742690058479532163743*y - 3.1183913579587682140554409344666)^2 - 7.4355814434024474123676612805896)^(1/2) - 5.8479532163742690058479532163743*y + 3.1183913579587682140554409344666)^(1/3)
0.09551656920077972709551656920078 + (((5.8479532163742690058479532163743*y - 3.1183913579587682140554409344666)^2 - 7.4355814434024474123676612805896)^(1/2) - 5.8479532163742690058479532163743*y + 3.1183913579587682140554409344666)^(1/3)*(0.86602540378443864676372317075294*i - 0.5) + (- 1.6903200514749938066147015794976*i - 0.97590673673570975304842135661875)/(((5.8479532163742690058479532163743*y - 3.1183913579587682140554409344666)^2 - 7.4355814434024474123676612805896)^(1/2) - 5.8479532163742690058479532163743*y + 3.1183913579587682140554409344666)^(1/3)
>> y=rand(1)
y =
0.8147
>> subs(x)
ans =
2.1596 - 0.0000i
0.6944 + 0.0000i
-2.5675 - 0.0000i
个人建议,先对原函数拟合,再就反函数。如何???????
用matlab工具箱进行拟合,可以得到,用指数函数拟合的结果:
General model Power2:
f(x) = a*x^b+c
Coefficients (with 95% confidence bounds):
a = -0.0833 (-0.08339, -0.08321)
b = 3.005 (3.005, 3.005)
c = 11.88 (10.34, 13.42)
Goodness of fit:
SSE: 1829
R-square: 1
Adjusted R-square: 1
RMSE: 4.342
可得到拟合函数为:
y=-0.0833*x^3.005 +11.88;
追问
谢谢你回答,能具体的再请教你一下用matlab工具箱怎么进行拟合,另外得到的
y=-0.0833*x^3.005 +11.88;代入程序运算也没有结果哦
追答
呵呵,如果你要求不高的话,其实y=-0.0833*x^3.005 +11.88中的x的次方可以直接减少为3次方,这样的话手工都可以求反函数的噢。
参考资料: 求
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询