Re: General solution to equation



On Jul 7, 7:43 pm, Raymond Manzoni <raym...@xxxxxxx> wrote:
grove.matt...@xxxxxxxxx a écrit :

I need to solve the following equation for n, and I'm having a lot of
trouble.

(s*(1+t)^n-s)*(1-z) = (s*(1+x)^n-(s+(s*d*(1-(1+x)^n)/-x)))*(1-c)+
(s*d*(1-(1+x)^n)/-x)

Any help finding a general solution for n would be much appreciated.
It would even be helpful if someone could tell me that it's not
possible to find a general solution so I stop banging my head against
the wall. Thanks in advance.

The 's' factor appears everywhere and may be removed.

Let's note L= 1-z and R= (c-1) (1-d/x) + d/x then your equation is
simply (if L not 0 that is z not 1) :
((1+t)^n - 1) = R/L ((1+x)^n - 1)

I'll define a function of n (with r= R/L) :
f(n)= ((1+t)^n - 1) - r ((1+x)^n - 1)

I'll suppose that t and x are different and not -1 and that you are
searching a real positive solution for n

A simple solution of f(n)= 0 is of course n=0

Let's study the behavior of f(n) for positive values of n.

The derivative of f(n) is
f'(n)= ln(1+t) (1+t)^n - r ln(1+x) (1+x)^n

f'(n)= 0 iff ln(1+t)/ln(1+x) = r ((1+x)/(1+t))^n
that is n0= ln(ln(1+t)/ln(1+x)/r)/ln((1+x)/(1+t)) verifies f'(n0)=0
n0 may be complex, real and negative or real and positive.

Since f is smooth, f(0)= 0 and since limit_{n->+oo} f(n)= +/- oo you
may obtain a positive solution for f(n)= 0 only in the last case (n0
positive real).

In this case you may solve f(n)= 0 by iterations for example using
Newton's method :

Start with a 'large enough' value of n (say 2 n0) and compute
g(n)= n - f(n)/f'(n)= n - (((1+t)^n - 1) - r ((1+x)^n - 1))/(ln(1+t)
(1+t)^n - r ln(1+x) (1+x)^n)
replace n by g(n) and continue until required precision

Should this method be unstable for your t, x, r values then try one
of the methods proposed here :http://en.wikipedia.org/wiki/Root-finding_algorithm

Hoping it helped,
Raymond

Thanks to both of you. This is very helpful.

.



Relevant Pages

  • Re: OnoChord
    ... banging, do you really think that if a "performance artists" gets up ... on stage and bangs their head on the floor, ... Was passed off by his mother, ...
    (rec.music.beatles)
  • Re: so i finally hear the new common....
    ... Banging your head against a wall ... Banging your head against a strong wind ... The sound of the bed knocking against the wall while your grandparents are having sex in the next room ... You know how when you record over a tape, how in the silent parts of the new recording you can faintly hear the beat of the old recording? ...
    (rec.music.hip-hop)
  • Re: [PATCH] binfmt_flat: minimum support for theBlackfin relocations
    ... Jivin Robin Getz lays it down ... ... I don't think we have been "banging heads" with you (unless that is your ... No head banging feelings here, but I would understand if you guys felt ...
    (Linux-Kernel)
  • Re: Toddler tempers
    ... I've seen children hurt themselves by head ... themselves with head banging. ... healthy toddlers don't seriously injure themselves ... Physical or intracranial injuries rarely result, ...
    (misc.kids)
  • Re: running shoe problem
    ... a different running shoe. ... I started running on the track because I thought banging my head on ... I currently wear an Asics beanie. ...
    (rec.running)