#!/usr/bin/gnuplot # galaxie_potencial.plt # Gravitacni potencial Galaxie. # Miroslav Broz (miroslav.broz@email.cz), Jun 24th 2008 G = 6.67e-11 # N/kg^2*m^2; gravitacni konstanta M_S = 2.e30 # kg; hmotnost Slunce R_S = 7.e8 # m; polomer Slunce M = 1.3e11*M_S # kg; hmotnost Galaxie AU = 1.5e11 # m; astronomicka jednotka ly = 9.5e15 # m; svetelny rok pc = 3.26*ly # m; parsek kpc = 1.e3*pc # m; kiloparsek r_S = 8.5*kpc # m; polomer Galaxie rho = M / (4./3.*pi*(r_S**3.)) # kg/m^3; hustota b = 0.1*r_S # parameter isochronniho potencialu print "M = ", M, " kg" print "r_S = ", r_S, " m = ", r_S/kpc, " kpc" print "rho = ", rho, " kg/m^3 = ", rho/M_S*(pc**3.), " M_S/pc^3" ######################################################################## set tit "potencialy keplerovsky, homogenni sfera a isochronni" set xl "vzdalenost od centra r / m" set yl "gravitacni potencial |Phi| [N m/kg]" set x2l "r / kpc" x2=2*r_S x1=-x2 set xr [x1:x2] y1=-5.e11 y2=0 set yr [y1:y2] set samples 1000 set key bottom set xtics nomirror set x2r [x1/kpc:x2/kpc] set x2tics set label "r_S" at r_S, graph 1.03 center lw=3 set style line 1 lt 1 lw lw set style line 2 lt 2 lw lw set style line 3 lt 3 lw lw set style line 4 lt 4 lw 1 p -G*M/abs(x) ls 1,\ -G*4./3.*pi*rho * x**2 ls 2,\ -G*M/(b+sqrt(b*b+x**2)) ls 3,\ "vline.dat" u (r_S):(y1+$2*(y2-y1)) not w l ls 4 pa -1 set term png small set out "galaxie_potencial.png" rep set term wxt ######################################################################## set tit "kruhove rychlosti odpovidajici potencialum" set xl "vzdalenost od centra r [m]" set yl "kruhova rychlost v [km/s]" set x2l "r / kpc" kms=1.e3 x1=0 x2=2*r_S set xr [x1:x2] set x2r [x1/kpc:x2/kpc] y1=0 y2=600 set yr [y1:y2] a(b,r)=sqrt(b**2.+r**2.) p sqrt(G*M/abs(x)) / kms ls 1,\ sqrt(G*4./3.*pi*rho) * abs(x) / kms ls 2,\ sqrt( G*M*abs(x)**2. / ((b+a(b,x))**2 * a(b,x)) ) / kms ls 3,\ "vline.dat" u (r_S):(y1+$2*(y2-y1)) not w l ls 4 pa -1 ########################################################################