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?
Posted 07.02.2014, 19:47 GMT-5 Parameters, Variables, & Functions Version 4.3a, Version 4.3b, Version 4.4 3 Replies
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!
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 15.04.2014, 05:32 GMT-4