Conditional parametric sweep

Please login with a confirmed email address before reporting spam

Hi

I'd like to run a parametric sweep with a couple of conditions. Here is an example of what I'm trying to do.

a = range(1:1:10) b = range(1:1:10)

The condition I want to add is a+b<15

Can I do this directly in COMSOL?

Alternatively I generated the combination on MATLAB but when I am having the file read by COMSOL through a saved text file. It is saying Failure reading file. '1' is not a valid variable name.

Could you please help me troubleshoot either of my methods. I'm wondering if the way the data is output from MATLAB is not compatible with COMSOL.

Thanks and regards VK


1 Reply Last Post 1 oct. 2025, 10:41 UTC−4
Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 hours ago 1 oct. 2025, 10:41 UTC−4
Updated: 7 hours ago 1 oct. 2025, 10:41 UTC−4

You can accomplish this using two nested Parametric Sweep nodes:

  • The outer Parametric Sweep sweeps a over range(1, 1, 10).

  • The inner Parametric Sweep sweeps b over range(1, 1, 14-a).

You can accomplish this using two nested Parametric Sweep nodes: * The outer Parametric Sweep sweeps a over range(1, 1, 10). * The inner Parametric Sweep sweeps b over range(1, 1, 14-a).

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

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.