Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Taking long time to solve two equations
Replies: 1   Last Post: Aug 9, 2013 5:31 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nasser Abbasi

Posts: 5,686
Registered: 2/7/05
Re: Taking long time to solve two equations
Posted: Aug 9, 2013 5:31 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 8/9/2013 3:41 AM, kalpana wrote:
> I have to solve two equations. For this, i have taken the equations as the following :
> Syms x y eq1 eq2;
> eq1 = x^7 + 42.215449*x^6*y + 287.89234 *x^6 + 596.846934 * x^5*y^2 + 8742*x^5*y +
>28324*x^5 + 2043*x^4*y^3 + 43094*x^4*y^2 + 266735*x^4*y + 498519*x^4 + 288.63823*x^3*y^4 +
> 33339*x^3*y^3 + 520794*x^3*y^2 + 2476074*x^3*y + 3223591*x^3 - 208.79156*x^2*y^5 + 6073*x^2*y^4
> + 234014*x^2*y^3 + 2220025*x^2*y^2 + 7793982*x^2*y + 8129372*x^2 - 52.07952*x*y^6 +
> 104.05264*x*y^5 + 35721*x*y^4 + 555238*x*y^3 + 3446089*x*y^2 + 9208694*x*y +
>8083970*x - 3.07772*y^7 - 21.7637*y^6 + 1870*y^5 + 42024*y^4 + 374588*y^3 + 1636383*y^2 +
>3381409*y + 2510676 ;
> eq2 = x^7 + 42.35951*x^6*y + 249.65506*x^6 + 384.45864*x^5*y^2 + 3593*x^5*y + 6262*x^5 +
> 820.0502*x^4*y^3 + 11020*x^4*y^2 + 42458*x^4*y + 42460*x^4 - 190.762*x^3*y^4 + 323.880*x^3*y^3 +
>12187*x^3*y^2 - 14416*x^3*y - 53002*x^3 - 273.565*x^2*y^5 - 10984*x^2*y^4 - 144716*x^2*y^3 - 769764*x^2*y^2 -
> 1669218*x^2*y - 1214524*x^2 - 61.9525*x*y^6 - 3876*x*y^5 - 75440*x*y^4 - 643676*x*y^3 - 2570248*x*y^2 -
>4473769*x*y - 2750044*x - 4.1241*y^7 - 333.6706*y^6 - 8419*y^5 - 99085*y^4 - 607023*y^3 - 1930062*y^2 -

2885924*y - 1593986;
> I tried to solve for the x & y values using the command : SS = solve(eq1, eq2)
> But, even after 6 hours also, it did not give any out put.
>
> I tried to use even fsolve also for solving the eq1 & eq2 equations. But,
>because of not giving the initial guess properly, Matlab is not giving the correct solution for eq1 & eq2 equations.
>
> Can anyone suggest how to solve these two equations ( eq1 & eq2 )? Please help.
>


Tried it on 2013a, could not do it either using solve. try other numerical methods.

But here is the solution if you want it, used Mathematcia, took 1.2 seconds:

{time, sol} = Timing[Solve[{eq1 == 0, eq2 == 0}, {x, y}]];
In[9]:= time
Out[9]= 1.185

In[10]:= sol
Out[10]= {
{x -> 0., y -> -151.35904583468965},
{x -> 0., y -> -85.13895087438566},
{x -> -27.164285604663753, y -> -50.61768554767208},
{x -> 2.8355044082183873, y -> -27.442707108646974},
{x -> 130.98454597901133, y -> -17.6754505729175},
{x -> 1.4267067596845873, y -> -17.077189139839028},
{x -> 1.1455075476333905, y -> -13.413469792543479},
{x -> 186.40562161038733, y -> -13.268055479706945},
{x -> 34.23762189426339, y -> -11.772880861558223},
{x -> 0.8087957326294682 + 0.39136558155618695*I,
y -> -11.700958027242402 - 1.3039589816219934*I},
{x -> 0.8087957326294682 - 0.39136558155618695*I,
y -> -11.700958027242402 + 1.3039589816219934*I},
{x -> -0.40497228838960503, y -> -10.137853538222389},
{x -> 0.5364185347731513 + 0.3181435518825487*I,
y -> -10.085826686503125 - 0.20565480400396605*I},
{x -> 0.5364185347731513 - 0.3181435518825487*I,
y -> -10.085826686503125 + 0.20565480400396605*I},
{x -> -6.727660044522176, y -> -9.219496476503034},
{x -> 0.008098051043877884, y -> -9.218355722090397},
{x -> 0.48932534323564564, y -> -8.823578615102061},
{x -> 29.100385938401935, y -> -8.514311377787577},
{x -> -0.1320800417401883 + 0.32510503130905966*I,
y -> -7.768657548339962 - 1.6121948964901707*I},
{x -> -0.1320800417401883 - 0.32510503130905966*I,
y -> -7.768657548339962 + 1.6121948964901707*I},
{x -> -8.834051940908747, y -> -6.8970187103268925},
{x -> 38.70734459279393, y -> -6.312522584916942},
{x -> 14.407999992272309, y -> -5.946529047240522},
{x -> -0.7055298230766178, y -> -5.8131791971590285},
{x -> 0.128961832508615, y -> -5.808200902261788},
{x -> -7.468140749138903, y -> -5.640036783643233},
{x -> -0.35507785808468334 - 0.020416893279005557*I,
y -> -5.518321482297532 - 0.04507273318877324*I},
{x -> -0.35507785808468334 + 0.020416893279005557*I,
y -> -5.518321482297532 + 0.04507273318877324*I},
{x -> 0.8332949215612189, y -> -5.279011066092062},
{x -> -0.7208458327510595, y -> -5.222232095592231},
{x -> -83.28782054667569, y -> -4.523280077259166},
{x -> 6.550069249409195, y -> -3.0000810589773708},
{x -> -0.3399664169498006, y -> -1.6094894258190373},
{x -> -0.5257958359207511, y -> -1.5182223234174406},
{x -> -0.35232274493597676, y -> -1.5013881420037343},
{x -> -0.9408942319257629, y -> -1.430768655564594},
{x -> -1.1199461766672494, y -> -1.4032153693514107},
{x -> -1.0988253987405006, y -> -1.3962264824502768},
{x -> -1.1156457095135324, y -> -1.3861415642868689},
{x -> -1.8597874513598176, y -> -1.3167119219846115},
{x -> -1.7282435071910636, y -> -1.2667077318019304},
{x -> -9.052480286114635, y -> -1.2326932753946283},
{x -> -1.9053504295089767, y -> -1.1484614203347703},
{x -> -8.540695229140074, y -> -0.4961496485677344},
{x -> -9.268950946095428, y -> 0.7114889170757767},
{x -> -8.817029632386216, y -> 0.8878798157464098},
{x -> -1.8544260064896303, y -> 6.586666522406094},
{x -> -3.9552323940254097, y -> 8.577760614875976},
{x -> 0., y -> 111.6265329139572}}

--Nasser



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.