Ältere Kommentare anzeigen
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).
Akzeptierte Antwort
Weitere Antworten (2)
Arnaud Miege
am 27 Jul. 2011
0 Stimmen
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 Kommentare
Andrea
am 27 Jul. 2011
Arnaud Miege
am 28 Jul. 2011
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
am 28 Jul. 2011
Arnaud Miege
am 28 Jul. 2011
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
am 28 Jul. 2011
Matt Tearle
am 28 Jul. 2011
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
am 28 Jul. 2011
Good point, thanks Matt.
Andrea
am 28 Jul. 2011
Arnaud Miege
am 28 Jul. 2011
I don't have an account, so can't access either publication.
Andrea
am 28 Jul. 2011
Arnaud Miege
am 29 Jul. 2011
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
am 29 Jul. 2011
0 Stimmen
This is the results I get with your code:

2 Kommentare
Andrea
am 29 Jul. 2011
Arnaud Miege
am 29 Jul. 2011
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.
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
