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.

Can you import data into Comsol 3.5?

Please login with a confirmed email address before reporting spam

Hi,

I'd like to import data into Comsol 3.5, for example, the refractive index of a material. The data are in such a format:

wavelength(nm) , n
300 , 2.5
301 , 2.49
302 , 2.48
303 , 2.47

etc.

I'd like to import the data as a scalar variable, so that Comsol can interpolate the refractive index n as a function of wavelength. Is it possible to do so in Comsol 3.5?

Thanks.

5 Replies Last Post 14 gen 2013, 16:57 GMT-5
Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 gen 2013, 14:21 GMT-5
Ray,

Use the following steps:

1. Options>Functions
2. Click New
3. In the New Function window, define function name, click Interpolation radio button, and select File from Used data from selection list
4. Click Browse button to locate file with your data for refraction index.
5. Click OK

Regards,
Sergei
Ray, Use the following steps: 1. Options>Functions 2. Click New 3. In the New Function window, define function name, click Interpolation radio button, and select File from Used data from selection list 4. Click Browse button to locate file with your data for refraction index. 5. Click OK Regards, Sergei

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 gen 2013, 15:06 GMT-5
Thank you so much! You made my day :)
Thank you so much! You made my day :)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 gen 2013, 16:23 GMT-5
I have another question: I defined two functions: n and k, which are the real and imaginary parts of the refractive index. The complex refractive index is expressed as: n+ki. How do I use n+ki as a variable? I tried n+ki, n+k*i, n-i*k, none of them worked. Comsol simply doesn't recognize the combined complex number. How do I combine these two functions into one complex function and use it in Comsol?

Thank you.
I have another question: I defined two functions: n and k, which are the real and imaginary parts of the refractive index. The complex refractive index is expressed as: n+ki. How do I use n+ki as a variable? I tried n+ki, n+k*i, n-i*k, none of them worked. Comsol simply doesn't recognize the combined complex number. How do I combine these two functions into one complex function and use it in Comsol? Thank you.

Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 gen 2013, 16:43 GMT-5
Ray,

Under Options>Global Expressions, define variable

complex_n=n(lambda)+j*k(lambda)

and use variable “complex_n” as needed anywhere.

If you need real part of this variable, then real(complex_n)=n(lambda).
Similarly, imag(complex_n)=k(lambda).


Regards,
Sergei
Ray, Under Options>Global Expressions, define variable complex_n=n(lambda)+j*k(lambda) and use variable “complex_n” as needed anywhere. If you need real part of this variable, then real(complex_n)=n(lambda). Similarly, imag(complex_n)=k(lambda). Regards, Sergei

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 gen 2013, 16:57 GMT-5
Thank you, Sergei. It worked. You are so wonderful! :)
Thank you, Sergei. It worked. You are so wonderful! :)

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.