Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm running into an issue where it seems Mathematica is not fully evaluating the output of my function h[t_]. I included the definition of phi[t_] just to demonstrate that it is a numerically defined function in case that is what's causing the problem. This is causing the plot for h[t_] to turn up blank, because I guess the evaluation at each point is not numeric.

Does anyone have some idea what's going on? I'm a bit of a Mathematica noob, I just recently switched from Maple which shit the bed so hard on a computation I was trying to do that I had to find an alternative software. Thanks! (Also, m,u,a are all defined as constants at the beginning of the notebook)

phi[t_] = 
 With[{a = E^-25, b = 1/4}, 
   NDSolve[{x'[t] == (
      8/20^4*(x[t])^2*(1 - a*E^(400*(x[t])^2)) - (6*(3/
          10)^4*(1/20^2*((x[t])^2 - b^2) - 
           1/20^4*(a*E^(400*(x[t])^2) - 1))))/((3/
        10)^2*(3*(3/10)^4 - (4/
           20^2*(1 - a*E^(400*(x[t])^2))) + (8*(x[t])^2*a*E^(
           400*(x[t])^2)))), x[0] == 0}, x[t], {t, -140, 140}]][[1,All,2]] 

h[t_] := N[(2*m^2*phi[t])/(3*u^2)*(1 - a*E^(phi[t]/m)^2)]


(*  {0.000104884 (1. - 1.01291/e^25)} *)
share|improve this question
Just move the a from the Block to gobal. You are using a in h[t] but h[t] does not see it. screen shot: !Mathematica graphics I do not know where the e you show came from. I do not see this on my end. –  Nasser Apr 22 '14 at 1:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.