Run a code for 100 years
Mostra commenti meno recenti
I have a program that I need to run for 100 years, the program is calculating the angle of a circular orbit at 451 days. I want to calculate the angle changing over 100 years, I have the angle calculated for 451 days just want to repeat the same process but add 451 to the last calculation. T=451 days my idea was to have a for loop for the 100 years starting at T=451 days for the first year and then adding 451 to T for each year till 100.
clear all;
clc;
ro=1.49e11; %Sun orbital radius (1 AU)
G=6.67408e-11;
MS=2e+30;
%synodic period
perp = 365; %planet period (days)
perd = 1896.59; %red dwarf period (days)
np = 2*pi / perp; % mean motion of planet (rad/day)
nd = 2*pi / perd; % mean motion of red dwarf (rad/day)
T = 2*pi / (np - nd) %This is the average time between stellar eclipses.
v=sqrt((G*MS)/ro);
theta=((v*T)*86400)/ro %Angle in radians
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Axes Transformations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!