4

I am trying to find the unique solution to the following equation using Matlab

               norm(a,2)=0.11

when x is a variable and a=[x abs(1/x);x+1 1/x]. b is the exact formulation of norm(a,2), which I have gained:

syms x
a=[x abs(1/x);x+1 1/x];
b = norm(a,2)

b = max(abs(2*x + x*abs(x)^2 + 2*x*abs(x)^4 + abs(x)^4 + x^2*abs(x)^2 - (4*x*abs(x)^5 + 2*x*abs(x)^6 + 4*x*abs(x)^8 + abs(x)^8 + 8*x^2*abs(x)^3 + x^2*abs(x)^4 + 4*x^3*abs(x)^3 + 2*x^3*abs(x)^4 + 6*x^2*abs(x)^6 + x^4*abs(x)^4 + 4*x^3*abs(x)^6 + 4*x^2*abs(x)^8 + 4*x^2)^(1/2))/(2*abs(x)^3), abs(2*x + x*abs(x)^2 + 2*x*abs(x)^4 + abs(x)^4 + x^2*abs(x)^2 + (4*x*abs(x)^5 + 2*x*abs(x)^6 + 4*x*abs(x)^8 + abs(x)^8 + 8*x^2*abs(x)^3 + x^2*abs(x)^4 + 4*x^3*abs(x)^3 + 2*x^3*abs(x)^4 + 6*x^2*abs(x)^6 + x^4*abs(x)^4 + 4*x^3*abs(x)^6 + 4*x^2*abs(x)^8 + 4*x^2)^(1/2))/(2*abs(x)^3))^(1/2)

I have tried solve() and the following is the result:

solve(b==0.11,x) 
Warning: Cannot find explicit solution.

ans = Empty sym: 0-by-1

Any help regarding the suitable method to solve the above equation will be appreciated.

obchardon
  • 10,614
  • 1
  • 17
  • 33
eli
  • 87
  • 5

1 Answers1

2

As far as I know

norm(a) = max(svd(a))

max is a problem in this equation, that's why I would find and solve symbolic equations for the both svd results separately:

syms x
a=[x abs(1/x);x+1 1/x];

s = svd(a);

% svd 1
solve(s(1)==0.11,x) 

% svd 2
solve(s(2)==0.11,x)

Return value for svd 1:

Warning: Cannot solve symbolically. Returning a numeric approximation instead. 

ans = -12.84595601211006224344551434882

Return value for svd 2:

Warning: Cannot find explicit solution. 

ans = Empty sym: 0-by-1

So the answer would be

ans = -12.84595601211006224344551434882

If we had a solution for each svd part, we could find max() of them.

Here is a plot of both svd functions:

enter image description here

UPDATE

As we could see above, the solver switched to the numerical solver and found only one solution, although the plot shows us at least two possible solutions.

To find all solution (there can be actually more then two) I would directly use the numerical solver vpasolve and either input an initial guess or let the solver found solutions randomly:

vpasolve(s(1)==0.11,x,2) % input initial guess as 2

It returns the second solution:

ans = 2.2626424161863046178372248086765

Or use the random guess:

for n = 1:10 
    vpasolve(s(1)==0.11,x,'Random',true) % use random guess
end

It returns all found solution:

ans = -12.84595601211006224344551434882 
ans = -12.84595601211006224344551434882 
ans = -12.84595601211006224344551434882
ans = -12.84595601211006224344551434882 
ans = 2.2626424161863046178372248086765 %!!!
ans = -12.84595601211006224344551434882
ans = -12.84595601211006224344551434882
ans = -12.84595601211006224344551434882
ans = -12.84595601211006224344551434882
ans = -12.84595601211006224344551434882
Anton
  • 4,544
  • 2
  • 25
  • 31