Optimizing Resolution in RegionPlot for Complex Conditions in Mathematica 6

  • Mathematica
  • Thread starter dukebdx12
  • Start date
  • Tags
    Mathematica
In summary, to make a surface and contour plot for a function f(x,y) for suitable intervals, viewpoints, and resolutions, you should make a surface plot and a contour plot for: a. suitable intervals, b. suitable viewpoints, and c. suitable resolutionsfor each function f, g, etc.
  • #1
dukebdx12
9
0
can someone help me out with a mathematica problem ( i use mathematica 6)? I have never used this program before and really don't know what to do or where to start. So if someone could give me a little light that would be great.

http://i29.tinypic.com/25rkn5f.jpg

-last graph is g(x,y)=
 
Last edited:
Physics news on Phys.org
  • #2
These must have been produced by Plot3D in Math'ca.

For example,

Plot3D[Cos[x y], {x, -3 \[Pi], 3 \[Pi]}, {y, -3 \[Pi], 3 \[Pi]}]

then shift+enter.

First thing I'd do is to hold & rotate the graph to change the ViewPoint.

To change it explicitly, you can type for example:

Plot3D[Cos[x y], {x, -3 \[Pi], 3 \[Pi]}, {y, -3 \[Pi], 3 \[Pi]}, ViewPoint -> {-1, 0, -3}]

Another thing to try is to change the plot limits from {x, -3 \[Pi], 3 \[Pi]} to (say) {x, -\[Pi], \[Pi]} (same for y).
 
  • #3
ok thanks for the reply. my question is, it says make surface and contour plots for suitable intervals, viewpoints, and resolutions. For example f(x,y) = cos(xy) for -3pi <= x,y <= 3pi , that is 1 of the equations for the question. So to make surface and contour plots(many of them) do I just plug other numbers in for -3pi and 3pi? Confused on what I need to do.
 
  • #4
You should make a surface plot and a contour plot for:

a. suitable intervals,

b. suitable viewpoints, and

c. suitable resolutions

for each function f, g, etc.

"Plugging other numbers in for -3pi and 3pi" addresses item a.
 
  • #5
i've got it all down now except the resolutions. I have tried searching for it on google and mathematica and i can't find anything on how to do it. It says. to draw surface and contour plots for resolutions. I don't know what that means? can someone explain?
 
  • #6
try searching in the master index in mathematica it is very good (help -> master index)
 
  • #7
My guess is, "resolution" means "density" of the plot. For example in a ContourPlot, the number of contours you specify manually, as an option.

Alternatively, resolution can mean sampling frequency. Mathematica has a default sampling frequency when plotting graphs. You can change it by specifying a step size as part of the domain specification. For example:

{x, -\[Pi], \[Pi]} produces default sampling

{x, -\[Pi], \[Pi], \[Pi]/180} produces sampling along the x-axis with step size = 1 degree.
 
Last edited:
  • #8
I noticed that a version of convert-pdf was used. If that free trial runs out, try searching for "cute pdf"...

sorry i didn't have anything of much value to add other than that...
 
  • #9
Re my last post above:

If {x, -\[Pi], \[Pi], \[Pi]/180} doesn't work try putting in the option WorkingPrecision -> value in the Plot statement where the default value is MachinePrecision but you can specify a numeric value to increase plot precision (e.g. WorkingPrecision -> 20).

You can also experiment with Mesh and MeshFunctions options. For example:
Plot[Tan[x], {x, 0, Pi/2}, Mesh -> {5, 10}, MeshFunctions -> {#1 &, #2 &}]
 
Last edited:
  • #10
I have struggled with bad resolution and quality in RegionPlot for a long time. In particular this is a problem for complicated multiple conditions. The way to solve it is to add PerformanceGoal and MaxRecursion:

RegionPlot[ f(x,y)>0 && g(x,y)>0, {x,xmin,xmax},{y,ymin,ymax},
PerformanceGoal -> "Quality", MaxRecursion -> 8]

I suspect that the default values are PerformanceGoal -> "Speed", MaxRecursion -> 1. The speed and quality seems to be very sensitive to MaxRecursion, so experiment a bit with different values.

( google keywords: resolution RegionPlot Mathematica )
 

1. How do I input data into Mathematica 6?

To input data into Mathematica 6, you can use the Input or InputString commands. These allow you to type in your data directly or copy and paste it from another source. Alternatively, you can also import data from external files using the Import command.

2. How can I perform basic calculations in Mathematica 6?

To perform basic calculations in Mathematica 6, you can use the built-in arithmetic operators such as + for addition, - for subtraction, * for multiplication, / for division, and ^ for exponentiation. You can also use built-in functions for more complex calculations.

3. How do I create plots and graphs in Mathematica 6?

To create plots and graphs in Mathematica 6, you can use the Plot or ListPlot commands. These allow you to specify the data or mathematical functions you want to plot, as well as customize the appearance of the graph. You can also use the Graphics command to create custom graphics.

4. What are some useful tips for working with Mathematica 6?

Some useful tips for working with Mathematica 6 include using the Clear command to clear previous calculations, using the Table command to generate lists of values, and using the Save command to save your work. It is also helpful to refer to the extensive documentation and online resources available for Mathematica.

5. How can I troubleshoot common errors in Mathematica 6?

To troubleshoot common errors in Mathematica 6, you can use the Information command to get more details about the error, check for typos or incorrect syntax in your code, and refer to the documentation for the correct usage of commands and functions. You can also seek help from online forums and communities for support from other Mathematica users.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
23
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • Science and Math Textbooks
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
Back
Top