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 06.10.2020, 10:33 GMT-4
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 06.10.2020, 09:53 GMT-4

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 06.10.2020, 10:33 GMT-4

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.