how can i solve when two symbolic polynomials are equal with 3 vaiable.

3 views (last 30 days)
suppose that we have two equation
3*k1 + 3*k2 + (3*s)/2 - 2*k1*k2 + 2*k1*s + s^2 - 1==s^2
i want to see on what k1 & k2 this equation is valid. i have test this code but that introduve third variable called z.please help. syms k1 k2 s;
[k1 k2]=solve('3*k1 + 3*k2 + (3*s)/2 - 2*k1*k2 + 2*k1*s + s^2 - 1==s^2',k1,k2)

Accepted Answer

John D'Errico
John D'Errico on 27 Apr 2014
Edited: John D'Errico on 27 Apr 2014
You DON'T have TWO equations. There is only one you have written.
Given two variables and one equation, there will generally be an infinite set of solutions, a curve in the (k1,k2) plane. Since s is symbolic, the shape of that curve will be a function of s. As it turns out, this is a trivial problem, doable with paper and pencil.
First, note that the s^2 term goes away here. So the problem reduces to:
3*k1 + 3*k2 + (3*s)/2 - 2*k1*k2 + 2*k1*s - 1 = 0
Factor out k1 from the terms it appears in and isolate k1 on the left hand side.
k1*(3 - 2*k2 + 2*s) = 1 - 3*k2 - 3*s/2
So as long as we do not have
3 - 2*k2 + 2*s = 0
then we can solve for k1 as a function of k2 and s. If that denominator is zero, then we have a divide by zero, so a singularity of some sort.
k1 = (1 - 3*k2 - 3*s/2)/(3 - 2*k2 + 2*s)
You state that you KNOW a solution. I am sorry, but you do not know a solution, except for a specific value of s!
Lets see what happens when k2 = 13/18.
k1 = @(k2) (1 - 3*k2 - 3*s/2)/(3 - 2*k2 + 2*s);
syms s
k1(13/18)
ans =
-((3*s)/2 + 7/6)/(2*s + 14/9)
See that we get a function of s still. If s = 0, then indeed we get your answer.
subs(k1(13/18),s,0)
ans =
-3/4
The solution is as I said, a 1-manifold in the (k1,k2) plane, that is parameterized in its shape by s. If you want to put a name on the general curve, I think hyperbola would apply. Since you seem to think that s=0, here is the solution locus for that value.
ezplot(subs(k1,s,0))
grid on
ylabel k_1
Finally, the point where we saw a divide by zero corresponds to a singularity, thus the location of the asymptote (again, it is a function of s.)
  3 Comments
John D'Errico
John D'Errico on 3 May 2014
Edited: John D'Errico on 3 May 2014
Sigh. You clearly did not read my answer. Or perhaps you did not bother to think about what I said. I VERY MUCH understand the problem.
What do you think the relation is that I derived for k1, as a function of k2 and s?
Think of it like this. You don't have TWO equations. An equation relates two sides of an equality. So you have one equation. Now, what is on the right hand side of an equation can be moved to the left hand side. I learned that a new technique called subtraction helps here. Once you do that, you now clearly have a single equation, equal to zero. We can work with that to derive the relation you asked for. As I point out, here the s^2 terms drop out, although that is not terribly important, just making the expressions slightly shorter to write.
Finally, I show how to derive the relationship you asked for. The relationship sums up the "conditions" you seem to want so desperately. Read the answer I posted. Think about it.
If you will insist on solving it with MATLAB because pencil and paper is too much effort, then you should get the same answer I gave above.
syms k2 s k1
k1 = solve('3*k1 + 3*k2 + (3*s)/2 - 2*k1*k2 + 2*k1*s + s^2 - 1==s^2',k1)
k1 =
-(6*k2 + 3*s - 2)/(4*s - 4*k2 + 6)

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!