Optimization : force a parameter to be an integer

Please login with a confirmed email address before reporting spam

Hello

I am making an optimization model where I have a repetition of a certain pattern. I want to optimize the overall pattern and the number of repetitions is one of my parameters and I need it to be interger. I guess I could try to use floor(N) in my formulas but I think a gradient descent based algorithm needs some changes between each step to compute the gradient, otherwise it would think that changing N a little does not affect the output. Can someone confirm or denie that ? If that's true, any ideas on how to force this parameter to be integer (force a step of 1) ?

Thank you !


3 Replies Last Post Jun 11, 2024, 4:13 a.m. EDT
Kristian Ejlebjærg Jensen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 months ago May 29, 2024, 6:41 a.m. EDT
Updated: 5 months ago May 29, 2024, 6:41 a.m. EDT

Hi

COMSOL does not support integer optimization. IPOPT will change controls even though the sensitivity is zero, but in most situations, you can just fix the integer and perform a sweep over the optimization. It sounds like you only have a single integer parameter, so this ought to be a viable strategy.

Best regards,

Kristian E. Jensen

Technical Product Manager Optimization

Hi COMSOL does not support integer optimization. IPOPT will change controls even though the sensitivity is zero, but in most situations, you can just fix the integer and perform a sweep over the optimization. It sounds like you only have a single integer parameter, so this ought to be a viable strategy. Best regards, Kristian E. Jensen Technical Product Manager Optimization

Please login with a confirmed email address before reporting spam

Posted: 5 months ago May 29, 2024, 11:38 a.m. EDT
Updated: 5 months ago May 29, 2024, 11:40 a.m. EDT

Thank you for the reply, I will try that. Is the incrementation of each parameter constant over the optimisation ? if so I could maybe find a scale factor that makes the step be 1

Thank you for the reply, I will try that. Is the incrementation of each parameter constant over the optimisation ? if so I could maybe find a scale factor that makes the step be 1

Kristian Ejlebjærg Jensen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 months ago Jun 11, 2024, 4:13 a.m. EDT
Updated: 5 months ago Jun 11, 2024, 3:02 p.m. EDT

Hi

You can specify the increment in the Parametric Sweep, i.e. range(1,1,10) sweeps the value from 1 to 10 in steps of 1.

Best regards,

Kristian E. Jensen

Technical Product Manager Optimization

Hi You can specify the increment in the Parametric Sweep, i.e. range(1,1,10) sweeps the value from 1 to 10 in steps of 1. Best regards, Kristian E. Jensen Technical Product Manager Optimization

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.