defining a varying scalar over domain with a specified distribution in an array

Asked by Louise Olsen

Could you let me know how I can find the length of a variable lam defined as a scalar on FunctionSpace: lam=Scalar(lam1,Function(mydomain))

Instead of defining lam as a constant = lam1 I would like to use a random weibull distribution generated as an array using numpy.random.weibull(a,length(lam???)) to define the parameter lam in the domain. Is it possible to do this?

Question information

Language:
English Edit question
Status:
Solved
For:
esys-escript Edit question
Assignee:
No assignee Edit question
Solved by:
Joel Fenwick
Solved:
Last query:
Last reply:
Revision history for this message
Lutz Gross (l-gross) said :
#1

I guess what you want to do is this:

u=RandomData((), Function(mydomain))
w = lsm1*(-ln(u))**{1./a}

Revision history for this message
Louise Olsen (l-kettle1) said :
#2

as long as u is randomly taken from a uniform distribution between [0,1]? Where is documentation for RandomData?

Revision history for this message
Best Joel Fenwick (j-fenwick1) said :
#3

Section 3.2.5 of the user guide.

Revision history for this message
Louise Olsen (l-kettle1) said :
#4

Thanks Joel Fenwick, that solved my question.

Revision history for this message
Louise Olsen (l-kettle1) said :
#5

Sorry I had an old user guide which didn't have documentation, have downloaded updated version.

It would be good if the user guide specified what RandomData does specifically- does it generate a random float uniformly in the which range (0.0, 1.0)? >=0 <=1 etc.

Revision history for this message
Joel Fenwick (j-fenwick1) said :
#6

Fair point, the values are doubles drawn uniformly from [0,1].

Doco will be updated in the next release.