solve: unable to find explicit solution

Hello there!
There is a set of equations that I have to solve. I had not received such a warning until yesterday, but when I was trying to solve this equatios I got this warning. I am aware that the number of unknowns is more than the number of meaningful equations, but I don't think it is the problem, as the assistant of course also produces solutions in this way. I think Matlab continues by valuing a variable here.
I tried turning the computer off and on and reinstalling matlab, but it didn't work.
The same code produces solutions without warning on my friend's computer. The code written by my friend and working on his computer does not work on my computer, it gives same warning. What could be the problem?
version: '9.6.0.1072779 (R2019a)'
Thanks a lot.
clc;clear;
syms s k zeta wn;
syms zero2 p1 positive;
Gss = 0.1789/(s^3 + 0.5000*s^2 + 0.1789*s);
Fss = k*(s + zero2);
Tss = Gss*Fss/(1+Fss*Gss);
pds = s^2 + 2*0.2*s + wn^2;
res = (s + p1);
[num,pcs] = numden(Tss);
pcs = coeffs(pcs,s,'all')
pcs = pcs/pcs(1)
prob = pcs == coeffs(pds*res,s,'all') ;
vpa(prob',4)
sol= solve(prob)
and my friends computer

8 Comments

Ameer Hamza
Ameer Hamza on 18 Apr 2020
Edited: Ameer Hamza on 18 Apr 2020
Is your friend using the same MATLAB release?
Yes he does. I also updated to be sure but it did not help. Matlab online also prints solutions without any warning. I am not sure what might have changed on my computer. Uninstall and reinstalling did not help either. I am confused.
Can you run the line
symengine
and show us the output.
you should add 'returnconditions', true to the solve options. The answer your friend gets is only sort of right. Your first equation is a truism so you have really three equation in four unknowns, and there are an infinite number of solutions for that. Using returnconditions will phrase the result in terms of a parameter, z, the conditions for which are positive and not equal to 1/10. What your friend is seeing is a representative solution, probably with z=1.
firstly, I installed 2020a and it works. Probably it was a version problem but still I am not sure.
I run symengine and tried after that but it gave warning again. @Ameer Hamza
I tried the code with returnconditions parameter before asked this question but it didnt work. I am aware that there are infinite solutions. Matlab gives one or two of them. 'returnconditions' is necessary for situations where solutions can be produced when unknowns fulfill a conditions.
Now, I can do what I was trying to do with the 2020a version. Thanks for your answers.
Ameer was asking you to show us the results of the expression
symengine
It is not a command intended to fix something, it is an output we need to see to diagnose the problem.
What result did you get when you use returnconditions?
I am sorry for the late reply.
When I run the 'symengine' command, result is "MuPAD symbolic engine".
Nothing changed, when I use returnconditions.
In addition, I use 2020a with no problem.
Thanks.
Okay, I am able to get the "no explicit solutions" response in R2019a on my system; by R2019b it gives a solution. Work-around:
prob2 = prob(~isAlways(prob, 'unknown','false'));
sol = solve(prob2, 'returnconditions',true);
This leads you to
>> sol.p1
ans =
x
>> sol.wn
ans =
z
>> sol.zero2
ans =
y
>> sol.conditions
ans =
([x, z, y] == matrix([[1/10], [-(1789*k + 1389)^(1/2)/100], [(1789*k + 1389)/(17890*k)]]) | ...
[x, z, y] == matrix([[1/10], [(1789*k + 1389)^(1/2)/100], [(1789*k + 1389)/(17890*k)]]) ) & ...
k ~= 0 & 0 < x & 0 < y
Which is to say that p1 is the set of values of x such that sol.conditions involving x is true, wn is the set of values of z such that sol.conditions involving z is true, and zero2 is the set of values of y such that sol.conditions involving y is true.
Reading off, we see the conditition that k is not 0... okay.
We see that 0 < x, but we see that the only possible values for x are 1/10, so that is satisfied.
We also see that 0 < y, and that in both cases, y = (1789*k + 1389)/(17890*k) . Now, in order for (1789*k + 1389)/(17890*k) to be comparable to 0, (1789*k + 1389)/(17890*k) must be real-valued, which can only happen if k is real-valued. We can then
syms k real
ysol = solve( 0 < (1789*k + 1389)/(17890*k), 'returnconditions', true);
ysol.conditions
ans =
x < -1389/1789
0 < x
So k must either be sufficiently negative or must be positive
syms k positive
sol1 = solve(prob2);
assume(k < -1389/1789);
sol2 = solve(prob2);
P1 = [sol1.p1; sol2.p1];
WN = [sol1.wn; sol2.wn];
ZERO2 = [sol1.zero2; sol2.zero2];
The two solutions sol1 and sol2 turn out to be the same.
If you need all of this automated, then that would be take more time to work out.

Sign in to comment.

Answers (0)

Products

Release

R2019a

Asked:

on 18 Apr 2020

Edited:

on 1 May 2020

Community Treasure Hunt

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

Start Hunting!