From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How can I increase this solve syntax ?
Date: Sun, 22 May 2011 22:05:42 -0700
Organization: NNTP Server
Lines: 35
Message-ID: <ircpv6$8tf$>
References: <ircoba$dll$>
Reply-To: <HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/20110414 Thunderbird/3.1.10
X-Notice: Filtered by postfilter v. 0.8.2
Xref: comp.soft-sys.matlab:728146

On 5/22/2011 9:38 PM, mahdi roozbhani wrote:
> tic;
> solve('(x20-6.5563)^2+(y20-6.3529)^2+(znn-1)^2=(1+1)^2','(x20-4.7476)^2+
>  (y20-4.0166)^2+(znn-1)^2=(1+1)^2','(x20-8.1058)^2+(y20-4.017)^2+(znn-1)^2=(1+1)^2','x20',
>  'y20','znn');
> toc
> Elapsed time is 0.117134 seconds.
> the elapsed time is to high, because this solving is in the for loop for millions counters.
> PL help me that how can I increase the speed ?

Is the above timing from the first try? First time you call solve it is slow
(cach effect), second time should be faster.

This is what I get on my PC (second try)

EDU>> tic;
Elapsed time is 0.060639 seconds.

On the same PC, this is what I get using Mathematica

{time,result}=Timing[Solve[{(x20-6.5563)^2+(y20-6.3529)^2+(znn-1)^2== (1+1)^2,(x20-4.7476)^2+
(y20-4.0166)^2+(znn-1)^2== (1+1)^2,(x20-8.1058)^2+(y20-4.017)^2+(znn-1)^2==(1+1)^2},{x20,y20,znn}]];

Out[17]= 0.016000000000000014