how to solve this data generating random number problem

Hello everyone.
I need some help in my coe while i have some problem when i do use monte carlo method. My code is in the attachment. All the code is perfect, only the last equation p=pt*2(asin(sqrt(R))) has a problem. i dont know how to get this step. in this equation i need to get pt by monte carlo method. and R is the random number [0,1]. in the above equation i need to fing pt by using the monte carlo method, and then find p. i don't understand how to find pt by using the monte carlo method. can anybody please help me?
Thanks

8 comentarios

You have not given us enough information about how pt should be found. Does some expression involving R get calculated and that value looked up in as y12 to find the corresponding pt value, and then the same random number gets used in pt*csc(2*arcsin(sqrt(R))) to find p? Something like pt(y12_inverse(R ))*csc(2*arcsin(sqrt(R))) ?
Thanks for your kind response Walter Roberson.
Actually p = pt*csc(2*arcsin(sqrt(R))).... this is in actual form like p = pt*csc(theta) and theta = 2*asin(sqrt(R)). This R is not used in any expression. we will just use it in this expression and it denote random number distrubuted evenly in [0,1]. and pt used in the code before, is just a loop for finding y12 (f(pt)). the used pt loop is just for fitting the spectum of different particles. I got f(pt) in the form of y12.... Now i want to get' pt ' by monte calo method. means one valve for R, the Pt can give one value for p ,
What relationship is there between y12 and theta ?
infact there is no relation between y12 and theta. we only need to use monte carlo method to find pt. that will give us 1 point, and theta will also give us 1 one value. then we will get 1 value for p.... p = pt*csc(theta).
Are you saying that you run through a montecarlo process in one random parameter in order to derive a scalar value for pt, and then once you have derived that pt, that you run through a second series of random numbers to calculate a number of p values? So two total random number processes?
Or is it the case that you want to run through a single random number process that you use to generate R, and that R somehow ties in to calculating a pt value for that R ??
waqas muhammad
waqas muhammad el 17 de Oct. de 2019
Editada: waqas muhammad el 17 de Oct. de 2019
in simple way....
pt i need by monte carlo method which will give me many values, a vector.. and R is random number [0,1] .....I need to get the pt through R....
and from many times R pt, i can get many p. and then at the end i will get its average and will get a single value. and mos probably it will give me a value of less than 1.
Okay so for any given value of R how do you derive a pt value?
waqas muhammad
waqas muhammad el 17 de Oct. de 2019
Editada: waqas muhammad el 17 de Oct. de 2019
pt should be get by monte carlo method.... we dont need to check at the final value. we just need to do pt by monte carlo method, no other limits should be taken into consideration.

Iniciar sesión para comentar.

Respuestas (0)

Preguntada:

el 17 de Oct. de 2019

Editada:

el 17 de Oct. de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by