Graph Plotting Problem in Mathematica

In summary, the author tried to plot a derivative of a complicated function, but the results were not as desired.
  • #1
Stella.Physics
63
13
Hello to all. I've been trying to plot some graphs on Mathematica but I have faced some troubles so far.

I am working on this paper by Lattimer on binary systems:

https://arxiv.org/abs/astro-ph/0002203

I am trying to reproduce Figure 11 but something seems to go wrong.

Here's what I have done so far:

we set ##q=\frac{m_{ns}}{M_{bh}}## the ratio of the neutron star mass and the black hole mass.

then we set the radius

##\frac{R_{l}}{a} = 0.46\bigg(\frac{q}{1+q}\bigg)^{1/3}## with a being the semi major axis that follows
## a<2.8 \bigg[ \frac{m_{ns} m_{bh} (m_{ns}+m_{bh})}{〖M^3_ {\odot}〗} \bigg]^{\frac{1}{4}} R_{\odot}##

The first thing to plot is the neutron star radius versus the neutron star mass.

Then we must plot ##\frac{d \ln{R}}{d \ln{m_{ns}}} ## versus ## m_{ns}## which derivative simply leads to ##\frac{m_{ns}}{R} \frac{dR}{dm_{ns}}##

I've been trying to plot these functions for days but what I get is far from the desired results...

Any help would be very appreciated :)
 
Physics news on Phys.org
  • #2
It's a good idea to simplify a complicated problem, reducing it to it's basic concept and just get the basics working then add on step by step, pieces that would make the basic look more and more like the problem you're trying to solve. So just a quick overview of what you're trying to do looks like plotting a derivative. So if this was mine, I would first get working, plotting the derivative of a simple function like:

Code:
myf[x_] := x^2 + 3 x + 4;
myd[x_] = D[myf[x], x]
Plot[myd[x], {x, 0, 5}]

Now, I might add a more complicated function like myf[x_]:=Sin[x]+Log[x] and get that working and so on until I guide my code towards the problem I really want to solve so that if I just increment it a little bit by bit and something goes wrong I can go back a step and undo the last change I made then analyze why the newest changed caused my code to fail.
 
  • #3
Thank you for your reply, aheight! Although I have tried this method, I will give it another shot... Thanks again :)
 

1. What is Mathematica?

Mathematica is a software program used for mathematical and scientific computing. It is widely used in various fields of science, engineering, and mathematics for various tasks such as data analysis, visualization, and solving complex equations.

2. How do I plot a graph in Mathematica?

To plot a graph in Mathematica, you can use the Plot function. First, define the function or expression you want to plot, then use the Plot function to plot it. You can also customize your graph by adding labels, changing the color and style of the plot, and adding additional features such as grid lines.

3. What types of graphs can I plot in Mathematica?

Mathematica offers a wide range of graph types, including line graphs, scatter plots, bar charts, histograms, and more. You can also create 3D plots and animations in Mathematica.

4. How do I save my graph in Mathematica?

To save your graph in Mathematica, you can use the Export function. This will allow you to save your graph in various formats such as PDF, JPEG, or PNG. You can also use the Save function to save your graph as a Mathematica file.

5. Can I include multiple graphs in one plot in Mathematica?

Yes, you can include multiple graphs in one plot in Mathematica using the Show function. This function allows you to combine multiple plots into one and customize the appearance of each plot. You can also use the GraphicsGrid function to create a grid of plots.

Similar threads

  • Astronomy and Astrophysics
2
Replies
48
Views
686
  • Advanced Physics Homework Help
Replies
1
Views
1K
  • Astronomy and Astrophysics
Replies
3
Views
4K
Replies
17
Views
1K
  • Introductory Physics Homework Help
Replies
1
Views
814
  • Special and General Relativity
2
Replies
39
Views
2K
  • Advanced Physics Homework Help
Replies
7
Views
2K
  • Astronomy and Astrophysics
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Astronomy and Astrophysics
Replies
1
Views
1K
Back
Top