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

2 次查看(过去 30 天)
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 个评论
darova
darova 2019-12-11
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));

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by