Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Symbolic Mathematics quesetion

Subject: Symbolic Mathematics quesetion

From: xiao

Date: 23 Mar, 2009 05:53:01

Message: 1 of 7

t1=1/(h^3*(1-n)^3*k-6*u*c);
t2=1/(h^3*(1+n)^3*k-6*u*c);
t3=1/(h^3*(1-sqrt(3)/2*n)^3*k-6*u*c);
t4=1/(h^3*(1+sqrt(3)/2*n)^3*k-6*u*c);
t5=1/(h^3*(1-0.5*n)^3*k-6*u*c);
t6=1/(h^3*(1+0.5*n)^3*k-6*u*c);
t=t1-t2+t5-t6+3^(1/2)*(t3-t4);
g=m/6/a/r/q/u;
my equation is 'g=t' .what i want is use a equation to express n.
how can i do it ?

Subject: Symbolic Mathematics quesetion

From: Roger Stafford

Date: 23 Mar, 2009 06:46:02

Message: 2 of 7

"xiao " <binghuoxueyan@126.com> wrote in message <gq783t$kem$1@fred.mathworks.com>...
> t1=1/(h^3*(1-n)^3*k-6*u*c);
> t2=1/(h^3*(1+n)^3*k-6*u*c);
> t3=1/(h^3*(1-sqrt(3)/2*n)^3*k-6*u*c);
> t4=1/(h^3*(1+sqrt(3)/2*n)^3*k-6*u*c);
> t5=1/(h^3*(1-0.5*n)^3*k-6*u*c);
> t6=1/(h^3*(1+0.5*n)^3*k-6*u*c);
> t=t1-t2+t5-t6+3^(1/2)*(t3-t4);
> g=m/6/a/r/q/u;
> my equation is 'g=t' .what i want is use a equation to express n.
> how can i do it ?

  Xiao, I very seriously doubt if it is possible to obtain a closed expression for the solution you seek. With appropriate manipulation you will find that your equation can be put in the form of a highly complicated polynomial equation in n of the eighteenth order. However it has been mathematically proved that fourth order polynomials are the highest order for which explicit solutions can be found for general polyomials.

  If you were to use the 'solve' function of the Symbolic Toolbox, the very best I think you could hope for would be general expressions for the nineteen coefficients of this eighteenth order polynomial equation. At this point, for each specific set of parameter values, you could numerically evaluate these coefficients and call on matlab's 'roots' function to give the polynomial's corresponding roots. Even so you face the problem of deciding which among the eighteen possible roots you wish to use.

Roger Stafford

Subject: Symbolic Mathematics quesetion

From: xiao

Date: 23 Mar, 2009 07:02:46

Message: 3 of 7

yes
what i get is 'Unable to find closed form solution'.
is that show i can get the ans ? what should i do ?

Subject: Symbolic Mathematics quesetion

From: John D'Errico

Date: 23 Mar, 2009 07:42:01

Message: 4 of 7

"xiao " <binghuoxueyan@126.com> wrote in message <gq7c6m$3fj$1@fred.mathworks.com>...
> yes
> what i get is 'Unable to find closed form solution'.
> is that show i can get the ans ? what should i do ?

Roger explained very clearly why you cannot solve
this problem. There is NO solution, at least unless
something very lucky happens. For example, if h=0
or if k=0, then you can pick absolutely any value
you would like for n.

There are things in this world that we want to do.
Merely wanting to do something does not make it
possible. This is one of the impossible things, even
provably impossible.

If you can provide explicit numeric values for each
of the other variables and substitute them into the
expressions, then you could compute the numerical
roots of the resulting polynomial expression. Even
then there might possibly be numerical difficulties,
since resolving all 18 of the roots may be difficult
to do with full precision.

john

Subject: Symbolic Mathematics quesetion

From: Roger Stafford

Date: 23 Mar, 2009 08:38:01

Message: 5 of 7

"xiao " <binghuoxueyan@126.com> wrote in message <gq7c6m$3fj$1@fred.mathworks.com>...
> yes
> what i get is 'Unable to find closed form solution'.
> is that show i can get the ans ? what should i do ?

  This doesn't surprise me, Xiao. You have a quite complicated equation. You can possibly help 'solve' by condensing some of your numerous parameters into only two parameters, perhaps something like this:

 t1=1/((1-n)^3-K1);
 t2=1/((1+n)^3-K1);
 t3=1/((1-sqrt(3)/2*n)^3-K1);
 t4=1/((1+sqrt(3)/2*n)^3-K1);
 t5=1/((1-0.5*n)^3-K1);
 t6=1/((1+0.5*n)^3-K1);
 t=t1-t2+t5-t6+3^(1/2)*(t3-t4);

with the equation being t = K2, and where it is understood that

 K1 = 6*u*c/(h^3*k)
 K2 = h^3*k*m/6/a/r/q/u

