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 have a function, say

minimizeme[ω_][β_][ϵ_] = ϵ^2 ω-Log[2 (Cosh[2 β]+Cosh[2 β ϵ])]/(2 β);

I want to make a high-precision dynamic ContourPlot of it using:

plottricrit[ω_] := ContourPlot[
 D[minimizeme[ω][β][ϵ], ϵ] == 0,
 {β, 0.5, 1.0},
 {ϵ, -3, 3},
 Evaluated -> True, 
 ContourStyle -> Thick, 
 RegionFunction -> Function[
    {β, ϵ}, 
    minimizeme[ω][β][ϵ] < minimizeme[ω][β][0]],
 ImageSize -> Large, 
 PerformanceGoal -> Accuracy,
 WorkingPrecision -> 60]

Manipulate[plottricrit[ω],{ω,0.217`60,0.22545`60}]

However, I keep running into a ContourPlot::precw message which tells me that

The precision of the argument function (...) is less than WorkingPrecision.

I have tried several ways to set the right precision (i.e., using With to inject a higher $MachinePrecision, using SetPrecision, using Rationalize, etc.), but I can't seem to get rid of this error. What is the right way to deal with it?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

New method

I found that using a step value that is arbitrary precision also works:

Manipulate[plottricrit[ω], {ω, 0.217`60, 0.22545`60, 1`60*^-6}]

Old method

For reference this was my original answer, which also works but is less clean:

plottricrit[ω0_] := With[{ω = SetPrecision[ω0, 100]},
   ContourPlot[D[minimizeme[ω][β][ϵ], ϵ] == 0, {β, 0.5, 1.},
   {ϵ, -3, 3}, Evaluated -> True, ContourStyle -> Thick,
   RegionFunction -> Function[{β, ϵ}, minimizeme[ω][β][ϵ] < minimizeme[ω][β][0]],
   ImageSize -> Large, PerformanceGoal -> Accuracy, WorkingPrecision -> 60]
 ]
share|improve this answer
    
Won't SetPrecision get me "virtual" precision? –  Andrea Colonna Jul 24 '12 at 14:28
2  
@Andrea I'm sorry, I didn't read your question well enough; I was too busy editing in the Greek letters (I do wish there was a simple way to do that automatically). Yes, this would be "fake" precision, but given that it is originating from a slider I don't see why that matters. What am I missing? –  Mr.Wizard Jul 24 '12 at 14:30
    
Yeah, you are right. I hadn't thought about that. Since it is an input value, it is only as good as I can input it, and as it stands I can still use higher precision numbers via the input field under the slider if needed. Thanks! So, basically, there is no way to tell the Manipulate function to feed higher-precision numbers to its arguments "internally". Is this right? –  Andrea Colonna Jul 24 '12 at 14:46
    
@Mr.Wizard a nice palette for conversion? –  belisarius Jul 24 '12 at 19:11
    
@Mr.Wizard I usually hate questions with non ascii symbols. Makes more difficult to work with the answers. I am thinking of a palette that when some text is selected and a button pressed changes all greek symbols into something ascii –  belisarius Jul 25 '12 at 3:54
show 8 more comments

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.