Plotting a symbolic double integral with ezcontour

1 view (last 30 days)
I'm getting familiar with the symbolic matlab package, and want to run a parameter sweep in two dimensions, siginflec and leak, and get a contour plot of the results
syms t t0 tpast T siginflec leak reward x y;
% deriv of function at time t0
% *needs params {siginflec, t0} to return a double
fprime = 1. / (1. + exp(-siginflec*t0));
% determines the temporal-discounted-running average of the deriv
% *needs params {siginflec, leak, t} to return a double
leakyderiv = int(exp(-leak*(t-tpast)) * subs(fprime, t0, tpast),...
tpast, [0, t]);
% integral of the above term across an episode
% *needs params {siginflec, leak, T}
evleakyderiv = int(leakyderiv, t, [0, T]);
I've confirmed that when I run double(subs(evleakyderiv, {siginflec, leak, T}, {1., 1., 1.})), I get a value (0.2161 if you want to validate).
However, when I try to run
ezcontour(subs(evleakyderiv, {T}, {1.}), [0., 100.], 101)
I get the following error:
Undefined function or variable 't'.
Error in symengine>makeFhandle/@(x,y)int(int(exp(-y.*(t-tpast))./(exp(-tpast.*x)+1.0),tpast,0.0,t),t,0.0,1.0)
I've tried replacing siginflec and leak with x and y to see if that makes it play nice with ezcontour, as well as
ezcontour(subs(evleakyderiv, {siginflec, leak, T}, {x, y, 1.}), [0., 100.], 101)
to see if the vars needed to be passed directly to the function, but no go. Can someone help me what I'm doing wrong? I'm going off the the example here.

Answers (0)

Categories

Find more on Symbolic Math Toolbox 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!