MATLAB Answers

## Simbolic Tbx: how to solve trigonometric equation with polynoms?

Asked by Igor

### Igor (view profile)

on 5 Apr 2011
Let
>> syms y z
>> syms x y z
>> y=sym('- 9*x^4 + 7*x^3 - 13*x^2 + 3*x');z=sym('(1+x)^3');
Working
>> solve(subs('z*y-1=0'))
Working (although one root)
>> solve(subs('sin(z)=0'))
NOT Working
>> solve(subs('sin(y*z-1)=0'))
ans =
solvelib::Union(RootOf(X458^7 + (20*X458^6)/9 +...
How to solve eq. (within Simbolic Tbx)? Even one root...

#### 0 Comments

Sign in to comment.

## 1 Answer ### Walter Roberson (view profile)

Answer by Walter Roberson

### Walter Roberson (view profile)

on 6 Apr 2011

The Union is the result, in symbolic form. A Union is a "set" (in mathematical terms). RootOf() of higher order polynomials are not taken unless specifically requested, partly because usually they can only be numerically approximated.
What I suggest is that you use vpa() or double() on the returned answer.

Igor

### Igor (view profile)

on 7 Apr 2011
>> format compact
>> res=solve(subs('sin(y*z-1)=0'))
res =
solvelib::Union(RootOf(X38^7 + (20*X38^6)/9 + ...), X34, Z_)
>> double(res)
??? Error using ==> mupadmex
Error in MuPAD command: DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use the VPA function instead.
Error in ==> sym.sym>sym.double at 927
Xstr = mupadmex('mllib::double', S.s, 0);
>> vpa(res)
ans =
solvelib::Union(RootOf(X42^7 + (20*X42^6)/9 + ...
Igor

### Igor (view profile)

on 7 Apr 2011
you see -- no motion further the answer Rootof()
Walter Roberson

### Walter Roberson (view profile)

on 7 Apr 2011
Checking the documentation, http://www.mathworks.com/help/toolbox/mupad/solvelib/Union.html it appears to me that there is a family of solutions in a free parameter that is an integer. If you want one particular solution, evaluate res with something (e.g., 0) substituted for Z_ and then double() that to get a numeric value.

Sign in to comment.