Asked by Jennifer
on 7 Dec 2012

Below is my Matlab code that I entered, and the response I got.

>> clear >> syms x a >> Func=(.45*cos(x/a)/((sin(x/a))^6))*(5/8*(1-cos(x/a))-(5/48*(1-cos(3*x/a)))+(1/80*(1-cos(5*x/a))))+.09 >>solve(Func,x) ans = -a*(2*pi*k + i*log(z))

What in the world are k and z? When I input k I receive an error saying Undefined, z... undefined.

Please help.

Thank you,

Jennifer

*No products are associated with this question.*

Answer by Roger Stafford
on 8 Dec 2012

The expression in your 'Func' is identically equal to

3/100*(6*cos(x/a)^3+18*cos(x/a)^2+17*cos(x/a)+3)/(1+cos(x/a))^3

and therefore c = cos(x/a) is one of the three roots of the cubic equation

6*c^3+18*c^2+17*c+3 = 0.

This gives the six roots of a*acos(c) and -a*acos(c):

a*( 2.6773079709553582 - 1.0064927801893431*i) a*( 2.6773079709553582 + 1.0064927801893431*i) a*( 1.7996177555153143) a*(-2.6773079709553582 + 1.0064927801893431*i) a*(-2.6773079709553582 - 1.0064927801893431*i) a*(-1.7996177555153143)

plus any integral multiple of 2*pi*a.

I have no idea what the z represents in the solution you describe.

Roger Stafford

Answer by Matt Fig
on 7 Dec 2012

Edited by Matt Fig
on 7 Dec 2012

k is a integer constant: Any integer k gives another solution. This is common with periodic functions. z is probably any complex number, but I am guessing here as I do not get this same solution.

Something doesn't look right about that solution. What version of MATLAB are you using?

Answer by Walter Roberson
on 7 Dec 2012

The "k" probably stands for "an arbitrary integer", but the log(z) has no *obvious* purpose there, not unless a RootOf() showed up somewhere and you for some reason edited it out.

If we convert the 0.45 and 0.09 to rational values, one version of the analytic solutions are:

(arctan((1/2)*((36+2*322^(1/2))^(2/3)*(24*322^(1/2)-4*(36+2*322^(1/2))^(2/3)-(36+2*322^(1/2))^(4/3)+428+24*(36+2*322^(1/2))^(1/3)))^(1/2)*(36+2*322^(1/2))^(1/3)/(((36+2*322^(1/2))^(1/3)+2/(36+2*322^(1/2))^(1/3)-6)*(18+322^(1/2))))+2*pi*Z+pi)*a

-a*(arctan((1/2)*((36+2*322^(1/2))^(2/3)*(24*322^(1/2)-4*(36+2*322^(1/2))^(2/3)-(36+2*322^(1/2))^(4/3)+428+24*(36+2*322^(1/2))^(1/3)))^(1/2)*(36+2*322^(1/2))^(1/3)/(((36+2*322^(1/2))^(1/3)+2/(36+2*322^(1/2))^(1/3)-6)*(18+322^(1/2))))+pi*(-2*Z+1))

(arctan(2^(1/2)*((36+2*322^(1/2))^2*(1+i*3^(1/2))-(36+2*322^(1/2))^(2/3)*(24*322^(1/2)+8*(36+2*322^(1/2))^(2/3)+428-(24*i)*966^(1/2)+24*(36+2*322^(1/2))^(1/3)-(428*i)*3^(1/2)+(24*i)*(36+2*322^(1/2))^(1/3)*3^(1/2)))^(1/2)*(36+2*322^(1/2))^(1/3)/(432+24*322^(1/2)), (1/12)*(-1+i*3^(1/2))*(36+2*322^(1/2))^(1/3)-((1/6)*i)*3^(1/2)/(36+2*322^(1/2))^(1/3)-(1/6)/(36+2*322^(1/2))^(1/3)-1)+2*pi*Z)*a

