Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p[y_, t_, k_] := ((1 - E^(-((-1 + y)^2/t))) t)/(-1 + y)^2 -
- ((1 - E^(-((1 + y)^2/t))) t)/(1 + y)^2 - k
- FindRoot[p[y, t, 0.5], {y, 1}]
- During evaluation of In[3]:= Power::infy: Infinite expression 1/0.^2 encountered. >>
- During evaluation of In[3]:= Infinity::indet: Indeterminate expression 0. t ComplexInfinity encountered. >>
- During evaluation of In[3]:= FindRoot::nlnum: The function value {Indeterminate} is not a list of numbers with dimensions {1} at {y} = {1.}. >>
- (* FindRoot[p[y, t, 0.5], {y, 1}] *)
- p[y_, t_, k_]:= ((1 - E^(-((-1 + y)^2/t))) t)/(-1 + y)^2 -
- ((1 - E^(-((1 + y)^2/t))) t)/(1 + y)^2 - k
- t = Table[i, {i, 0, 5}]
- NSolve[p[y, t, 0.5], y]
- ContourPlot[p[y, t, 0.5], {y, 0, 1}, {t, 0, 1}, PlotLegends -> Automatic]
- Table[y /. FindRoot[p[y, i, 0.5], {y, 0.5}], {i, 0.1, 1, 0.1}]
- 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