Plot Graphene Distribition Problem

  • Thread starter Thread starter vesta33
  • Start date Start date
  • Tags Tags
    Graphene Plot
AI Thread Summary
The discussion revolves around difficulties in plotting a figure related to graphene distribution using Mathematica, specifically regarding the function g(ω²). The original poster struggles with errors in their code and questions the validity of the article's equations. Several users point out that the plotting should be done with respect to ω rather than ω² and highlight issues with the elliptic integral's argument. Despite attempts to clarify and assist, the original poster insists on the existence of a bug in Mathematica or the article, while others successfully reproduce the figure, emphasizing the importance of following guidance provided. The conversation underscores the need for careful attention to mathematical definitions and coding practices in computational tools.
vesta33
Messages
5
Reaction score
0
Hi.

According to the attached article I couldn't draw fig1 with eq1 using mathematica.
graphene_zps35285026.jpg
 

Attachments

Last edited:
Physics news on Phys.org
Hi vesta33. http://img96.imageshack.us/img96/5725/red5e5etimes5e5e45e5e25.gif

Is there a question or something you intended should accompany your post?

Not that I will be able to help, but someone else may offer to ...
 
Last edited by a moderator:
NascentOxygen said:
Is there a question or something you intended should accompany your post?

Not that I will be able to help, but someone else may offer to ...
I'll bite.

You realize that ##g(\bar\omega^2)## is defined by different equations depending on the value of ##\bar\omega^2##? And that the figure in the paper plots ##g(\bar\omega^2)## as a function of ##\bar\omega^2##, not ##\bar\omega##?
 
NascentOxygen and DrClaude, thank you for answers. I plotted this without elliptic integral. But this article referred to elliptic integrals. DrClaude, I am aware of your writings but mathematica has given error mesage:
error_zpscae5b065.jpg
 
Last edited:
Instead of using w^2 in the equation for g7, define a variable w2 that corresponds to ##\bar\omega^2##.
 
I had tried.
bug_zps55e289a1.jpg
 
In the argument of the elliptic integral, you're missing the cube in ##(2-3\bar\omega^2)^3##.
 
You are right. But after I tried all variable ranges with correct code, nothing changed. Mathematica file is attached for anyone intersted in this plot. Thanks for help.
 

Attachments

You posted this in a homework forum, but am I correct in assuming that this is not homework?

Looking at your file, you have in it
Code:
g2 = (9/\[Pi]^2) ((1 - 2 w)/(3 w (2 - 3 w)^3)^(1/2)) 
       (EllipticK[(1 - 2 w)/(w (2 - 3 w)^3)])^(1/2);
Plot[g2, {w^2, 0, 1}]
First, the argument of the elliptic integral is incorrect. The square root should be over the argument itself, not the entire integral. Second, you need to plot with respect to w, not w^2. Third, the equation for g you have there is only valid in the range ##1/3 \leq \bar\omega^2 \leq 1/2##. Therefore, you should have
Code:
g2 = (9/\[Pi]^2) ((1 - 2 w)/(3 w (2 - 3 w)^3)^(1/2))
      EllipticK[((1 - 2 w)/(w (2 - 3 w)^3))^(1/2)];
Plot[g2, {w, 1/3, 1/2}]
 
  • #10
I should stress that I know mathematica. I had tried all possibly variaions before wrote here. If anyone wants help me please first of all run the code. I think mathematica or the article has a bug. Please nobody reply the message without running the code.
 
  • #11
I will try to be as diplomatic as possible, but your latest post has made me cross. I was guiding you towards the solution to your problem, but instead of trying what I suggested, you reply without any new attempts.

vesta33 said:
I should stress that I know mathematica.
Then you should know why the statement
Code:
Plot[g2, {w^2, 0, 1}]
is not valid.

vesta33 said:
I had tried all possibly variaions before wrote here.
Obviously not, because you have not been able to reproduce the graph.

vesta33 said:
If anyone wants help me please first of all run the code.
I did, told you what was wrong, and even gave you a correct replacement code, which is at least valid for part of the ##\bar{\omega}## domain.

vesta33 said:
I think mathematica or the article has a bug.
Both are fine. I was able to reproduce the figure in a couple of minutes. Before you ask for my code, note that this is not how things are done on PF. We don't feed you fish, we help with the fishing.

vesta33 said:
Please nobody reply the message without running the code.
Please do not reply before taking into account the replies of others.
 
Back
Top