1 | format compact
|
---|
2 | clear
|
---|
3 |
|
---|
4 | % Specify constants
|
---|
5 |
|
---|
6 | MJ=1.898e30;
|
---|
7 | MS=1.99e33;
|
---|
8 | G=6.6731e-8;
|
---|
9 | au=1.496e13;
|
---|
10 | RS=6.955e10;
|
---|
11 | RJ=7.1492e9;
|
---|
12 | yr=31556926;
|
---|
13 | amu=1.66053892e-24;
|
---|
14 | mH=1.00794*amu;
|
---|
15 | Boltzmann=1.3806488e-16;
|
---|
16 |
|
---|
17 | % Specify euler similarity scales
|
---|
18 | Mscale=MS;
|
---|
19 | lscale=.1*au; %/(20^(2/3));
|
---|
20 | rhoscale=1e-8;
|
---|
21 |
|
---|
22 | % Derived scales for converting dimensionless velocities and magnetic fields
|
---|
23 | velscale=sqrt(G*Mscale/lscale);
|
---|
24 | Bscale=sqrt(4*pi*rhoscale*velscale^2);
|
---|
25 |
|
---|
26 | % Dimensionless parameters
|
---|
27 | xi_H=.2;
|
---|
28 | xi_bow=.25;
|
---|
29 | xi_p=.005;
|
---|
30 | xi_Mp=.01;
|
---|
31 | xi_s=.2;
|
---|
32 | chi_bow=1;
|
---|
33 | sigma_p=.1;
|
---|
34 | sigma_s=.1;
|
---|
35 |
|
---|
36 | % Solving for intermediate dimensionless parameters
|
---|
37 | q=xi_H^3/3;
|
---|
38 | lambda_p=2*xi_Mp/xi_p;
|
---|
39 |
|
---|
40 | rhs=q*chi_bow*xi_s/xi_p/lambda_p*(1+sigma_p)/(1+sigma_s)*(1+mypsi(xi_bow/xi_p, lambda_p));
|
---|
41 | lhs=@(x) (1+mypsi((1-xi_bow)/xi_s,x))/x - rhs;
|
---|
42 | lambda_s=double(fzero(lhs ,[1e-5,18]));
|
---|
43 | xi_Ms=lambda_s*xi_s/2;
|
---|
44 | chi=chi_bow*phi((1-xi_bow)/xi_s,lambda_s)/phi(xi_bow/xi_p, lambda_p);
|
---|
45 |
|
---|
46 | cs2_s=1/xi_s/lambda_s;
|
---|
47 | cs2_p=q/xi_p/lambda_p;
|
---|
48 |
|
---|
49 | %solve for dimensionless pressure at bow shock to check that they are equal
|
---|
50 | psi_s=mypsi((1-xi_bow)/xi_s,lambda_s);
|
---|
51 | psi_p=mypsi(xi_bow/xi_p,lambda_p);
|
---|
52 | rho_s=phi((1-xi_bow)/xi_s,lambda_s);
|
---|
53 | rho_p=chi*phi((xi_bow)/xi_p,lambda_p);
|
---|
54 | Bram_p=rho_p*cs2_p*(1+psi_p)*sigma_p;
|
---|
55 | Bram_s=rho_s*cs2_s*(1+psi_s)*sigma_s;
|
---|
56 | ram_p=rho_p*cs2_p*(1+psi_p)+Bram_p;
|
---|
57 | ram_s=rho_s*cs2_s*(1+psi_s)+Bram_s;
|
---|
58 | fprintf('Ratio of pressures at bow shock ~ should = 1: %f \n', ram_p/ram_s)
|
---|
59 |
|
---|
60 | % Print out dimensionless params in table format for wiki
|
---|
61 | fprintf('|| $\\xi_p$ || %f ||\n', xi_p)
|
---|
62 | fprintf('|| $\\xi_s$ || %f ||\n', xi_s)
|
---|
63 | fprintf('|| $\\xi_H$ || %f ||\n', xi_H)
|
---|
64 | fprintf('|| $\\xi_{bow}$ || %f ||\n', xi_bow)
|
---|
65 | fprintf('|| $\\xi_{Mp}$ || %f ||\n', xi_Mp)
|
---|
66 | fprintf('|| $\\chi_{bow}$ || %f ||\n', chi_bow)
|
---|
67 | fprintf('|| $\\sigma_p$ || %f ||\n', sigma_p)
|
---|
68 | fprintf('|| $\\sigma_s$ || %f ||\n', sigma_s)
|
---|
69 |
|
---|
70 | % Print out physical params in table format for wiki
|
---|
71 | fprintf('|| Orbital separation || %f AU ||\n', lscale/au)
|
---|
72 | fprintf('|| Mass of Star || %f solar masses || \n',Mscale*(1-q)/MS)
|
---|
73 | fprintf('|| Mass of Planet || %f Jupiter masses || \n', Mscale*q/MJ)
|
---|
74 | fprintf('|| Radius of Star || %f solar radii || \n', lscale*xi_s/RS)
|
---|
75 | fprintf('|| Radius of Planet || %f Jupiter radii || \n', lscale*xi_p/RJ)
|
---|
76 | fprintf('|| Temperature of Star || %f Kelvin || \n', G*Mscale*(1-q)/xi_s/lscale/lambda_s*mH/Boltzmann)
|
---|
77 | fprintf('|| Temperature of Planet || %f Kelvin || \n', G*Mscale*(q)/xi_p/lscale/lambda_p*mH/Boltzmann)
|
---|
78 | fprintf('|| Density of Star || %e || \n', rhoscale/chi)
|
---|
79 | fprintf('|| Density of Planet || %e || \n', rhoscale)
|
---|
80 | fprintf('|| Orbital period || %f years || \n', 2*pi/sqrt(G*Mscale/lscale^3)/yr)
|
---|
81 | fprintf('|| Magnetic field of Star || %f Gauss || \n',sqrt(Bram_s*(1-xi_bow)^6/xi_s^6)/Bscale)
|
---|
82 | fprintf('|| Magnetic field of Planet || %f Gauss || \n',sqrt(Bram_p*(xi_bow)^6/xi_p^6)/Bscale) |
---|