MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Need Help

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94599] Re: [mg94585] Re: Need Help
  • From: "Oyedeji, Kale" <koyedeji at morehouse.edu>
  • Date: Wed, 17 Dec 2008 06:33:42 -0500 (EST)
  • References: <gi7lmj$d1m$1@smc.vnet.net> <200812161106.GAA16849@smc.vnet.net>

Thannks Daniel for your advice. I changed Evaluate to RSolve but still got the same result. What I wanted was a calculation of S[k] and R[k] for every k. I wanted a random number generated for each k. I expect S[1]= some number, R[1]= some number for each k.

Thanks also for calling my attention to CopyAs.Plain Text.

'Kale

With[{B=8,f=3x10^-5}, sol=RSolve[{S[k+1]==R[k]*B*Table[Random[],{10000}]-f*S[k]*R[k],R[k+1]==f*S[k]*R[k], S[0]==3400, R[0]==9}, {S,R}, {k,0,10000}]]

Sample output:

RSolve[{S[1+k]=={0.561545 R[k]-(3 R[k] S[k])/x10^5,1.80044 R[k]-(3 R[k] S[k])/x10^5,0.901316 R[k]-(3 R[k] S[k])/x10^5,5.51532 R[k]-(3 R[k] S[k])/x10^5,4.2516 R[k]-(3 R[k] S[k])/x10^5,0.949978 R[k]-(3 R[k] S[k])/x10^5,4.13191 R[k]-(3 R[k] S[k])/x10^5,<<9987>>,1.24536 R[k]-(3 R[k] S[k])/x10^5,5.14664 R[k]-(3 R[k] S[k])/x10^5,6.00884 R[k]-(3 R[k] S[k])/x10^5,2.25255 R[k]-(3 R[k] S[k])/x10^5,2.92772 R[k]-(3 R[k] S[k])/x10^5,0.111999 R[k]-(3 R[k] S[k])/x10^5},R[1+k]==(3 R[k] S[k])/x10^5,S[0]==3400,R[0]==9},{S,R},{k,0,10000}]


-----Original Message-----

From: dh [mailto:dh at metrohm.com] 
Sent: Tuesday, December 16, 2008 6:06 AM
To: mathgroup at smc.vnet.net
Subject: [mg94599] [mg94585] Re: Need Help

Hi,

if you paste output into a mail, you should use CopyAs.Plain Text from 
the Edit menu. I tried to fix your expression:

With[{B=8,f=3 

10-5},sol=Evaluate[{S[k+1]==R[k]*B*Table[Random[],{10000}]-f*S[k]*R[k],R[k+1]= 

=f*S[k]*R[k], S[0]==3400, R[0]==9}, {S,R}, {k,0,10000}]]

Please read in the manual about Evaluate, it is not what you want. Look 
at RSolve instead.

Further, you have a recursion formula that contains random numbers???? 

In addition, instead of a random number you have a vector of random 
numbers??

What are you trying to do???

Daniel







Oyedeji, Kale wrote:



> I need help. My intension is to solve the implicit difference equation below involving generation of random numbers and to plot S(k) and R(k) versus k. But all I got is a series of numbers as indicated below too.



> 



> Thanks for your assistance.



> 



> Kale 



> 



> With[{B=8,f=3 x10-5}, sol=Evaluate[{S[k+1]= =R[k]*B*Table[Random[],{10000}]-f*S[k]*R[k],R[k+1]= =f*S[k]*R[k], S[0]ïâ??Å 3400, R[0]ïâ??Å 9}, {S,R}, {k,0,10000}]]



> 



> Sample partial answer:



> 



> OutputSizeLimit`Dump`encapsulateOutput



> 



> {S[1+k]ïâ??Å {6.79088 R[k]-(3 R[k] S[k])/x105,3.42965 R[k]-(3 R[k] S[k])/x105,1.0636 R[k]-(3 R[k] S[k])/x105,6.98753 R[k]-(3 R[k] S[k])/x105,2.33128 R[k]-(3 R[k] S[k])/x105,4.43642 R[k]-(3 R[k] S[k])/x105,



> 



> 



> 



>  









  • Prev by Date: Re: PDE with two variables by NDSolve
  • Next by Date: Re: "The requested evaluator is not currently defined"
  • Previous by thread: Re: Need Help
  • Next by thread: Re: Need Help