PDETOOL Matlab - Plotting Linear Element?

In summary, the conversation discusses a script that creates rectangles and gives a surface plot in the PDE toolbox. The speaker is looking for assistance in plotting the values for a linear element in the surface plot. They provide more detail on their problem, which involves creating a cross-sectional surface plot of two electrodes and manipulating the data. A solution is suggested using the "get" function to access the children and grandchildren of the figure and retrieve the data needed.
  • #1
BlueJay99
2
0
Hi,

I've written a script that creates a few rectangles and gives the surface plot in the PDE toolbox.

What I would like to do is to also plot the values for a linear element in the surface plot i.e. for a given value of x or y.

Any help or ideas would be greatly appreciated!

Jay
 
Physics news on Phys.org
  • #2
To add more detail to my problem...

Using the pdetool I created 3 rectangles (using the first method you described), 1 large rectangle (R1) and 2 smaller rectangles (R2 and R3) that are within R1 but not in contact. By applying the formula R1-(R2+R3) and solving it as an electrostatic system in the toolbox I essentially get the cross-sectional surface plot of 2 electrodes (given below).

pdeexample-1.png


What I would now like to do is for example just look at the values at say y=6 and plot a simple x-y graph which would look something like below:

g587-2.png


I guess my fundamental problem is not being able to access the information from the surface plot to then manipulate the data. Any insight anyone has into the problem would be greatly appreciated!

Jay
 
  • #3
You have to "get" the "grandchildren" of the figure.

you can use:

child = get(gcf,'Children')
grandchild = get(child,'Children')

then:

X = get(grandchild)

will give you a structure, X, from which you can pull components:

X.Cdata

wil probably then be the data you're looking for, but I'm not sure. Have a look at the fields of X.
 

1. What is PDETOOL Matlab?

PDETOOL Matlab is a software package that allows for the solving and visualization of partial differential equations (PDEs).

2. What is the purpose of PDETOOL Matlab?

The purpose of PDETOOL Matlab is to provide a user-friendly interface for solving and plotting linear element PDEs. It also allows for customization and manipulation of the solutions.

3. How do I plot a linear element in PDETOOL Matlab?

To plot a linear element in PDETOOL Matlab, you will need to define the geometry and boundary conditions of your PDE, specify the PDE coefficients, and then use the "solvepde" function to solve the PDE. After solving, you can use the "pdemesh" and "pdecont" functions to plot the solution.

4. Can I customize the plot of a linear element in PDETOOL Matlab?

Yes, PDETOOL Matlab allows for customization of the plot by changing the mesh size, color, and contour levels. You can also add labels, titles, and legends to the plot to make it more visually appealing.

5. Are there any limitations to plotting linear elements in PDETOOL Matlab?

Yes, PDETOOL Matlab is designed specifically for linear element PDEs, so it may not be suitable for solving and plotting more complex PDEs. Additionally, the accuracy of the plot may depend on the mesh size and resolution chosen by the user.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
928
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
Back
Top