1
$\begingroup$

I have the function Vt

Vn = (-G*Mn)/Sqrt[x^2 + y^2 + z^2 + cn^2];
Vd = (-G*Md)/Sqrt[x^2 + y^2 + (s + Sqrt[h^2 + z^2])^2];
Vb = (G*Mb)/(2*a)*(ArcSinh[(x - a)*(y^2 + z^2 + c^2)^(-1/2)] - 
 ArcSinh[(x + a)*(y^2 + z^2 + c^2)^(-1/2)]);
Vh = (-G*Mh)/Sqrt[x^2 + y^2 + z^2 + ch^2];
Vrot = -(Ωb^2/2)*(x^2 + y^2);

Vt = Vn + Vd + Vb + Vh + Vrot;

G = 1; Mn = 400; cn = 0.25;
Md = 7000; s = 3; h = 0.175;
Mb = 3500; a = 10; c = 1;
Mh = 20000; ch = 20;
Ωb = 4.5;

and I want to expand it in a series around P(x0,0,0), where x0 = 10.63695596. The output should be of the form

V = V(x0,0,0) - A (x - x0)^2 /2 + B y^2 / 2 + C z^2 /2

where V(x0,0,0) = -3242.772174938595.

Any ideas how to get this? It must be very simple.

$\endgroup$
  • $\begingroup$ Look up Series. $\endgroup$ – march Nov 20 '15 at 16:55
  • $\begingroup$ @march I looked the documentation but it does not contain any relevant examp0le on expansion around a 3D point. $\endgroup$ – Vaggelis_Z Nov 20 '15 at 16:57
  • $\begingroup$ I'm pretty sure it's the second use-case listed at the top of the Series documentation page. $\endgroup$ – march Nov 20 '15 at 16:58
  • $\begingroup$ @march But the output it's not in the desired form. $\endgroup$ – Vaggelis_Z Nov 20 '15 at 16:59
6
$\begingroup$

One possibility is:

   se[n_Integer, x0_:1] := 
 Collect[(Normal[
       O[la]^(n + 1) + 
         Expand[Normal[
           Series[V, {x, x0, n}, {y, 0, n}, {z, 0, n}]]] /. {x -> la x,
          y -> la y, z -> la z}] /. la -> 1) /. x -> (x0 + XM), XM] /. 
  XM -> (x - x0)
$\endgroup$
  • $\begingroup$ If the point is P(x0,0,0) how would be the general code? $\endgroup$ – Vaggelis_Z Nov 20 '15 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.