You are just looking for the solution of the ODE with respect to time with a given set of initial conditions. Note: I am fairly certain that you are not using "phase portrait" correctly here. These other solvers are good tools to keep in mind if your solution is hanging sometimes one of the others will work and it will either give you what you want, or indicate that you have another problem somewhere else. Basically I solved it with ode15s and ode23s and found that the solution was unstable (population went off to infinity). See the MATLAB ODE solver documentation for more details. I figured out the issue in the ODE by first trying to solve your equation with some of the stiff ODE solvers in MATLAB. They evaluate to the same thing, but the former looks a little cleaner. Second, you can use the notation 8e-3 instead of 8*10^(-3). First, since you do not actually use the time value in your ODE, you can leave a ~ in place of the t that you had in your function definition as a stand-in for the unused input. A corrected code: function dX = CompetitionModel(~,X) According to the last paragraph of page 9 in the paper, N = S + Rl + Rh. I checked the ODE against the paper and found one mistake. I was wondering if there was perhaps a better way that I could get the solutions of the system dX. So I can't get to plotting until it's finished and I don't know if there are any errors in my code. MATLAB has been busy for the past 30 minutes and my laptop is starting to get really hot. I type the following into the command window: > = ode45('CompetitionModel',, ) ![]() My initial conditions are: S0 = 10^4 Rl0 = 0 Rh0 = 0, so this is what I have as y0. I get the tspan from the picture I posted. Ode45 has the syntax: = solver(odefun,tspan,y0). Here is what I have in an m-file: function dX = CompetitionModel(t,X)ĭX = [X(1) * (bs * (1 - N/K) - I - T - m1) - p * X(1) * (X(2) + X(3)) The system in question is what I have as dX. I would first like to recreate the left picture. I am trying to duplicate the graph of the solutions located in Figure 7 on page 20. ![]() I am trying to follow this research paper.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |