differential equations

4 次查看(过去 30 天)
han-byeul Oh
han-byeul Oh 2023-3-21
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.

回答(1 个)

Manikanta Aditya
Manikanta Aditya 2023-4-28
Hi
As per my understanding, when you are trying to solve the differential equation, you are getting an error ‘mupadengine/feval_internal Invalid Equation’.
The ‘dsolve()’ doesn’t provide the functionality to provide that as an input argument to the function.
You can check the following MATLAB Answer to resolve the error:
Please refer to the following documentation for more info on:
I hope this resolves the issue you were facing.

类别

Help CenterFile Exchange 中查找有关 상미분 방정식 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!