ans =
Do you assume that every expression you can write down has an analytical, neatly written algebraic solution? Surely not.
Start by looking at what you have. A nice thing about using the symbolic TB here is it gives a pretty display. Far easier to read.
syms x s a n
((log(1-exp(-x/s)^(n))-log(1-a^(1-exp(-x/s)^(n))))/(1-a)) == 1/2
Multiply by a-1. If a is 1, then you are hosed anyway, so that costs little. Take the exponential of both sides to get rid of the logs. Still doable using pencil and paper.
Next, recognize that x, s, and n ALWAYS appear in exactly the same way, as exp(-x/s)^n. Call that something. I'll use the name u. That leaves us with the "simpler" problem (since the difference of logs is the log of the ratio)...
syms u
simplerelation = (1-u)/(1-a^(1-u)) == exp((1-a)/2)
If that has no solution, then the original one would have no solution. But seriously, I don't expect that even this simple version has any solution. Not every problem you can write down will have a simple solution. I definitely recall a wise person having said that just recently.
solve(simplerelation,u)
If you know the value of a, then you might be able to use a numeric solver to find a solution. For example,
usol = vpasolve(subs(simplerelation,a,1.5))
usol = vpasolve(subs(simplerelation,a,0.5))
So for some values of a, a solution might or might not exist. Now you could recover the value of x from the transformation to u we did before. But this presumes a KNOWN value for a. Without that, you are stuck.
Sigh, is there abolutely nothing we can do beyond that point? Well, yes. We can plot it, to see when a solution might exist. fimplicit is a terribly useful tool at times.
fimplicit(simplerelation)
xlabel a
ylabel u
grid on
hold on
plot(0.5,1.3299,'ro')
hold off
And there we can see a singularity when a==1. Ignore that line. I've plotted the solution we did find, just to convince you I labeled the axes correctly.
What you should take from this is that while no simple algebraic solution seems to exist, you can still do something. But it kind of presumes you know the value of a. Finally, could we have even gone further? Well, yes. If we had a good approximation for the resulting curve, thus u(a), we could actually end up with an expression, for x(a), as then an algebraic function also of s and n. For example, you might decide to find a series approximation for u(a), or perhaps a Pade approximation would seem reasonable, given the singularity at a==1.
As such, we might do something like this:
avec = linspace(0,1,100);avec(end) = [];
uvec = zeros(size(avec));
uvec = zeros(size(avec));
for i = 1:numel(avec)
uvec(i) = double(vpasolve(subs(simplerelation,a,avec(i))));
end
plot(avec,uvec)
And then we can try to remove the known singularity at a==1, like this:
plot(avec,uvec.*(1-avec))
This makes the problem far more well-behaved, as you can see.
mdl = fit(avec',(uvec.*(1-avec))','rat33');
plot(mdl,avec,uvec.*(1-avec))
How well does it work?
upred = @(A) mdl(A)./(1-A);
u_a = upred(0.5)
Which seems reasonably close. You can then expand the rational polynomial approximation, combined with n and s, to provide a complete, though only approximate solution to the original problem, valid over the region of support, here the half open interval [0,1). Again though, there simply is no theoretical solution, even though this would come as absolutely close to one as you could find.
We can do slightly better in trying to remove that essential singularity. This will allow us to use a lower order model, and still have a good approximation, or we can use the same rat33 approximation, and get a better fit.
mdl = fit(avec',(uvec.*(1-avec).^1.18)','rat33');
plot(mdl,avec,uvec.*(1-avec).^1.18)
upred2 = @(A) mdl(A)./(1-A).^1.18;
u_a = upred2(0.5)
So here we would find the final formula for x, as a function of a, n, and s as:
% x = -log(nthroot(upred2(a),n))*s;
And that is about as much of an expression for x, as a function of the three parameters as we can find. We could expand that, substituting in the rational polynomial expansion buried in mdl and upred. It would be pretty messy looking, so I'll stop here. Anyway, while you can't have absolutely everything you want, this is about as close as mathematics can take you. Other methods of approximation at the end might also help. For example, we might try a polynomial series approximation, or even try using a tool like chebfun. The nice thing about the rational polynomial is it is quite concise for the quality of the fit that can be achieved.