ODEs system
이전 댓글 표시
i'm trying to solve this system of differential equations, can someone told me how to use the ODE45 function?
dPp/dz= Pp*gammap*(sigmape*N2 −sigmapa*N1)−α*Pp;
dPs/dz= Ps*gammas*(sigmase*N2 −sigmasa*N1)−α*Ps:
dPASE/dz=PASE*gammas*(sigmaSE*N2-sigmasa*N1)+2*sigmase*h*gammas*Vs*Δv-alfas*PASE;
with N1=ρ*(1+W12*t)/(1+(W12+W21)*t+R*t)
N2=ρ*(R*t+W21*t)/(1+(W12+W21)*t+R*t)
W12=[(sigmasa*gammas) / (h*Vs*A)](Ps+PASE) W21=[(sigmase*gammas) / (h*Vs*A)](Ps+PASE) R=[(Pp*gammap*sigmapa) / (h*Vp*A)](Ps+PASE)
(gammap,gammas,sigmase,sigmape,sigmapa,sigmasa,h,Vs,Vp,A,Δv,α,ρ are known parameters).
채택된 답변
추가 답변 (2개)
Arnaud Miege
2011년 7월 27일
0 개 추천
Have a look at the examples provided in the documentation. You need to write a function that computes the derivatives of your variables as a function of time and the variables themselves, and pass this to the ode solver.
HTH,
Arnaud
댓글 수: 11
Andrea
2011년 7월 27일
Arnaud Miege
2011년 7월 28일
I noticed there's no dependency on z in the calculation of dydz. Is that intentional? I can't really comment on the correctness of your equations, it's up to you to check that. The solver is able to solve the equations, so if the results are not what you expect, you probably want to double-check your equations are correct.
I also notice that you are multiplying/dividing some pretty small numbers by some pretty large ones. You might want to try and scale some of your parameters/variables to get a better conditioned system.
Andrea
2011년 7월 28일
Arnaud Miege
2011년 7월 28일
If the derivatives of these variables do not depend on z through the differential equations (which is what you have in your code), then that's fine. If they do depend on z, then something's not right. The equations may be right, but have you checked they're coded correctly in MATLAB? Also, what do you mean by "the results are not so good".
Andrea
2011년 7월 28일
Matt Tearle
2011년 7월 28일
Minor dumb thing: your function is signalFW but you're calling ode45 on signalFWprova. Assuming these are the same, I get sensible-looking results, so maybe you should post a link to the article or something like that so we can see what the results should look like.
Arnaud Miege
2011년 7월 28일
Good point, thanks Matt.
Andrea
2011년 7월 28일
Arnaud Miege
2011년 7월 28일
I don't have an account, so can't access either publication.
Andrea
2011년 7월 28일
Arnaud Miege
2011년 7월 29일
Can you just upload an image of the equations and the results you expect for certain numerical parameters?
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
Arnaud Miege
2011년 7월 29일
0 개 추천
This is the results I get with your code:

댓글 수: 2
Andrea
2011년 7월 29일
Arnaud Miege
2011년 7월 29일
The code looks correct if you refer to equations (1) to (9) of the paper. However, you should check that the units used for the various parameters are consistent, and that the numerical values make sense.
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
