{"id":"6243c15a-5db8-495c-947e-64f1dd3b1f87","arxiv_id":"1908.00717","paper_version":1,"verdict":"CONDITIONAL","confidence":"MODERATE","novelty_score":4.0,"correctness_risk":"medium","formal_verification":"none","parameter_count":0,"one_line_summary":"Lagrange2D is an open-source Mathematica package that computes FTLE fields, stretching vectors, Kaplan-Yorke dimension, and flushing times for time-varying two-dimensional flows.","lead":"This paper presents Lagrange2D, a Mathematica package for tracking particles in time-varying two-dimensional fluid flows and computing transport metrics like Lyapunov exponents and flushing times. It matters as a convenient open-source tool for researchers who work with analytic flow fields and want Lagrangian coherent structures without assembling separate MATLAB or Python libraries.","discovery_kind":"extension","skeptic_critique":{"model":"deepseek-v4-flash","headline":"Eq. 1 defines FTLE as (1/τ) max eig log(J) rather than (1/2τ) log λ_max(JᵀJ); if the code implements the printed formula, the package's headline output is not the standard FTLE, and no benchmark rules this out.","rationale":"I read the paper as a software contribution whose central promise is computing standard FTLE fields and LCS-related diagnostics from 2D velocity fields. That promise stands or falls with the FTLE definition and its implementation. The reader's weakest assumption identifies exactly the printed Eq. 1, and I agree with that concern. The formula is not the standard FTLE, no numerical benchmark is provided, and the qualitative Figure 1D cannot distinguish the two definitions. The concern is load-bearing because if the code follows Eq. 1, every downstream quantity that depends on Lyapunov exponents — including the Kaplan-Yorke dimension in Section 2.2 — inherits the error, and the package's claimed utility for LCS identification is unsupported. I give credit for the public source, the demo notebook, and the self-contained design; these make a concrete test feasible. The right outcome is unchanged from the reader's verdict: CONDITIONAL, pending inspection of the FTLE implementation. If the test shows the code uses the standard Cauchy-Green tensor, the paper should be accepted after correction of Eq. 1; if the test shows the code uses the printed formula, the central claim fails and the paper should be rejected or substantially revised. I therefore do not move the verdict.","tokens_in":5851,"tokens_out":4793,"duration_ms":51276,"concrete_test":"Clone the GitHub repository and inspect findFTLEField/findMaxFTLEField to determine whether they compute (1/(2τ)) log λ_max(JᵀJ) or (1/τ) log λ_max(J). Then run the package on the simple shear flow v=(y,0) over duration τ=1 on a small mesh and read the interior FTLE value. The analytic standard FTLE is 0.5 log((3+√5)/2) ≈ 0.481; the printed Eq. 1 gives 0. If the output is ≈0.481, the code is standard and Eq. 1 is a typo; if it is ≈0, the code implements the incorrect formula and the central utility claim fails. Optionally, compare the double-gyre FTLE field from Figure 1D against an independent implementation on the same grid to confirm quantitative agreement.","verdict_should_be":"UNCHANGED","load_bearing_attack":"The central claim is that Lagrange2D computes standard finite-time Lyapunov exponents. Section 2.1 defines λ(r) ≡ (1/τ) max[eig(log(dφ/dr))]. The standard FTLE is λ_τ(r) = (1/(2τ)) log λ_max((dφ/dr)ᵀ(dφ/dr)). The printed formula is wrong in two ways: it omits the factor 1/2 and it uses eigenvalues of the deformation gradient itself rather than the symmetric Cauchy-Green tensor. For simple shear v=(κy,0), the Jacobian has eigenvalues 1 and 1, so Eq. 1 gives zero identically, while the standard FTLE is positive for κτ ≠ 0. The formula is also rotation-dependent: a uniform rotation has no stretching, but log J has imaginary eigenvalues and the printed max eigenvalue criterion does not reduce to a measure of material stretching. The 'Solution method' says the package interpolates the displacement map and computes FTLE via finite differences, which is consistent with either definition; the paper does not show the implementation. The only example, Figure 1D, is qualitative, with no comparison to LCS Tool, an analytic flow, or any independent FTLE computation. Because FTLE is the central advertised utility, this is load-bearing: either the source code implements the standard Cauchy-Green formula and Eq. 1 is a documentation typo, or the package's primary output is not FTLE. A smaller issue, the odd unused definition of g in the code listing, does not affect this main concern.","agreement_with_reader":"agree"},"referee_report":{"model":"deepseek-v4-flash","summary":"The manuscript describes Lagrange2D, an open-source Mathematica package for Lagrangian analysis of two-dimensional time-varying fluid flows. It provides functions for advecting tracer ensembles, computing finite-time Lyapunov exponent (FTLE) fields, stretching vector fields, a Kaplan-Yorke dimension field, flushing/residence times, pathline plots, and videos. The theoretical background is presented in Sections 2.1 and 2.2, and a double-gyre example with six figure panels is used to illustrate the package's capabilities. The claimed contribution is a self-contained, easy-to-install tool that lets users go from an analytic or numerical velocity field to standard Lagrangian diagnostics in a single environment.","tokens_in":6151,"tokens_out":5192,"duration_ms":53562,"significance":"Software papers of this type are valuable when the implementations faithfully encode standard definitions and are vetted against known cases. The manuscript's strengths are the package's simple call syntax, absence of external dependencies, documentation, demo notebook, and the inclusion of video and mesh utilities. If the implementation matches the standard FTLE definition, the package would be a convenient complement to existing MATLAB/Python tools, especially for analytic flows in a symbolic environment. However, the paper does not include quantitative benchmarks or convergence tests, and the printed FTLE definition in Eq. (1) does not match the standard Cauchy-Green formulation; because FTLE is the headline diagnostic, the central claim is currently not established. The paper contains no fitted parameters and no circular reasoning; the risk is purely one of correctness and validation.","major_comments":[{"comment":"The printed definition λ(r) ≡ (1/τ) max[eig(log(dφτ0/dr))] is not the standard finite-time Lyapunov exponent. The standard FTLE is λ_τ(r) = (1/(2τ)) log λ_max(C), where C = (dφ/dr)^T (dφ/dr) is the right Cauchy-Green tensor. The manuscript's formula both omits the factor 1/2 and takes eigenvalues of the deformation gradient rather than of the strain tensor. For simple shear, this formula gives zero identically even though material lines stretch, and for a solid-body rotation it gives imaginary or otherwise ambiguous eigenvalues. Thus either Eq. (1) is a documentation error and the package actually computes the standard FTLE, or the package's principal output is not FTLE as commonly understood. The manuscript must state which, show the relevant implementation, and benchmark against an analytic or existing-tool FTLE calculation.","section":"Section 2.1, Eq. (1)"},{"comment":"No quantitative validation is provided. Figure 1D is qualitative, with no comparison to a ground-truth FTLE field, no mesh-refinement or integration-tolerance convergence study, and no run-time benchmarking. Because the central claim is that Lagrange2D computes standard quantities such as Lyapunov exponents, the paper should include at least one convergence check and one comparison against a published implementation or an exact solution.","section":"Section 3 and Program Summary, 'Solution method'"},{"comment":"For a two-dimensional incompressible flow the Lyapunov spectrum obeys λ1 + λ2 = 0, so the Kaplan-Yorke formula gives DKY = 2 identically. The text explicitly acknowledges j = 1 for incompressible flows but then presents a spatially varying DKY field for the double gyre, which is incompressible. It is not explained whether the variation arises from numerical violation of incompressibility, from a finite-time estimate, or from a different object entirely; this needs clarification because it affects the validity of the findKYDim diagnostic.","section":"Section 2.2, Eq. (2) and Figure 1E"}],"minor_comments":[{"comment":"The sentence 'we use estimates of the Lyapunov exponents generated by the FTLE calculation in (2)' should refer to Eq. (1), not Eq. (2), which is the Kaplan-Yorke definition.","section":"Section 2.2, after Eq. (2)"},{"comment":"The caption says panel D was generated using the function findFTLE, but Table 1 lists findFTLEField and findMaxFTLEField; the naming should be consistent.","section":"Figure 1 caption"},{"comment":"The function g[t_, x_, y_] is defined in the example code but never used; it should be removed or explained.","section":"Section 3.0.1, code listing"},{"comment":"The notation 'max[eig(log(...))]' is nonstandard; if Eq. (1) is corrected, the authors should define λ_max(C) explicitly and state the 1/(2τ) factor clearly.","section":"Section 2.1"},{"comment":"The definition of the finite-time Lyapunov exponent is attributed to review articles [6,7]; a primary citation for the definition and the Cauchy-Green strain tensor interpretation should be added.","section":"References"}],"recommendation":"major_revision","confidential_remarks":"The FTLE issue is likely a documentation typo, but because it affects the headline output it must be resolved before publication. If the editor has access to the repository, checking whether findMaxFTLEField uses (∇φ)^T (∇φ) would quickly settle the matter; the added benchmark will also clarify this."},"author_rebuttal":null,"desk_editor":{"model":"deepseek-v4-flash","letter":"Colleague,\n\nHere is my take on the Lagrange2D paper. What is actually new is the package itself: a single Mathematica interface that bundles trajectory integration, FTLE fields, stretching vectors, Kaplan-Yorke dimension, flushing times, pathlines, and video export. For people who work with analytically defined velocity fields in a symbolic environment, that is genuinely convenient; the established MATLAB/Python tools like LCS Tool and PATATO do not offer that integration. The code is public, GPLv3, and comes with a demo notebook, and the double-gyre examples look qualitatively reasonable. The citation pattern is fine: the LCS literature is standard, and the one self-citation to Flowtrace is contextual, not load-bearing.\n\nThe soft spot is the printed definition of FTLE. Equation (1) defines λ(r) = (1/τ) max[eig(log(dφ/dr))]. That is not the standard finite-time Lyapunov exponent, which is (1/(2τ)) log λ_max((dφ/dr)ᵀ(dφ/dr)). The printed formula omits the factor 1/2 and applies the logarithm to the deformation gradient rather than the symmetric Cauchy–Green tensor. For simple shear, the deformation gradient has unit eigenvalues, so Eq. (1) gives zero while the standard FTLE is positive. The formula is also rotation-sensitive in a way FTLE should not be. The solution-method text says FTLE is computed by finite differences on the interpolated displacement map, which is consistent with either definition, so the paper does not tell the reader which one the code implements. No benchmark against LCS Tool or an analytic flow is provided, and Figure 1D is only qualitative. A smaller issue: the code listing contains an unused definition of g, which is minor.\n\nIf the package source implements the standard Cauchy–Green formula and Eq. (1) is simply a typo, then this is a solid software paper needing a corrected formula and a validation figure. If the code implements Eq. (1) literally, the package's headline output is not FTLE and the central utility claim fails. Since the source is on GitHub, a referee can resolve this in an hour. Given that the package is a serious, self-contained contribution and the issue is checkable, I would send it to peer review rather than desk reject. The author should be asked to verify the implementation against a known case and fix Eq. (1).","headline":"Useful Mathematica package for Lagrangian diagnostics, but the printed FTLE formula is not the standard one; a referee must check the code to see whether the headline output is correct.","tokens_in":6659,"tokens_out":3340,"would_cite":false,"duration_ms":30681,"reading_group":"yes","serious_thinker":"yes","would_accept_peer_review":true},"rs_alignment":null,"lean_confirmation":null,"pith_extraction":{"msc":[],"pacs":[],"model":"deepseek-v4-flash","headline":"A self-contained Mathematica package computes the full set of Lagrangian transport diagnostics—FTLE fields, stretching directions, Kaplan-Yorke dimension, flushing times—from any specified two-dimensional, time-varying velocity field.","keywords":["Lagrangian transport","finite-time Lyapunov exponents","Lagrangian coherent structures","Kaplan-Yorke dimension","flushing time","two-dimensional fluid flow","Mathematica package","trajectory integration"],"falsifier":"Run findMaxFTLEField on a uniform shear flow $v_x = \\dot{\\gamma} y$ (or any flow with a known closed-form deformation gradient), and compare the returned field with $\\frac{1}{2\\tau}\\log\\lambda_{\\max}\\big((\\nabla\\varphi)^\\top\\nabla\\varphi\\big)$. If the output matches Eq. (1)'s $\\frac{1}{\\tau}\\log\\lambda_{\\max}(\\nabla\\varphi)$ instead, the package is not computing the standard FTLE; if it matches the Cauchy-Green expression, the printed formula is a typo and the central claim stands.","tokens_in":5631,"feed_emoji":"🌊","tokens_out":7882,"duration_ms":76005,"temperature":0.7,"pith_summary":"The paper introduces Lagrange2D, a Mathematica package intended to take an arbitrary two-dimensional, time-varying velocity field, specified either analytically or numerically, and produce the usual Lagrangian diagnostics: finite-time Lyapunov exponent fields, stretching vector fields, a Kaplan-Yorke fractal-dimension field, and flushing times, along with pathline plots and animations of advected tracers. The motivation is that unsteady flows are poorly summarized by Eulerian snapshots, and existing Lagrangian tools live in MATLAB and Python, which makes symbolic analysis of analytically defined flows awkward. The package advects a mesh of initial conditions, interpolates the resulting displacement map, and derives all diagnostics from that one map by finite differences, so no separate machinery is needed for each quantity. The paper demonstrates the workflow on the double-gyre flow and reports that ridges in the computed maximal FTLE field line up with the material barriers seen when a blob of particles is advected. The central claim is that users can obtain all of these quantities from a few short commands in a symbolic algebra environment.","feed_headline":"One Mathematica package maps any 2D flow's transport barriers","feed_subtitle":"FTLE ridges, stretching fields, Kaplan-Yorke dimension, and flushing times come from one trajectory integration.","key_machinery":"The carrier of the argument is the finite-time flow map $\\varphi^\\tau_0$. The package builds it by taking a mesh of initial conditions, integrating each trajectory forward for a duration $\\tau$ with a variable-step integration scheme, and interpolating the resulting displacement field with Mathematica's built-in interpolation. All subsequent quantities are finite-difference derivatives of that map: FTLE comes from the logarithm of its deformation gradient (Eq. 1), stretching lines from the associated eigenvectors, the Kaplan-Yorke dimension from a ranked combination of the exponents (Eq. 2), and flushing times from trajectory exit statistics. Because the interpolation replaces the raw trajectory endpoints with a smooth map, the same object can be differentiated many times for different diagnostics without re-integrating.","core_discovery":"The central claim is that a single, self-contained package can take a two-dimensional unsteady velocity field and return the full set of Lagrangian transport diagnostics without any additional software. Given an analytic or interpolated velocity field $(v_x,v_y)(x,y,t)$, Lagrange2D numerically integrates an ensemble of trajectories from a user-supplied mesh, interpolates the finite-time flow map $\\varphi^\\tau_0$ that sends each initial position to its position after a time $\\tau$, and then uses finite-difference operations on that map to compute the maximal finite-time Lyapunov exponents (Eq. 1), the maximal and minimal stretching vector fields, the Kaplan-Yorke dimension (Eq. 2), and the flushing-time field. All of these are presented as outputs of a common trajectory integration, so the same mesh and integration duration serve every diagnostic. The paper claims this approach is accurate enough that FTLE ridges coincide with the kinetic barriers visible in particle advection, and that the stretching and flushing-time fields reveal the expected asymmetry of the flow.","pith_inferences":["If the printed Eq. (1) is what the code implements, the FTLE output is not the standard finite-time Lyapunov exponent: standard FTLE uses the largest eigenvalue of the Cauchy-Green strain tensor $(\\nabla\\varphi)^\\top\\nabla\\varphi$ with a prefactor $1/(2\\tau)$, not the logarithm of $\\nabla\\varphi$ alone. Checking the package output against this definition on a flow with a known deformation gradient","The same interpolated flow-map construction could support additional deformation-gradient diagnostics, such as finite-time rotation, stretching angle, or Okubo-Weiss-type invariants, with no new trajectory integrations, since the map is already available.","Because the package accepts numerically specified velocity fields, it could in principle be coupled with experimentally measured particle-image-velocimetry fields, although the paper only demonstrates analytic flows."],"forward_implications":["Users can go from an analytic flow definition to FTLE fields, stretching fields, and videos in a few notebook commands, without writing trajectory-integrating code.","FTLE ridges computed by the package provide candidate Lagrangian coherent structures for flows that lack closed-form transport barriers, offering a quick screen for eddies and manifolds.","The Kaplan-Yorke dimension field gives a spatially resolved, time-scale-dependent picture of where particles cluster, distinguishing regions of filamentation from regions with no localization tendency.","Flushing-time fields can be computed on any user-specified domain and integration window, directly quantifying residence-time asymmetries in unsteady flows.","Because the package is self-contained, it can be used inside a symbolic setting to compare transport properties across many analytic flows with little setup cost."],"supporting_citations":[{"why":"Supplies the finite-time Lyapunov exponent and Lagrangian-coherent-structure definitions that the package's FTLE and stretching outputs are built on.","marker":"[6]"},{"why":"Establishes that ridges in the maximal FTLE field mark kinetic barriers to transport, the central visualization claim tested in the examples.","marker":"[5]"},{"why":"Provides the Lagrangian-coherent-structures context that connects FTLE ridges to material barriers in the flow.","marker":"[7]"},{"why":"Defines the Kaplan-Yorke dimension that the findKYDim function implements.","marker":"[13]"},{"why":"Defines the double-gyre flow used throughout the paper's example computations and figures.","marker":"[16]"}],"fun_headline_variants":["Lagrange2D: one trajectory run, every Lagrangian flow metric","Mathematica package: FTLE, stretching, Kaplan-Yorke, flushing times","Single trajectory integration yields FTLE, stretching, and flushing","All Lagrangian diagnostics for 2D flows from one Mathematica package","Lagrange2D: FTLE ridges, stretching fields, flushing times in one toolbox"],"cache_read_input_tokens":3200,"weakest_assumption_plain":"Everything hinges on whether the package's Lyapunov-exponent output matches the standard definition; Eq. (1) as printed takes the logarithm of the deformation-gradient matrix itself, rather than of the symmetric Cauchy-Green strain tensor, and no test in the paper shows the two agree.","fun_headline_variants_meta":{"raw":{"variants":["Lagrange2D: one trajectory run, every Lagrangian flow metric","Mathematica package: FTLE, stretching, Kaplan-Yorke, flushing times","Single trajectory integration yields FTLE, stretching, and flushing","All Lagrangian diagnostics for 2D flows from one Mathematica package","Lagrange2D: FTLE ridges, stretching fields, flushing times in one toolbox"]},"model":"deepseek-v4-flash","effort":"low","cost_usd":0.000635,"raw_usage":{"total_tokens":2895,"prompt_tokens":875,"completion_tokens":2020,"prompt_tokens_details":{"cached_tokens":384},"prompt_cache_hit_tokens":384,"prompt_cache_miss_tokens":491,"completion_tokens_details":{"reasoning_tokens":1924}},"tokens_in":491,"tokens_out":2020,"duration_ms":14881,"temperature":1.0,"reasoning_tokens":1924,"cache_read_input_tokens":384,"cache_creation_input_tokens":0},"cache_creation_input_tokens":0},"created_at":"2026-08-14T15:34:40.955214+00:00","model_set":{"reader":"deepseek-v4-flash"},"falsifier":"Run findMaxFTLEField on a uniform shear flow $v_x = \\dot{\\gamma} y$ (or any flow with a known closed-form deformation gradient), and compare the returned field with $\\frac{1}{2\\tau}\\log\\lambda_{\\max}\\big((\\nabla\\varphi)^\\top\\nabla\\varphi\\big)$. If the output matches Eq. (1)'s $\\frac{1}{\\tau}\\log\\lambda_{\\max}(\\nabla\\varphi)$ instead, the package is not computing the standard FTLE; if it matches the Cauchy-Green expression, the printed formula is a typo and the central claim stands.","supporting_citations":[{"cited_title":"Haller, Lagrangian coherent structures, Annual Review of Fluid Me- chanics 47 (2015) 137–162","cited_arxiv_id":null,"evidence_quote":"Supplies the finite-time Lyapunov exponent and Lagrangian-coherent-structure definitions that the package's FTLE and stretching outputs are built on."},{"cited_title":"Haller, G","cited_arxiv_id":null,"evidence_quote":"Establishes that ridges in the maximal FTLE field mark kinetic barriers to transport, the central visualization claim tested in the examples."},{"cited_title":null,"cited_arxiv_id":null,"evidence_quote":"Provides the Lagrangian-coherent-structures context that connects FTLE ridges to material barriers in the flow."},{"cited_title":"Kaplan, J","cited_arxiv_id":null,"evidence_quote":"Defines the Kaplan-Yorke dimension that the findKYDim function implements."},{"cited_title":null,"cited_arxiv_id":null,"evidence_quote":"Defines the double-gyre flow used throughout the paper's example computations and figures."}],"review_version":1}