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.

How to use an interpolated function in an analytical function

Please login with a confirmed email address before reporting spam

Hello, A a new COMSOL user, I am currently trying to run a simulation which has to define functions from solar spectra data.

I managed to create a new function called "solar_spectrum" by interpolation of a data file (see attached file) Now, I would like to use this function in another function called "modified_spectrum".

But it doesn't seem to work. I can't even display the first function when calling "solar_spectrum(x)" in the this new function...

Can you please help ?

Thanks

Jeremy!



2 Replies Last Post Oct 6, 2020, 10:33 a.m. EDT
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 4 years ago Oct 6, 2020, 9:53 a.m. EDT

Hi Jeremy,

it works if you omit the units everywhere. I remember having teared my hair about such issues before. I prefer to manually scale everything to stay with basic SI units.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi Jeremy, it works if you omit the units everywhere. I remember having teared my hair about such issues before. I prefer to manually scale everything to stay with basic SI units. Cheers Edgar

Please login with a confirmed email address before reporting spam

Posted: 4 years ago Oct 6, 2020, 10:33 a.m. EDT

Hello Edgars,

Thank you so much! It works fine now.

Jeremy

Hello Edgars, Thank you so much! It works fine now. Jeremy

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.