Kristian Ejlebjærg Jensen
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
1 year ago
2023年7月18日 GMT-4 02:44
Hi
freq is the frequency of the solution. There is no variable for the number of the frequency, but if you know the frequency is between 1 and 2 Hz, you can write
if(abs(freq-1.5[Hz])<0.5[Hz],freq,0) as the objective. Then the objective for the other frequencies will be set to zero.
Best regards,
Kristian E. Jensen
Technical Product Manager, Optimization
Hi
freq is the frequency of the solution. There is no variable for the number of the frequency, but if you know the frequency is between 1 and 2 Hz, you can write
if(abs(freq-1.5[Hz])
Please login with a confirmed email address before reporting spam
Posted:
1 year ago
2023年7月19日 GMT-4 04:45
Updated:
1 year ago
2023年7月19日 GMT-4 04:49
Thenk you for idea!
But I found an option using functions "withsol" and "setind" from here:
https://www.comsol.com/forum/thread/129793/could-i-use-a-comsol-eigenfrequency-mode-result-as-initial-value-of-a-time-depen
withsol('sol123',freq,setind(lambda,N))
where N - 1, 2, 3 .... is the mode number. I'm not shure that it is correct, but the objective function works correctly and I get the correct fitting parameters.
Despite this, the COMSOL highlights the expression of the objective function in orange and writes a comment: "Unknow variable root.lambda".
Thenk you for idea!
But I found an option using functions "withsol" and "setind" from here:
https://www.comsol.com/forum/thread/129793/could-i-use-a-comsol-eigenfrequency-mode-result-as-initial-value-of-a-time-depen
withsol('sol123',freq,setind(lambda,N))
where N - 1, 2, 3 .... is the mode number. I'm not shure that it is correct, but the objective function works correctly and I get the correct fitting parameters.
Despite this, the COMSOL highlights the expression of the objective function in orange and writes a comment: "Unknow variable root.lambda".
Kristian Ejlebjærg Jensen
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
1 year ago
2023年7月19日 GMT-4 05:27
Hi
That is probably correct. You can disregard the objective warning for special parameters like "lambda". I thought you wanted to perform gradient based optimization where the withsol() operator would give a wrong gradient, but it should work fine for gradient free optimization.
Best regards,
Kristian E. Jensen Technical Product Manager,
Optimization
Hi
That is probably correct. You can disregard the objective warning for special parameters like "lambda". I thought you wanted to perform gradient based optimization where the withsol() operator would give a wrong gradient, but it should work fine for gradient free optimization.
Best regards,
Kristian E. Jensen Technical Product Manager,
Optimization