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.

Defining a parameter with respect to another parameter

Please login with a confirmed email address before reporting spam

The below post is related to an archived discussion


Dear Comsol users,

The link to the previous discussion thread is on caculating band structure for a triangular lattice. However, a question I have is a simpler one and related to one of the steps mentioned in the thread. Following is the question: How can one define parameters 'a' and 'k' as follows: a=0...1; k=0...b1 | a=1...2; k=b1...b2 | a=2...3; k=b2...0 ? where I will then be doing a parametric sweep of parameter 'a' from 0 to 3.

Please let me know if someone else has come upon this problem and solved it. I would really appreciate it.

Sincerely, Pragalv


2 Replies Last Post Jun 8, 2021, 1:20 p.m. EDT
Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Jun 2, 2021, 2:24 a.m. EDT

You can define auxiliary parameters like

kstart: if(a<1,0,if(a<2,b1,b2))
kend: if(a<1,1,if(a<2,b2,0))
k: kstart+k1*(kend-kstart)

Then you make a sweep over a and k1, where k1 ranges from 0 to 1.

-------------------
Henrik Sönnerlind
COMSOL
You can define auxiliary parameters like kstart: if(a

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Jun 8, 2021, 1:20 p.m. EDT

Thank you Henrik!

Thank you Henrik!

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.