Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
mutualim

Subject: mutualim

From: Mariana

Date: 17 Dec, 2010 18:45:21

Message: 1 of 2

Hi everybody

Im studing a mathematical model for mutualism developed by Joan Roughgardem, and i woul like to do the stability analysis and a simulation with matlab, but there are some things that i dont know how to do.. some one make something like that yet?

I have a Matlab code for this mutualism model that Roughgardem have published in her book, but she have used a Matlab 5.1 version, and i get a 5.3 version to try this codes, but it dont work, this is a part of it:

dn1='(r-b*n1+beta*n2)*n1'
dn2='(r-b*n2+beta*n1)*n2'

[n1hat n2hat]=solved(dn1,dn2,'n1,n2')

jacob=jacobian(sym([dn1';'dn2]), sym('[n1,n2]'));
jacob=subs(jacob,sym(n1hat,4,1),'n1');
jacob=subs(jacob,sym(n2hat,4,1),'n2');
jacob=simple(jacob);
trace=simple(symop(sym(jacob,1,1),'+',sym(jacob,2,2)))
determinant=simple(determ(jacob))
discriminant=simple(symop(trace,'^','2','-','4','*',determinant))

in the first sequence she in the equation, tha are a differential equation,
in the second sequence she find the jacobian
in the trhird sequence she find the trace, determinant, and discriminant for the jacobian..

ok i put these codes and dont compiles.. :(

some idea?

thanks a lot

Subject: mutualim

From: Sean de

Date: 17 Dec, 2010 19:01:23

Message: 2 of 2

"Mariana " <mariana.uzeda@gmail.com> wrote in message <iegb41$7ir$1@fred.mathworks.com>...
> Hi everybody
>
> Im studing a mathematical model for mutualism developed by Joan Roughgardem, and i woul like to do the stability analysis and a simulation with matlab, but there are some things that i dont know how to do.. some one make something like that yet?
>
> I have a Matlab code for this mutualism model that Roughgardem have published in her book, but she have used a Matlab 5.1 version, and i get a 5.3 version to try this codes, but it dont work, this is a part of it:
>
> dn1='(r-b*n1+beta*n2)*n1'
> dn2='(r-b*n2+beta*n1)*n2'
>
> [n1hat n2hat]=solved(dn1,dn2,'n1,n2')
>
> jacob=jacobian(sym([dn1';'dn2]), sym('[n1,n2]'));
> jacob=subs(jacob,sym(n1hat,4,1),'n1');
> jacob=subs(jacob,sym(n2hat,4,1),'n2');
> jacob=simple(jacob);
> trace=simple(symop(sym(jacob,1,1),'+',sym(jacob,2,2)))
> determinant=simple(determ(jacob))
> discriminant=simple(symop(trace,'^','2','-','4','*',determinant))
>
> in the first sequence she in the equation, tha are a differential equation,
> in the second sequence she find the jacobian
> in the trhird sequence she find the trace, determinant, and discriminant for the jacobian..
>
> ok i put these codes and dont compiles.. :(
>
> some idea?
>
> thanks a lot

The above code requires the Symbolic Math Toolbox. If you type:
ver
at the MATLAB command line, does it say if you have it?

-Sean

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us