ODE coupled with classic equation
이전 댓글 표시
Hi everybody.
After some research can't found a solution..
I have 2 variable wich depend on time : E and W(E)
then I have an differential equation of rho inked to W so linked to E so linked to t.
Can I use E et W as vector inside the ODE declaration?
clc
clear all
close all
u=2.405;
c=3e8;
T0=100e-15;
lambda0=515e-9;
w0=2.*pi.*c./lambda0;
Ej=100e-6;
Pp=Ej./T0;
r=18e-6;
th=250e-9;
s=0.085;
dt=T0./1000;
t=-T0*5:dt:T0*5;
Fs=1./dt;
nn=length(t),
freq = Fs*linspace(0,(nn/2),(nn/2)+2)/nn+c/lambda0;
freq=fliplr(freq(1:end-1));
l=c./freq;
ll=-fliplr(l);
lll=ll-ll(1)+l(end);
lll = (circshift(lll',-1))';
lambda=[l lll];
lambda=lambda(1:end-1);
w=2.*pi.*c./lambda;
E=Pp.*exp(-(t./T0).^2).*cos(w0.*t);
% plot(t,E)
a=r.*( 1+ s.*(2*pi.*c).^2./ (w.*w.*r.*th) ).^(-1);
% plot(lambda,a)
a=9.9992e28;
b=3.5482e11;
rho0=2.7e26;
W=a./(abs(E)).*exp(-b./(abs(E)));
syms rho(t) EE(t) WW(t)% Y ;
ode1= EE== Pp.*exp(-(t./T0).^2).*cos(w0.*t);
ode2 = WW==a./(abs(EE)).*exp(-b./(abs(EE)))
ode3 = diff(rho,t) == W(t) .*(rho0 - rho);
ode=[ode1 ode2] ode3
rhoSol=solve(ode)
%%%or
yms rho(t) ;
ode = diff(rho,t) == W(t) .*(rho0-rho);
rhoSol=solve(ode)
If you have an idea to solve this?
Regards
MM
댓글 수: 2
darova
2019년 10월 23일
Do you have source formula/equation?
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



