Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5945
| From | Dana DeLouis <dana01@me.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Another basic (?) question about RecurrenceTable and replacement |
| Date | 2011-10-28 09:34 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j8dsvd$k7h$1@smc.vnet.net> (permalink) |
... using RecurrenceTable and computing sol[n/10,x[n],y[n]] only once ?
Hi. I don't have a solution, but perhaps a few ideas.
My guess is that using RecurrenceTable and FindRoot might not work well together. My thinking
is that a Recurrence table uses more exact values, whereas FindRoot returns values at machine precision.
> I kind of got confused with my notations : I want to solve
> x_0 = -2, y_0 = 0
As a suggestion, perhaps refer to the RSolve function.
That function uses a specific way to refer to previous values.
As a simple example, here are begging x & y values, and recurrence functions:
equ={
x[0]==0,
x[1]==1,
x[n]==x[n-2]+x[n-1],
y[0]==1,
y[n]==n*y[n-1]
};
Rsolve suggest a function for both x & y as a function of n.
RSolve[equ, {x[n],y[n]}, n] //FullSimplify
{
x[n]->Fibonacci[n],
y[n]->Pochhammer[1,n]
}
Perhaps one of a few suggestions for your example might be to use your FindRoot function and generate a list of x & y pairs.
Round to something more exact if your can.
For example, suppose FindRoot gave the following x & y pairs :
z={{1, 2.00001},{2, 4.9999999},{3, 10.00000001},{4, 19},{5, 36},{6, 69},{7, 134}};
If it is acceptable, try to round the values to something like this:
z={{1,2},{2,5},{3,10},{4,19},{5,36},{6,69},{7,134}};
I don't see a pattern, but FindSequenceFunction did.
FindSequenceFunction[z,n]
-1+2^n+n
I hope I understood your question correctly.
= = = = = = = = = = = = = = = = = = = = = =
HTH
Dana DeLouis
$Version
8.0 for Mac OS X x86 (64-bit) (February 23, 2011)
On Oct 25, 6:19 am, victorphy <vba...@gmail.com> wrote:
> Hello,
>
> here is another question I could'nt find the asnwer on the web,
> altough I guess it's very elementary.
>
> Here is my problem. Assume I want to solve an implicit equation on two
> variables :
>
> x_0 = _2, y_0 = 0
>
> (x_{n+1},y_{n+1}) = sol(n/10,x_n,y_n)
> for n = 1..10
>
> where f cannot be defined explicitely but is given by something like
> (I give a silly exemple):
>
> f[x_, a_] := -(x - a)^3 + (x - a)
> sol[a_?NumericQ, b_?NumericQ,c_?NumericQ] := FindRoot[{f[x, a], x +
> y}, {x, b}, {y, c}]
>
> What is the way to write this using RecurrenceTable and computing
> sol[n/10,x[n],y[n]] only once ? (as in the real life the rootsearching
> is longer than above) ?
>
> Any help would be very welcome.
>
> Thank you very much in advance.
>
> Best regards,
>
> Victor
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Another basic (?) question about RecurrenceTable and replacement Dana DeLouis <dana01@me.com> - 2011-10-28 09:34 +0000
csiph-web