(arctan(-2^(1/2)*((36+2*322^(1/2))^2*(1+i*3^(1/2))-(36+2*322^(1/2))^(2/3)*(24*322^(1/2)+8*(36+2*322^(1/2))^(2/3)+428-(24*i)*966^(1/2)+24*(36+2*322^(1/2))^(1/3)-(428*i)*3^(1/2)+(24*i)*(36+2*322^(1/2))^(1/3)*3^(1/2)))^(1/2)*(36+2*322^(1/2))^(1/3)/(432+24*322^(1/2)), (1/12)*(-1+i*3^(1/2))*(36+2*322^(1/2))^(1/3)-((1/6)*i)*3^(1/2)/(36+2*322^(1/2))^(1/3)-(1/6)/(36+2*322^(1/2))^(1/3)-1)+2*pi*Z)*a

(arctan((-2*(36+2*322^(1/2))^2*(-1+i*3^(1/2))+2*(36+2*322^(1/2))^(2/3)*(-24*322^(1/2)-8*(36+2*322^(1/2))^(2/3)-428-(24*i)*966^(1/2)-24*(36+2*322^(1/2))^(1/3)-(428*i)*3^(1/2)+(24*i)*(36+2*322^(1/2))^(1/3)*3^(1/2)))^(1/2)*(36+2*322^(1/2))^(1/3)/(432+24*322^(1/2)), (1/12)*(-1-i*3^(1/2))*(36+2*322^(1/2))^(1/3)+((1/6)*i)*3^(1/2)/(36+2*322^(1/2))^(1/3)-(1/6)/(36+2*322^(1/2))^(1/3)-1)+2*pi*Z)*a

(arctan(-(-2*(36+2*322^(1/2))^2*(-1+i*3^(1/2))+2*(36+2*322^(1/2))^(2/3)*(-24*322^(1/2)-8*(36+2*322^(1/2))^(2/3)-428-(24*i)*966^(1/2)-24*(36+2*322^(1/2))^(1/3)-(428*i)*3^(1/2)+(24*i)*(36+2*322^(1/2))^(1/3)*3^(1/2)))^(1/2)*(36+2*322^(1/2))^(1/3)/(432+24*322^(1/2)), (1/12)*(-1-i*3^(1/2))*(36+2*322^(1/2))^(1/3)+((1/6)*i)*3^(1/2)/(36+2*322^(1/2))^(1/3)-(1/6)/(36+2*322^(1/2))^(1/3)-1)+2*pi*Z)*a

In the above, Z stands for any arbitrary integer (including 0 and negative values)

Each of these analytic solutions can be converted from arctan() form to ln() form because arctan(a,b) = -i*ln((b+i*a)/(b^2+a^2)^(1/2))

So *possibly* what you are seeing is the Symbolic Toolbox answering in ln form, and trying to present the information more compactly... but forgetting to print out the full information. That sometimes happens because of the communications between the MuPAD engine and MATLAB.

bym
on 8 Dec 2012

vpa(ans)

ans =

1.7996177555153143754981447772652*a (-1.7996177555153143754981447772652)*a a*(1.0064927801893429956269684627402*i + 2.6773079709553580625862294378728) -a*(1.0064927801893429956269684627402*i - 2.6773079709553580625862294378728) -a*(1.0064927801893429956269684627402*i + 2.6773079709553580625862294378728) a*(1.0064927801893429956269684627402*i - 2.6773079709553580625862294378728)

Walter Roberson
on 8 Dec 2012

Matt, when you solve() a expression that has floating point values, using Symbolic Toolbox, then the first thing it does is convert the floating point values to rationals. (This does not apply to sym() constructed with the decimal flag.) The Maple equivalent is to convert(expression,rational) . If you do not do that in Maple, you get "floating point pollution" (that is, at each stage, rationals and floating point are automatically combined to give floating point values with only Digits working precision.)

The "k" in the MuPAD output suggested that it was trying to give the generalized output. The Maple form of that is to solve() with AllSolutions as an option.

The large output I gave was Maple, converting each of the two floating point values to rational, and solving with AllSolutions; but then afterwards I edited to MuPAD output form (e.g., Pi -> pi, I -> i, _Z1 -> Z)

Opportunities for recent engineering grads.

## 0 Comments