This code is for the model described in Behavioral time scale plasticity of place fields: Mathematical analysis. "main_BTSP_model.m" includes the main code for the simulations - upon running it, the presynaptic inputs, fixed point synaptic weights, and convergence to fixed point ramp amplitude will be plotted. Variables are included to change from circular to linear boundary conditions, to change the location/magnitude of the plateau potential, etc. Comments are included in the file for further instruction. "numerical_velocity.m" includes the numerical solutions for a range of velocities, either in the circular or linear case. "analytical_fixed_point.m" replicates Figure 9 of the main text by plotting the analytical solution outlined in the Appendix. Comments are included in the file for further instruction. This code was written and run in MATLAB 2020a. Please direct any questions to iancone(at)rice(dot)edu.