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.

Inputting Complex Number into "Search for Modes Around" through a Method Script

Please login with a confirmed email address before reporting spam

Dear all,

I'm trying to write a method that iterates through frequencies in a study. (that uses boudary mode and frequency domain analysis)

With each iteration, the search index needs to be adjusted using the effective index from the previous iteration.

My issue: To update the search index with each iteration I use the following line

model.study("std1").feature("bma").set("shift",Sindex)

The effective index I wish to insert is Sindex, is a double[][] where the 1st element is real, 2nd is imaginary. Check Syntax does not return an error or warning with this line.

When running the method, I get the following error

Failed to run method Proprerty:shift(Search for modes around) 'Search for modes around' is a complex number Expected unit is: .

I cannot find the right documentation to resolve this issue, so any guidance would be much appricated!

Kind regards, Ed


1 Reply Last Post 11 ott 2021, 10:35 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 3 years ago 11 ott 2021, 10:35 GMT-4

My apologies for filling the forum with silly posts, I have resolved the issue. You need to insert the search index as a string not a double

My apologies for filling the forum with silly posts, I have resolved the issue. You need to insert the search index as a string not a double

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.