How can I find numerical solutions of discrete SIR model in MATLAB? - matlab

I was looking to simulate the discrete sir model in MATLAB and also to find stability and bifurcation graph. can anyone help me solve these problems?

A great source for Matlab scripts is the Mathworks file exchange. A search for the SIR model found:
https://www.mathworks.com/matlabcentral/fileexchange/75100-sir-epidemic-spread-model?s_tid=srchtitle
This should have what you're looking for (unfortunately don't have Matlab on this computer to check).
For the discrete sir equations a for loop as described in:
https://www.mathworks.com/matlabcentral/answers/325773-solving-difference-equation-with-its-initial-conditions
should be able to solve your system for fixed parameters. You're going have to do a bit of work to get the bifurcation diagram and stability. This answer:
Generate bifurcation diagram for 2D system
should get you going.

Related

Bode curve in simulink

I try to simulate a power electronic chopper like buck or boost or any of them to get the bode plot of model. but I can't do that.in the other word I can't use bode block in simulink.
please help me
Since the introduction of the Simulink Control Design Toolbox, you can use following approach to get the Bode plots of a Simulink model. You can find a more detailed explanation of this approach here.

MATLAB, how to make a rlocus for a MIMO system?

I have a MIMO system (2x2ss) and I want to make a rlocus plot considering both channels (feedback the first output with the first input and the second output with the second input). Since the rlocus works only for SISO system, I cannot manage to solve the problem. Has anyone some idea about it?
The adequate mathematical tool is Gersgorin bands. This is a graphical method to check stability of a MIMO system. I found a paper about controller desgin using Gershgorin bands Maybe going through the paper will help you.

How does Matlab Simbiology calculate pharmacokinetic (PK) non-compartmental (NCA) area under the curve (AUC)?

I can't seem to find the answer to my question in SimBiology's documentation.
Does anyone know how Matlab calculates the non-compartmental AUC? Does it use the linear / log-linear trapezoidal rule? How many points does it use to extrapolate the curve to infinity? Does it use log or linear extension?
Many thanks!

Generate bifurcation diagram for 2D system

Drawing bifurcation diagram for 1D system is clear but if I have 2D system on the following form
dx/dt=f(x,y,r),
dy/dt=g(x,y,r)
And I want to generate a bifurcation diagram in MATLAB for x versus r.
What is the main idea to do that or any hints which could help me?
You first have to do some math:
Setting each of the functions to zero gives you two functions y(x) (called the nullclines), which you can plot in a phase diagram. Where the two lines intersect are the fixed-points (equilibria) of your system.
Now, you have to take the jacobian of your system and plug each of those fixed-points in, which will give you the linear stability analysis of the system.
The location of the fixed points and the stability of each point can now be computed as a you vary r (the bifurcation parameter).
For the programming:
-use newton's method (fsolve in MATLAB) to find where the equations are zero
-eig will help you find the eigenvalues of the system.
However
It depends on your system.
If you're supposed to be looking for limit cycles or chaos or something, you'll have to use one of the ode solvers and then the analysis becomes more tricky. I suppose you could develop a poincare-bendixson algorithm, but that would be involved and details would depend on your system.
I don't think MATLAB has anything built in that would give you a bifurcation diagram. There is this third-party solution:
http://www.mathworks.com/matlabcentral/fileexchange/8382

Find class probabilities in matlab PNN and make ROC plot

I have a Probablistic Neural Network classification experiment set up in MATLAB. I can get the classes for unseen data using the sim command. Is there any way I can get the probabilities for the classes that the classifier calculates? Also, is there any direct way to plot the Reciever Operating Characterstic curve and calculate the Area Under the ROC for my classifier?
if you have the Statistics Toolbox, you can use perfcurve function added in recent versions of MATLAB to plot ROC curves and get AUC.
You may have better luck getting a response if you include a little more background and define your terms. I recognize ROC as receiver operating characteristic curve, but PNN and AUC are just alphabet soup to me. Don't make the mistake of assuming that someone outside of your very specific problem domain cannot help you. You have to build a bit of a language bridge by explaining your jargon first, though. This has the added advantage of making this particular question more useful to the stackoverflow community at large when it is eventually answered.