Don't hand the original parameters to 'solve', but use only K1 and K2. That way you can cut down the lengths of the various strings 'solve' has to deal with and this could conceivably permit it to arrive at a solution before getting discouraged, though only in terms of the roots to an eighteenth order polynomial. (I suspect the odds are against 'solve' achieving even this much, though.)

  It is possible to use the Symbolic Toolbox simplification functions to obtain the desired polynomial yourself if you are willing to devote enough work to the task. If you were to form the symbolic expression for t-K2 above and then multiply it symbolically by all six denominators, this would clear all denominators and give you a complicated polynomial expression in n which is to be equated to zero. Using the 'coeffs', 'expand', 'collect', 'simplify', and 'simple' functions, you could eventually obtain expressions for each of the nineteen coefficients of powers of n for this polynomial. These expressions could be very long, but it would be very helpful if this were all done in terms of K1 and K2 rather than the original parameters.

  Once you have expressions for each of the coefficients, you can define a function whose inputs are your parameters and which then evaluates all these coefficients numerically using the above expressions. The function then would call on 'roots' to obtain all eighteen roots. You will of course need to decide which of these eighteen you want to use. No-one else can help you with that.

  The only other suggestion I have is to use iterative methods in matlab's 'fzero' function or the 'fsolve' function in the Optimization Toolbox for specific parameter values. Each call on one of these would need an initial estimate given to it to allow the iteration to converge on the correct solution among the many that are possible.

Roger Stafford

Subject: Symbolic Mathematics quesetion

From: xiao

Date: 23 Mar, 2009 10:57:01

Message: 6 of 7

thank you !

Subject: Symbolic Mathematics quesetion

From: Walter Roberson

Date: 23 Mar, 2009 18:51:20

Message: 7 of 7

xiao wrote:
> yes
> what i get is 'Unable to find closed form solution'.
> is that show i can get the ans ? what should i do ?

RootOf(27*_Z^18*k^6*m-513*_Z^16*h^2*k^6*m-4096*h^18*k^6*m+3780*_Z^15*r*a*k^5*u
*q-756*_Z^13*r*a*h^2*k^5*u*q+147456*h^15*k^5*u*c*m-2211840*h^12*k^4*u^2*c^2*m+
17694720*h^9*k^3*u^3*c^3*m-79626240*h^6*k^2*u^4*c^4*m+191102976*h^3*k*u^5*c^5*
m+(4113*h^4*k^6*m+18252*h*k^5*u*c*m)*_Z^14-191102976*u^6*c^6*m+(-18235*h^6*k^6
*m-128508*h^3*k^5*u*c*m-65484*k^4*u^2*c^2*m)*_Z^12+(-124416*r*a*h^4*k^5*u*q+
995328*r*a*h*k^4*u^2*c*q)*_Z^11+(49344*h^8*k^6*m+403200*h^5*k^5*u*c*m+2102976*
h^2*k^4*u^2*c^2*m)*_Z^10+(634176*r*a*h^6*k^5*u*q+3151872*r*a*h^3*k^4*u^2*c*q-
3110400*r*a*k^3*u^3*c^2*q)*_Z^9+(-84912*h^10*k^6*m-703296*h^7*k^5*u*c*m-
4784832*h^4*k^4*u^2*c^2*m-8252928*h*k^3*u^3*c^3*m)*_Z^8+(-1589760*r*a*h^8*k^5*
u*q-13768704*r*a*h^5*k^4*u^2*c*q+32348160*r*a*h^2*k^3*u^3*c^2*q)*_Z^7+(93440*h
^12*k^6*m+605184*h^9*k^5*u*c*m+3013632*h^6*k^4*u^2*c^2*m+59609088*h^3*k^3*u^3*
c^3*m+7630848*k^2*u^4*c^4*m)*_Z^6+(2184192*r*a*h^10*k^5*u*q+13934592*r*a*h^7*k
^4*u^2*c*q+268738560*r*a*h^4*k^3*u^3*c^2*q-167215104*r*a*h*k^2*u^4*c^3*q)*_Z^5
+(-63744*h^14*k^6*m-46080*h^11*k^5*u*c*m+414720*h^8*k^4*u^2*c^2*m+55074816*h^5
*k^3*u^3*c^3*m-252813312*h^2*k^2*u^4*c^4*m)*_Z^4+(-1548288*r*a*h^12*k^5*u*q-
2654208*r*a*h^9*k^4*u^2*c*q+203046912*r*a*h^6*k^3*u^3*c^2*q-812187648*r*a*h^3*
k^2*u^4*c^3*q+143327232*r*a*k*u^5*c^4*q)*_Z^3+(24576*h^16*k^6*m-294912*h^13*k^
5*u*c*m-1769472*h^10*k^4*u^2*c^2*m+42467328*h^7*k^3*u^3*c^3*m-222953472*h^4*k^
2*u^4*c^4*m+382205952*h*k*u^5*c^5*m)*_Z^2+(442368*r*a*h^14*k^5*u*q-10616832*r*
a*h^11*k^4*u^2*c*q+95551488*r*a*h^8*k^3*u^3*c^2*q-382205952*r*a*h^5*k^2*u^4*c^
3*q+573308928*r*a*h^2*k*u^5*c^4*q)*_Z,label = _L1)/h


In this notation, _Z is a dummy variable representing a zero of the equation
(that is, if you put in the right _Z then the equation would become 0).
But as you can see, it is an 18th order polynomial.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us