Tag Info

New answers tagged

0

To set up the points for interpolation, I used two Tables. pts1 = Table[{p, U[p] /. soln[[p, 1]]}, {p, 0, 99}]; pts2 = Table[{p, U[p] /. soln[[p, 2]]}, {p, 0, 99}]; U1 = Interpolation[pts1]; U2 = Interpolation[pts2]; I still think there should be a better way than a For loop. It is terribly slow.


1

A walk-around defining an intermediary function (you may want a macro instead): Needs["DifferentialEquations`InterpolatingFunctionAnatomy`"]; makeNoExtrapFun[fun_, var_, def_] := If[IntervalMemberQ[Interval@@InterpolatingFunctionDomain@fun, var],fun[var],def,def] f = Interpolation[{1, 2, 1, 2, 1}, Method -> "Spline"]; k[x_] := makeNoExtrapFun[f, x, 0] ...


1

xB = {0.00, 0.076, 0.164, 0.300, 0.479, 0.638, 0.854, 0.941, 1.00}; pP = {44.0, 42.2, 39.5, 36.4, 30.4, 27.6, 22.4, 12.9, 0.00}; pT = {44.0, 66.4, 84.0, 99.8, 105.8, 108.4, 109.0, 104.5, 94.4}; iP = Interpolation[{xB, pP}\[Transpose]]; iT = Interpolation[{xB, pT}\[Transpose]]; Show[ Plot[{iP[x], iT[x]}, {x, Min[xB], Max[xB]}], ListPlot[{{xB, ...



Top 50 recent answers are included