Programming Challenge: a classic trigonometry problem
|
01-05-2014, 08:57 PM
Post: #13
|
|||
|
|||
RE: Programming Challenge: a classic trigonometry problem
(01-05-2014 07:04 PM)peacecalc Wrote: I tried some other starting values say [1, 2,] and the hp 50g don't find an answer. It is a very sensitive context for finding solutions or not. There are four solutions, two of them complex: pi@raspberrypi ~ $ wolfram Wolfram Language (Raspberry Pi Pilot Release) Copyright 1988-2013 Wolfram Research Information & help: wolfram.com/raspi In[1]:= NSolve[{1/u + 1/v == 1/15, u^2 == v^2 + 700}, {u, v}] Out[1]= {{u -> -28.2118, v -> 9.79309}, {u -> 10.7729 + 6.01706 I, v -> -2.58901 - 25.037 I}, {u -> 10.7729 - 6.01706 I, v -> -2.58901 + 25.037 I}, {u -> 36.666, v -> 25.3849}} The Newton-method diverges when started with [1, 2]: u = 1.0000000000000 v = 2.0000000000000 u = 41.3296296296296 v = -153.5851851851852 u = -49.4302111802062 v = -55.6512210512007 u = -205.7273127249908 v = -182.3140738957537 u = -1531.2733452510920 v = -1701.0869808819939 u = -93677.9530127932958 v = -84487.5385742955987 u = -247742042.5258520543575 v = -274681321.0911503434181 u = -2360136807978930.5000000000000 v = -2128667206649884.7500000000000 u = -157153398351889397901521059840.0000000000000 v = -174242135544052632367543615488.0000000000000 u = -949697291864817741529613623730114668140362827139987275776.0000000000000 v = -856556058361719901532676603696429135498784220559660023808.0000000000000 u = -25446017402251229885290585326635955008806695822895345978365490840398038769950489107047203019229485426806177660928.0000000000000 v = -28212997362815701894929958679669880027277377292558295324362552321603076286842132473592025945218693975400526118912.0000000000000 This is one of the advantages of the solution for the fixed-point equation: it's globally convergent. Cheers Thomas |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)