Differential Equation Solutions for Best Response and Logit Dynamics

5 次查看(过去 30 天)
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!

采纳的回答

Torsten
Torsten 2017-2-6
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.

更多回答(1 个)

Peter Vanderschraaf
Thank you Torstern, this works spendidly!

类别

Help CenterFile Exchange 中查找有关 Gravitation, Cosmology & Astrophysics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by