Differential Equation Solutions for Best Response and Logit Dynamics
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Peter Vanderschraaf
il 6 Feb 2017
Risposto: Peter Vanderschraaf
il 6 Feb 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 Commenti
Risposta accettata
Torsten
il 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.
0 Commenti
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Gravitation, Cosmology & Astrophysics in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!