hongyizhao
(Hongyi Zhao)
August 16, 2022, 5:26am
1
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
There are some issues with the code:
Options are passed to f5 but its signature does not include OptionsPattern. Even if it did, ContourPlot does not accept an Assumptions option.
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.
hongyizhao
(Hongyi Zhao)
August 16, 2022, 12:45pm
3
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.