Solving an inequality in Matlab
2 次查看(过去 30 天)
显示 更早的评论
Hello!
I need to solve a quartic inequality. However, it is impossible to do it by hand and therefore I would like to use Matlab. The inequality is: q(a,b) < s sqrt(v)
where s and v are known, b = 1.08148*a^2-eps and eps = 10^(-6). Now, q(a,b) is the greatest real root (which should exist) of the quartic polynomial: (48*a^2+16*b)x^4 - (40*a^3+168*a*b)x^3 + (-45*a^4+225*a^2*b+72*b^2)*x^2+(27*a^3*b-162*a*b)*x+27*b^3
The function a = (x-3)*sqrt(v)/s. I need to solve the inequality for x. To that end, I did the following:
syms x z
av = ((x-3)*sqrt(v))/s;
Q = max(roots([48*z^2+16*(1.08148*z-eps), -40*z^3-168*z*(1.08148*z-eps), -45*z^4+225*z^2*(1.08148*z-eps)+72*(1.08148*z-eps)^2, 27*z^3*(1.08148*z-eps)-162*z*(1.08148*z-eps)^2, 27*(1.08148*z-eps)^3]));
F = compose(Q,av);
solve(F-skew*sqrt(var)<0, x)
However, that does not really work. Matlab gives the following error
Error using sym/max (line 97)
Input arguments must be convertible
to floating-point numbers.
Error in Testt (line 13)
Q =
max(roots([48*z^2+16*(1.08148*z-eps),
-40*z^3-168*z*(1.08148*z-eps),
-45*z^4+225*z^2*(1.08148*z-eps)+72*(1.08148*z-eps)^2,
27*z^3*(1.08148*z-eps)-162*z*(1.08148*z-eps)^2,
27*(1.08148*z-eps)^3]));
Is there perhaps an easier way? The best way would be to not work with the roots function and to use an explicit expression for the root. However, an explicit expression for the root of the quartic is horrendous.
Thanks in advance! Cheers
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!