How do I use the solve function to solve the following equation
3 ビュー (過去 30 日間)
古いコメントを表示
Here is my code. My aim is to solve for value beta using the following equations. I have used the solve function. But I get the following error The probem is that the equation fir beta is not being solved
Error using plot
Conversion to double from sym is not possible.
Error in proj (line 23)
plot(neff, lambda);
clc;
clear all;
close all;
lambda=1500;
nm=1e-9;
lambda=lambda*nm;
c=3e8;
w=c./lambda;
width=20: 20:100;
width=width.*nm
ev=1240*nm;
einf=3.7;
wp=9.7*ev;
gamma=.018*ev;
emw=einf-(wp.*wp)./(w.*(w+gamma.*i))
nd=1.46;
ed=nd*nd;
k0=2*pi./lambda;
syms beta
solve(emw.*sqrt(beta*beta-ed.*k0.*k0).*tanh(width.*sqrt(beta*beta-ed.*k0.*k0)./2)+ed.*sqrt(beta*beta-emw.*k0.*k0)==0)
neff = beta./ k0;
plot(w, real(neff));
I cant really figure out what I'm doing wrong. Thank you for the help.
0 件のコメント
回答 (1 件)
Walter Roberson
2013 年 3 月 18 日
You solve() but you do not assign the result to anything. Try
Beta = solve(emw.*sqrt(beta*beta-ed.*k0.*k0).*tanh(w.*sqrt(beta*beta-ed.*k0.*k0)./2)+ed.*sqrt(beta*beta-emw.*k0.*k0)==0, beta);
neff = Beta ./ k0;
4 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!