用matlab编程求出y=-0.0855*x^3+0.0245*x^2+0.4983*x+0.4855 的的反函数,并y等于(0,1)的随机数时x的值
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/21 01:56:56
用matlab编程求出y=-0.0855*x^3+0.0245*x^2+0.4983*x+0.4855 的的反函数,并y等于(0,1)的随机数时x的值
用matlab编程求出y=-0.0855*x^3+0.0245*x^2+0.4983*x+0.4855 的的反函数,并y等于(0,1)的随机数时x的值
用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;