Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. p[y_, t_, k_] := ((1 - E^(-((-1 + y)^2/t))) t)/(-1 + y)^2 -
  2. ((1 - E^(-((1 + y)^2/t))) t)/(1 + y)^2 - k
  3.  
  4. FindRoot[p[y, t, 0.5], {y, 1}]
  5.  
  6. During evaluation of In[3]:= Power::infy: Infinite expression 1/0.^2 encountered. >>
  7.  
  8. During evaluation of In[3]:= Infinity::indet: Indeterminate expression 0. t ComplexInfinity encountered. >>
  9.  
  10. During evaluation of In[3]:= FindRoot::nlnum: The function value {Indeterminate} is not a list of numbers with dimensions {1} at {y} = {1.}. >>
  11.  
  12. (* FindRoot[p[y, t, 0.5], {y, 1}] *)
  13.  
  14. p[y_, t_, k_]:= ((1 - E^(-((-1 + y)^2/t))) t)/(-1 + y)^2 -
  15. ((1 - E^(-((1 + y)^2/t))) t)/(1 + y)^2 - k
  16.  
  17. t = Table[i, {i, 0, 5}]
  18. NSolve[p[y, t, 0.5], y]
  19.  
  20. ContourPlot[p[y, t, 0.5], {y, 0, 1}, {t, 0, 1}, PlotLegends -> Automatic]
  21.  
  22. Table[y /. FindRoot[p[y, i, 0.5], {y, 0.5}], {i, 0.1, 1, 0.1}]
  23.  
  24. Table[y /. FindRoot[p[y, i, 0.5], {y, 0.5 i}], {i, {1, 2.1, 3}}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement