Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Random Initial Data help

Please login with a confirmed email address before reporting spam

Hi,
I'm a complete COMSOL beginner and am trying to figure out how to generate a set of random initial data in a simple PDE model. Is there a way to use randn or rand from MATLAB somehow in the INIT section?
Any information would be great.

thanks,
Andy

2 Replies Last Post 28.12.2009, 05:23 GMT-5

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 28.12.2009, 05:13 GMT-5
Hi Andy,
to be honest I really do not understand why you need to generate a random initial condition. If you can, more details would be very much appreciated. By the way, I guess that you can solve your problem by running Comsol with Matlab (whereas you have a valid licence). In this way, just type "rand(1,1)" in the related field of the "init" tab.
Moreover, if you need to generate a set of random values, run a parametric analysis, in which every parameter is a random value. Maybe that the best way to run such as analysis is into matlab environment. Save your job as .m file and then open it into matlab editor. Here, you are able to define your functions as input for your simulation.

Hope this is helpful,

Pasquale
Hi Andy, to be honest I really do not understand why you need to generate a random initial condition. If you can, more details would be very much appreciated. By the way, I guess that you can solve your problem by running Comsol with Matlab (whereas you have a valid licence). In this way, just type "rand(1,1)" in the related field of the "init" tab. Moreover, if you need to generate a set of random values, run a parametric analysis, in which every parameter is a random value. Maybe that the best way to run such as analysis is into matlab environment. Save your job as .m file and then open it into matlab editor. Here, you are able to define your functions as input for your simulation. Hope this is helpful, Pasquale

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 28.12.2009, 05:23 GMT-5
Hi

If its a random time series, you can perhaps express it as a PSD and use that as an envelope for a harmonic analysis, this is often used for random vibration analysis fo structures

Good luck
Ivar
Hi If its a random time series, you can perhaps express it as a PSD and use that as an envelope for a harmonic analysis, this is often used for random vibration analysis fo structures Good luck Ivar

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.