Solve differential equation where parameter is dependent on value of an integrated variable
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
darova
am 11 Dez. 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));
Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!