Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Initial values - how to input vector rather than constant?

Please login with a confirmed email address before reporting spam

I'm using 1D General Form PDE to solve some coupled PDEs.

I have set up the PDEs and boundary conditions. Now I have to set up initial conditions.

Say I have 5 mesh points. Then for a particular parameter I want the inital conditions [0,2,4,6,8] or something, so the left-most mesh point is zero and the right-most mesh point initial condition is 8.

However when I click on Model 1 > General Form PDE > Initial values node, I see a place to enter the initial conditions, however this appears to only accept a constant. So if I enter "3" then I get [3,3,3,3,3]. I have tried the following:

range(0,8/(5-1),8) --- it accepts this input but gives an error at runtime about not recognizing "range"

or I simply tried

[0,2,4,6,8] --- however it does not accept this input.

How to give a non-constant input initial condition?

Thanks!

3 Replies Last Post 2014年4月15日 GMT-4 05:32

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年2月8日 GMT-5 16:35
Hi,


Did you try to define initial condition parameter as a function of space. Essentially, in the initial values field, you type:

init(x) in 1D or init(x,y) in 2D or init(x,y,z) in 3D.

But you have to define "init" under interpolation function.


Suresh
Hi, Did you try to define initial condition parameter as a function of space. Essentially, in the initial values field, you type: init(x) in 1D or init(x,y) in 2D or init(x,y,z) in 3D. But you have to define "init" under interpolation function. Suresh

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年2月9日 GMT-5 12:17
That did it! Thanks!
That did it! Thanks!

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年4月15日 GMT-4 05:32
Hello,

that does not work for me? I am in axisym 2D case? is it then different?

the init(r,z) or init(x,y) in the function definitions is well plotted,

but under the initial value it does not appear?

thanks

lukas

my mistake was in the units.. init(1000*r,1000*z) was right
Hello, that does not work for me? I am in axisym 2D case? is it then different? the init(r,z) or init(x,y) in the function definitions is well plotted, but under the initial value it does not appear? thanks lukas my mistake was in the units.. init(1000*r,1000*z) was right

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.