Tidal acceleration of the Earth affected from sun and moon

조회 수: 1 (최근 30일)
Basem Nouh
Basem Nouh 2021년 1월 13일
답변: SaiDileep Kola 2021년 1월 19일
hey
i want to write a code to calculate the Tidal acceleration in 3 ways
A: Sun and moon in the equatorial plane. Centers of mass of the sun, moon and earth and point P are on a line (center of mass of the earth - P - moon - sun)
.B: Sun and moon in the equatorial plane. The centers of mass of the sun, moon and earth and point P are on a line (P - center of mass of the earth - moon - sun)
.C: Sun and moon in the equatorial plane (as above). Point P is at the North Pole.
i wanted to write a code with case condition but i dont know how to call it, i wanna say if case =A then do this
also i have no idea how to write the vector on Matlab
function [a_t] = gezeitenbesch(G,M_m,M_s,r_e,r_m,r_s)
a_g1 = G*M_m/((r_m)^2);
a_g2 = G*M_s/((r_s)^2);
a_g3 = G*M_s/((r_s+r_e)^2);
a_t1 =a_g1-a_g3;
a_t2 =a_g2-a_g3;
a_t = a_t1+a_t2;
end
% Gravitationsbeschleunigung
G = 6.67408e-11; %[m3/kgs2]
M_m = 7.3483e22 ;% [kg]
M_s = 1.989e30; %[Kg]
r_m = 3.8440*10^8; % [m]
r_s = 1.496*10^11 ; %[m]^3;
r_e = 6378*10^3;
a_t =gezeitenbesch(G,M_m,M_s,r_e,r_m,r_s)
is there any way to plot it ?
thanks

답변 (1개)

SaiDileep Kola
SaiDileep Kola 2021년 1월 19일
Go through the process described here to know more about switch cases and to use them just have it in your code, need not do anything else like for functions, check for various ways of using vectors here

카테고리

Help CenterFile Exchange에서 Earth, Ocean, and Atmospheric Sciences에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by