Using only the first cbMax
amount of $c_b$s, we get:
getmodel[a_, cbMax_] := With[{cb = Table[FindRoot[cb Cot[cb] + a L, {cb, Pi (n + 1/2),
n Pi, (n + 1) Pi}][[1, 2]], {n, 0, cbMax}]},
1 - Sum[2 cb[[i]] Sin[cb[[i]] x/L] E^(a x), {i, cbMax + 1}]]
And now notice that for the rest of the $c_b$s, the difference becomes constant (Pi) very fast:
ListPlot[Differences[Table[FindRoot[cb Cot[cb] + 1, {cb, Pi (n + 1/2),
n Pi, (n + 1) Pi}][[1, 2]], {n, 0, 100}]]]

Hence a good approximation to account for the rest of the $c_b$s could be
FullSimplify[Sum[2 (cb[[-1]] + i Pi) Sin[(cb[[-1]] + i Pi) x/L] E^(a x), {i, \[Infinity]}]]
(*(2 E^((a + (I Pi)/L) x) ((Pi + cb[[-1]]) Sin[(x cb[[-1]])/L] -
cb[[-1]] Sin[(x (Pi + cb[[-1]]))/L]))/(-1 + E^((I Pi x)/L))^2*)
So the final expression for the model function becomes:
getmodel[a_, cbMax_] := With[{cb = Table[FindRoot[cb Cot[cb] + a L,
{cb, Pi (n + 1/2), n Pi, (n + 1) Pi}][[1, 2]], {n, 0, cbMax}]},
1 - Sum[2 cb[[i]] Sin[cb[[i]] x/L] E^(a x), {i, cbMax + 1}] -
((2 E^((a + (I Pi)/L) x) ((Pi + cb[[-1]]) Sin[(x cb[[-1]])/L] -
cb[[-1]] Sin[(x (Pi + cb[[-1]]))/L]))/(-1 + E^((I Pi x)/L))^2)]
Depending on the x
-values of your data, a
and L
choose some cbMax
that is sufficiently high for the model to converge and then do:
error[a_?NumericQ] := (
y[x_] = getmodel[a, cbMax]; Total[(dataY - Map[y, dataX])^2])
FindArgMin[error[a], {a, 1, 2}]
And there is a
.