Solve differential equation where parameter is dependent on value of an integrated variable

1 view (last 30 days)
Hi,
I have a system of differental equations where I have a parameter kw(lambda), which is the absorption spectrum of water at a specific wavelength, lambda. For kw I have a data table with wavelengths from 400 to 700 by increments of 2.5 (400, 402.5, 405...) with the corresponding absorption value at each wavelength. I have the wavelengths stored as a parameter wave and the absorption values as a parameter abs.
In the system of equations I have to integrate over lambda from 400 to 700; therefore the value of lambda used to look up kw is determined by the integral. I want to interpolate the value of kw with:
kw=interp1(wave,abs,lambda)
I've tried to define kw as above and then solve my equations but get the error "Unrecognized function or variable 'lambda' ". Is there a way to interpolate over a set of values that are determined by an integral or is there another way that I should be going about solving this problem?
Thanks,
Jake
  5 Comments
darova
darova on 11 Dec 2019
Try Kw as function
Kw = @(lambda) interp1(wave,abs,lambda);
Use Kw as function
I= Iin * exp((-Kw(lambda)*z) -(kbg*z) -sum(k*N*z));

Sign in to comment.

Answers (0)

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!