Error using symengine Unable to convert expression into double array.
Show older comments
What could be the problem with the code below? I can't get numerical answer for the error_dvd
clear all
syms a n lamb th h0 l hn deltal
eqd=n*lamb/(sin(a-th)-sin(a));
eqa=1/2*atan(h0/l);
eqth=2*a-atan(hn/l);
d_a=diff(eqd,a);
a_l=diff(eqa,l);
d_th=diff(eqd,th);
th_l=diff(eqth,l);
th_a=diff(eqth,a);
a_h0=diff(eqa,h0);
th_hn=diff(eqth,hn);
deltal=0.01;
deltah0=0.006;
deltahn=0.006;
a=1/2*atan(h0/l);
th=atan(h0/l)-atan(hn/l)
n=-1;
h0=0.26;
hn=0.079;
lamb=405*10^(-9);
l=0.15;
ltermi=abs((d_a*a_l+d_th*th_l+d_th*th_a*a_l))*abs(deltal);
h0termi=abs(d_a*a_h0+d_th*th_a*a_h0)*abs(deltah0);
hntermi=abs(d_th*th_hn)*abs(deltahn);
error_dvd(1)=double(subs(ltermi+h0termi+hntermi))
d_dvd(1)=n*lamb/(sin(atan(hn/l)-1/2*atan(h0/l))-sin(1/2*atan(h0/l)))
Accepted Answer
More Answers (0)
Categories
Find more on Filter Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!