solve doenst fint an explicit solution to a simple inequality

2 次查看(过去 30 天)
Hey guys,
I have a problem with solving a inequality
syms z1 real
sol = solve(2 < 3*z1 + (4 - 3*z1^2)^(1/2))
When I try this, than I get the Warning:
Warning: Unable to find explicit solution. For options, see help.
How can I get the solution z1>0 and z1<root(4/3) since z1 needs to be between -root(4/3) and root(4/3). Is there an other function I can use for that? Would be nice to have a symbolic solution.
Is there a way to check the values of a variable depending on z1 with 2 < 3*z1 + (4 - 3*z1^2)^(1/2) itself? Can i plug it in somehow?
I need to check if lambda=(3*z1^2 - 3*z1 + 1)/(z1*(3*z1 - 2)) is between 0 and 1 or sharpen the condition to z1 so lambda is between thos values.

回答(2 个)

Ruchika
Ruchika 2023-8-16
Hi, it seems that the inequality you provided does not have an explicit solution that can be obtained symbolically. Therefore, the solve function may not be able to find the solution.
In such cases, you can use numerical methods to approximate the solution. One approach is to use the fzero function to find the root of a function numerically. Here's an example of how you can apply it to your inequality:
syms z1 real
% Define the function to find the root of
f = @(z1) 2 - (3*z1 + (4 - 3*z1^2)^(1/2));
% Find the root numerically
z1 = fzero(f, [0 sqrt(4/3)]);
In this code, the function f represents the inequality 2 < 3*z1 + (4 - 3*z1^2)^(1/2). The fzero function is then used to find the value of z1 that satisfies this inequality within the specified range [0 sqrt(4/3)].
However, since the expression for lambda involves division by z1, which can be zero in this case, it is not possible to evaluate lambda for the obtained z1 value. We can try to plot this inequality with the following code :
syms z1 real
% Define the function to plot
f = 3*z1 + (4 - 3*z1^2)^(1/2);
% Plot the function
fplot(f, [-sqrt(4/3) sqrt(4/3)], 'LineWidth', 2);
hold on;
% Plot the horizontal line y = 2
yline(2, 'r--', 'LineWidth', 2);
% Set plot properties
title('Plot of 2 < 3*z1 + (4 - 3*z1^2)^(1/2)');
xlabel('z1');
ylabel('f(z1)');
legend('3*z1 + (4 - 3*z1^2)^(1/2)', 'y = 2');
grid on;

Walter Roberson
Walter Roberson 2023-8-16
How can I get the solution z1>0 and z1<root(4/3) since z1 needs to be between -root(4/3) and root(4/3). Is there an other function I can use for that?
As previously discussed with you, the Symbolic Engine is weak on inequalities, and weak on assumptions. If you cannot get the answer you need by turning the inequality into an equality, then the Symbolic Engine cannot handle it and there is no other function that can be used.
I also specifically discussed with you that adding assumptions of "real" can prevent the Symbolic Engine from using rules that it might otherwise use and by so doing deduce that the solution is real-valued. There is nothing you can do about the situation, short of reprogramming the deduction engine in the Symbolic Engine.

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by