I wanna solve this differential equation.lambda is function for w.
This is my script.
clear
clc
syms w(x) lambda Eox
%% set constant
kb = 8.617343*(10^-5); % Blotzmann constant [eV/K] %%1.38066*10^(-23) %%[J/K]
T = 300; %%Temperature [K]
q = 1.60218*(10^-19); % charge [C]
w0 = 1.5*kb*T; %%[eV]
n = 1.3 ;%How fast the value of 'lamda' decreases for higher average electron energies
A1 = 10.4314 * 10^-9;
A2 = 11.1765 * 10^-9;
%% boundary condition
w_max = 2; %%[eV]
lamda_min = 0.5 * 10^-9; %[m]
lamda_max = 7.5 * 10^-9; %[m]
%% relaxation length depending on average energy
lambda = piecewise(w<=w_max,(A1)*(w^n)*exp(-n*w/w_max) + lamda_min, w>w_max,(A2)*(w^n)*exp(-n*w/w_max));
%% solve ODE
ode = diff(w,x) == Eox - ((w-w0)/lambda);
cond = w(0) == w0;
ysol(x) = dsolve(ode,cond)
And this is error content...
다음 사용 중 오류가 발생함: mupadengine/feval_internal
Invalid equations.
오류 발생: dsolve>mupadDsolve (334번 라인)
T = feval_internal(symengine,'symobj::dsolve',sys,x,options);
오류 발생: dsolve (203번 라인)
sol = mupadDsolve(args, options);
오류 발생: ODE (29번 라인)
ysol(x) = dsolve(ode,cond)
help me plz....
I tried replacing lambda with a constant. Then It works. But I want to keep the lambda as a function for w.
My final goal is to draw a w-Eox graph.