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
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 Center 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!