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

  • Thread starter Thread starter ColdFusion85
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
7 replies · 2K views
ColdFusion85
Messages
141
Reaction score
0
I need to use a program to numerically solve the following equation:

[tex]exp(-2.222)=\frac{(\frac{2x}{2+2x})^2(\frac{x}{2+2x})}{(\frac{2-x}{2+2x})^2}[/tex]

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
First, simplify the expression. Then reformulate it in the form [itex]f(x)=0[/itex].

You now have something amenable to the zero finding functions.

[itex]x=2[/itex] and [itex]x=-1[/itex] are obviously problematic. You want to find a pair of [itex]x[/itex] values [itex]x_1[/itex] and [itex]x_2[/itex] such that neither of the poles is between [itex]x_1[/itex] and [itex]x_2[/itex] and such that [itex]f(x_1)[/itex] and [itex]f(x_2)[/itex] 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 [itex]p(x)/q(x)-c=0[/itex] where [itex]p(x)[/itex]is cubic and [itex]q(x)[/itex] is quadratic. Multiplying by [itex]q(x)[/itex] yields [itex]p(x)-cq(x)=0[/itex], a cubic.
 
Last edited:
For the RHS I expanded everything out and got this:

[tex]\frac{4x^3(4x^2+8x+4)}{(8x^3+24x^2+24x+8)(x^2-4x+4)}[/tex]

Is this correct?
 
Oh, ok so one gets:

[tex]\frac{4x^3}{(2-x)^2(2+2x)}[/tex]?