Differential Equation Solutions for Best Response and Logit Dynamics
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Peter Vanderschraaf
el 6 de Feb. de 2017
Respondida: Peter Vanderschraaf
el 6 de Feb. de 2017
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!
0 comentarios
Respuesta aceptada
Torsten
el 6 de Feb. de 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.
0 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Gravitation, Cosmology & Astrophysics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!