Can this equation be numerically solved using online resources or Matlab code?

  • Thread starter Thread starter ColdFusion85
  • Start date Start date
ColdFusion85
Messages
141
Reaction score
0
I need to use a program to numerically solve the following equation:

exp(-2.222)=\frac{(\frac{2x}{2+2x})^2(\frac{x}{2+2x})}{(\frac{2-x}{2+2x})^2}

I tried using Matlab to solve it but I kept on getting an error message. I'm not a programmer or familiar with these numerical solvers at all. Is there some place online I can solve this equation, or can someone post the Matlab code to solve it? The code is not part of the homework, but I arrived at the above equation and need to solve it in order to finalize my answer, so if anyone could help me solve it that would be great. Thanks.
 
Physics news on Phys.org
Well, you can simplify the right-hand side quite a bit. Ultimately you can turn it into a cubic equation for x.
 
First, simplify the expression. Then reformulate it in the form f(x)=0.

You now have something amenable to the zero finding functions.

x=2 and x=-1 are obviously problematic. You want to find a pair of x values x_1 and x_2 such that neither of the poles is between x_1 and x_2 and such that f(x_1) and f(x_2) have opposite signs. There is a zero between these points.
 
Last edited:
Avodyne said:
Well, you can simplify the right-hand side quite a bit. Ultimately you can turn it into a cubic equation for x.

Not quite that much. You get a rational polynomial, a simple cubic divided by a quadratic.

EDIT: I worked to much today.

Ultimately, you're right. Simplifying the RHS leads to p(x)/q(x)-c=0 where p(x)is cubic and q(x) is quadratic. Multiplying by q(x) yields p(x)-cq(x)=0, a cubic.
 
Last edited:
For the RHS I expanded everything out and got this:

\frac{4x^3(4x^2+8x+4)}{(8x^3+24x^2+24x+8)(x^2-4x+4)}

Is this correct?
 
Don't expand! Get rid of the common factor instead. Look at the numerator and denominator.
 
Oh, ok so one gets:

\frac{4x^3}{(2-x)^2(2+2x)}?
 
Yes. You can also get rid of a factor of two. And oops, I said cubic/quadratic. What you have is a ratio of two cubics, which is correct. Now multiply through by the denominator to get a cubic equation (valid so long as x is not 2 or -1).
 
Back
Top