Differential Equation Solutions for Best Response and Logit Dynamics

5 views (last 30 days)
Hello,
I am trying to create programs that generate the orbits for the best response and the logit dynamics. I keep getting errors that state there are too many output arguments. Here is the complete program of my attempted logit dynamics:
function [T,Y] = logit_dynamic(A,eta,Init_Y,Max_T)
% Orbit of the continuous best response dynamic. %
% Define the best response dynamic.
function logit(t,y)
dy = exp((eta^-1)*A*y)./sum(exp((eta^-1)*A*y)) - y ;
end
[T,Y] = ode45(@logit,[0,Max_T],Init_Y) ;
end
And here are the error messages I keep getting:
Error using logit_dynamic/logit Too many output arguments.
Error in odearguments (line 90) f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 115) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in logit_dynamic (line 10) [T,Y] = ode45(@logit,[0,Max_T],Init_Y) ;
Is there an easy solution to this? Thank you ahead of time!

Accepted Answer

Torsten
Torsten on 6 Feb 2017
function [T,Y] = logit_dynamic(A,eta,Init_Y,Max_T)
% Orbit of the continuous best response dynamic. %
[T,Y] = ode45(@(t,y)logit(t,y,A,eta),[0,Max_T],Init_Y) ;
end
% Define the best response dynamic.
function dy = logit(t,y,A,eta)
dy = exp((eta^-1)*A*y)./sum(exp((eta^-1)*A*y)) - y ;
end
Best wishes
Torsten.

More Answers (1)

Peter Vanderschraaf
Peter Vanderschraaf on 6 Feb 2017
Thank you Torstern, this works spendidly!

Categories

Find more on Gravitation, Cosmology & Astrophysics in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!