Differential Equation Solutions for Best Response and Logit Dynamics
조회 수: 4 (최근 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!
댓글 수: 0
채택된 답변
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.
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Gravitation, Cosmology & Astrophysics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!