polohaTelesa[t_, planeta_String]:=AstronomicalData[planeta,{"Position",DateList[t]}]

generujData[jmenaTeles_]:=Module[{casTed},
(casTed=AbsoluteTime[];{"jmeno"->#,"hmotnost"->AstronomicalData[#,"Mass"],"r0"->polohaTelesa[casTed+100,#],"v0"->(polohaTelesa[casTed+100,#]-polohaTelesa[casTed-100,#])/200}&/@jmenaTeles)
]

Needs["PhysicalConstants`"]
spoctiPolohuTeles[dataTeles:{{__Rule}..}, tmax_?NumericQ]:=
Module[{m,jmena,pocR,pocV,sila,κ,pocetTeles,silaNa,dejRovnici,soustava,promenne,resNahr,r,t,defaultPlanet},

(*uprava dat*)
defaultPlanet={"jmeno"->"Sun","hmotnost"->1.988435`7.*^30,"r0"->{0,0,0},"v0"->{0,0,0}};

m="hmotnost"/.dataTeles/.defaultPlanet;
jmena="jmeno"/.dataTeles/.defaultPlanet;
pocR="r0"/.dataTeles/.defaultPlanet;
pocV="v0"/.dataTeles/.defaultPlanet;
pocetTeles=Length[dataTeles];
κ=GravitationalConstant[[1]];

(*sily*)
sila[naco_Integer,zdroj_Integer]:=
Module[{m1reseneFce,m2,dr},
m1=m[[naco]];
m2=m[[zdroj]];
dr=r[naco][t]-r[zdroj][t];
κ*((-m1*m2*dr)/((Norm[dr])^3))
];
sila[i_Integer,i_Integer]=0;
reseneFce
silaNa[naco_Integer]:=Total[sila[naco,#]&/@Range[pocetTeles]];

(*tvorba rovnic*)
dejRovnici[ii_Integer]:={
m[[ii]]*r[ii]''[t]==silaNa[ii],
r[ii]'[0]==pocV[[ii]],
r[ii][0]==pocR[[ii]]
};
soustava=dejRovnici/@Range[pocetTeles];
promenne=r/@Range[pocetTeles];

(*reseni*)
resNahr=NDSolve[soustava,promenne,{t,0,tmax}][[1]];
promenne/.resNahr
]

Spusteni

AstronomicalData["Planet"]

dataTeles=generujData[{"Sun","Mercury","Venus","Earth","Mars","Jupiter","Saturn","Uranus","Neptune"}]
tmax=5*365*24*3600;

reseneFce=spoctiPolohuTeles[dataTeles,tmax]

reseneFce[t]
Through[reseneFce[t]]

#[t]&/@reseneFce

reseneFce/.a_InterpolatingFunction:>a[t]

Through[reseneFce[0]]

pl1=ParametricPlot[Through[reseneFce[t]][[All,{1,2}]],{t,0,tmax}];

Manipulate[

diskyPlanet=Table[{Red,Disk[Through[reseneFce[t]][[ii,{1,2}]],4*10^10]},{ii,1,Length[reseneFce]}];
pl2=Graphics[diskyPlanet];

Show[pl1,pl2]

,{t,0,tmax}]

Graphics[Table[{Red,Disk[Through[reseneFce[0]][[ii]],10^4]},{ii,1,Length[reseneFce]}]]

pl1=Graphics[{Orange, Disk[{0, 0}, 1, {Pi/4, 3 Pi/4}], Red, Line[{{0, 0}, {0, 1}}], Green, Opacity[0.5], Disk[{0, 0.9}, 0.5]}, Axes -> True];
pl2=Plot[{Sin[x],Sin[2x],Sin[3x]},{x,0,2Pi}];
pl3=Graphics[Text["Sin(x)",{0.5,1.05}]];
Show[pl1,pl2,pl3,PlotRange->{{0,2},All}]

pokusy

f[]:={1,2,3}

{a,b,c}=f[]

c

Attributes[Set]