Find the angle between two tangents by iterating en2



On Tue, Sep 7, 2010 Robert Dodier writes,

>%o8 is the expression you want to evaluate to 0.1674317785, right?
>If so, at this point you want something like:

> find_root(%o8 - 0.1674317785, en2, 10, 80);

>Maybe I'm mistaken about which expression is supposed
>to evaluate to 0.1674317785, I wouldn't be surprised.
>If so, just substitute that other expression for %o8 above.

>You don't need anything else beyond the call to find_root.
>In particular you don't need to construct a loop of any kind.

Cleaning up the original expressions are...

(%i1) x^2+d*y*4+d^2*(-4)$
(%i2) e1:  rhs(first(solve(x^2+d*y*4+d^2*(-4),y)));
(%i3) en1: 10$
(%i4) en2: 5$   /* find_root wants a symbol not a number  */
(%i5) e2: subst([x=en1, d=en2],[first(diff(e1,x)), diff(e1,x)])$
(%i6) %phi[1] : first(e2)$
(%i7) %phi[2] : second(e2)$
(%i8) [(%phi[1]*d*(-2)),(d+((%phi[1])^(2)*d*(-1)))]$
          [(%phi[2]*d*(-2)),(d+((%phi[2])^(2)*d*(-1)))]$
 
((%pi*1/2)+(atan((((%phi[1]+(%phi[2]*(-1))))^((-1))*(1+(%phi[2]*%phi[1]))))*
(-1)));

At this point trying...

(%i9) find_root(%o8 - 0.178092938, en2, 10, 80);

Maxima replies with...
Maxima encountered a Lisp error:
Error in LAMBDA [or a collee]: 5 is not of type SYMBOL..

This error it is referring to is at (%i4) en2: 5$

I do not understand what it is referring to except it wants a symbol, not a
number.
There is no question about it if the find_root can work it greatly
simplifies the code.

William Porter
wporter at omegapar.com

-----Original Message-----
From: Robert Dodier [mailto:robert.dodier at gmail.com] 
Sent: Tuesday, September 07, 2010 11:14 AM
To: William Porter
Cc: maxima at math.utexas.edu
Subject: Re: [Maxima] Find the angle between two tangents by iterating en2

On Fri, Sep 3, 2010 at 10:22 AM, William Porter
<wmporter.omegapar at comcast.net> wrote:

> (%i8) [(%phi[1]*d*(-2)),(d+((%phi[1])^(2)*d*(-1)))]$
> ????????? [(%phi[2]*d*(-2)),(d+((%phi[2])^(2)*d*(-1)))]$
>
>
((%pi*1/2)+(atan((((%phi[1]+(%phi[2]*(-1))))^((-1))*(1+(%phi[2]*%phi[1]))))*
(-1)));
> (%i9) %,numer;

%o8 is the expression you want to evaluate to 0.1674317785, right?
If so, at this point you want something like:

 find_root(%o8 - 0.1674317785, en2, 10, 80);

Maybe I'm mistaken about which expression is supposed
to evaluate to 0.1674317785, I wouldn't be surprised.
If so, just substitute that other expression for %o8 above.

You don't need anything else beyond the call to find_root.
In particular you don't need to construct a loop of any kind.

HTH

Robert Dodier
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5432 (20100907) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5432 (20100907) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com