1function [QN, UN, RN, TN, CN, XN, t, QNt, UNt, TNt, xvec] = solver_fluid_analyzer_jline(network, options)
2% [QN, UN, RN, TN, CN, XN, T, QNT, UNT, TNT, XVEC] = SOLVER_FLUID_ANALYZER_JLINE(QN, OPTIONS)
4% Copyright (c) 2012-2026, Imperial College London
7%%%% Returning Result from JLINE %%%%
9jmodel = LINE2JLINE(network);
10jsolver = JLINE.SolverFluid(jmodel);
11import jline.solvers.fluid.*;
13jsolver.options.method = options.method;
14jsolver.options.stiff = options.stiff;
15result = jsolver.runMethodSpecificAnalyzerViaLINE();
17%%%% Migrating Result from JLINE SolverResult to native MatLab data structures %%%%
19M = jmodel.getNumberOfStatefulNodes; %number of stations
20K = jmodel.getNumberOfClasses; %number of
classes
33Tmax = result.t.length();
34t = NaN*zeros(Tmax, 1);
38 QN(ist,jst) = result.QN.get(ist-1, jst-1);
39 UN(ist,jst) = result.UN.get(ist-1, jst-1);
40 RN(ist,jst) = result.RN.get(ist-1, jst-1);
41 TN(ist,jst) = result.TN.get(ist-1, jst-1);
46 CN(1,jst) = result.CN.get(0, jst-1);
47 XN(1,jst) = result.XN.get(0, jst-1);
53 QNt{ist,jst}(p,1) = result.QNt(ist,jst).get(p-1, 0);
54 UNt{ist,jst}(p,1) = result.UNt(ist,jst).get(p-1, 0);
55 TNt{ist,jst}(p,1) = result.TNt(ist,jst).get(p-1, 0);
61 t(p,1) = result.t.get(p-1, 0);
64% NOTE: JLINE designed such that odeStateVec
is not returned to LINE