# Possible to solve this function?

I have this function:

Emax[T_, d_] := -(1/2) + d + d/(-1 + E^(d/T)) - 1/2 Coth[1/(2 T)];


All I want is to transform this Function so I get:

T[Emax_, d_] := .....


I just want to be able to put in Emax and d value and get the correspoding T. If tried doing tables and stuff but it doesn't work as I would want it to:/

• Mathematica can't invert that equation exactly. Is an approximation acceptable? around which values? (I assume you mean Exp[(d/T)]) Aug 21 '18 at 13:32
• Exact solutions, if they exist, can be found for specific values using constructs like t /. Solve[1 == Emax[t, 7/3], t, Reals]. Also, you probably want to replace e with E. You can also find equation solutions for specific values of d: InverseFunction[Emax[#, 2] &] Aug 21 '18 at 13:49
• @rhermans Hm, I guess an approximation would be a good start. Aug 21 '18 at 13:52
• @kirma Ok, I'll try that out and report back. Thanks Aug 21 '18 at 13:52

The numerical function T[em,d]:

solT[em_?NumericQ, d_?NumericQ] := T /. NMinimize[{1,
{T > 0,em == -(1/2) + d + d/(-1 + Exp[d/T]) - 1/2 Coth[1/(2 T)]}},T][[2]]

solT[3, 2]
(*0.0259196*)

• This worked very nice! Thanks, I'm finally making some progress. But I ran into a few issues :/ 1. Numerical solutions are not continous. It's possible that for certain combinations of em and d there will be no value for T which would cause the programm to crash. Ideas ? 2. The thing is I am trying to use this function in a plot in which I continously can change values of em and d. This causes massive lag. For single values it's fine though. 3. Would it be rather possible to get a simpler/continous approximation for the value of T? Aug 21 '18 at 14:51
• And last but not least: I was trying to use certain values for solT solT[List[a,b,c][[2]], d] For d it worked fine in the plot since d is one of the dynamical variables I can change. But apparently taking one certain entry from List which looks sth. like this: {10,7,5,6,3} and what I did with List[[2]] was to single the value 7 out, has the wrong format or something. Either way I connot use it for solT[List[[2]],d] to get vaules. Any ideas how to change the format ? Thanks Aug 21 '18 at 14:56
• solT[{0.1, .5, .62}[[3]], 2] works! So your second question seems to be an issue of Dynamic variables? Aug 21 '18 at 15:23
• Your first question: If you plot Emax[d,T] let's say in the range 0<T<5 for d=Range[ 1,3,.1}you get the region of admissable parametervalues. In this region the solution T exists and the numerical function solT will find T! Aug 21 '18 at 15:27
• Hm I see, then yes it must be a problem with the Dynamical Variable. You see all I want is to use the solT[em,d] Value is in a plot as Limit for the manipulate variable T. So in a Sense I want Manipulate[ListPlot[MinVar[T, R, d], {T, 1,solT[em, d]}, {R, 10, 20},{d,10,20}] Now d is easy because it is also a manipulate variable. But for em I need a value from another dynamical List that is changing constantly as I change the manipulate variables. Aug 22 '18 at 10:29

Here is one approach:

einv = InverseFunction[-(1/2) + d + d/(-1 + E^(d/#)) - 1/2 Coth[1/(2 #)] &]


To use this, you need to specify a value of d, for example:

N[einv[5] /. d -> 5]
N[einv[0] /. d -> 1]


To plot, you can do something like:

e2[dval_] = Abs[N[einv[0] /. d -> dval]];
ListPlot[e2[#] & /@ Range[1, 10, 0.1]]


Of course, you can also change the "0" to a range of values.

• Thanks but the thing is I need this thing to be dynamic :/ I am using a manipulate[Plot[...] {d,1,10},{Emax,1,10}] where I change d or Emax constanantly. That's why I want a function for T, to get constantly a new T which corresponds to any d or Emax I currently have. Understand what I mean? Aug 21 '18 at 13:56
• Your question explicitly states: "I just want to be able to put in Emax and d value and get the correspoding T." Aug 21 '18 at 14:38