Message Boards Message Boards

0
|
1140 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Use Assumptions with ContourPlot?

Posted 1 year ago

See my following example:

f5 // ClearAll;
f5[args__] := 
  Block[{eqs = Flatten@{args}}, 
   ContourPlot[eqs//Evaluate, {x, -3, 3}, {y, -3, 3}, 
    EvaluationMonitor -> 
     Print["f3 x=", x, ", y=", y, ", eqs=", Hold[eqs]]]];     

f5[x^2 + y^2 == 5, Assumptions->Element[{x,y},PositiveIntegers]]

However, the results show that this option Assumptions does not take effect. Is there any way to use it like this?

Regards, Zhao

POSTED BY: Hongyi Zhao
2 Replies
Posted 1 year ago

I want to have EvaluationMonitor when I use a function to do something with some Assumptions, so that I can check/confirm the real effect in real time. In short, in case I run into a problem, I can quickly learn about its internal processing mechanism so that I can troubleshoot it better.

POSTED BY: Hongyi Zhao

There are some issues with the code:

  1. Options are passed to f5 but its signature does not include OptionsPattern. Even if it did, ContourPlot does not accept an Assumptions option.
  2. EvaluationMonitor does not use RuleDelayed so x and y are not printed. Even with RuleDelayed, eqs is not available to the monitoring function.

It is not clear exactly what you are trying to achieve.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract