Writing down minimal Weierstrass equations Let $E$ be an elliptic curve over $\mathbb Q_p$. It is possible that $E$ has bad reduction but then when you see $E$ as a curve over a finite extension $K$ of $\mathbb Q_p$, it obtains good reduction. Let $v$ be the valuation defined on $K$ and $R$ its valuation ring. I was interested in checking $E$ has good reduction over $K$ by hand, using the Weierstrass equation. What that amounts to then is writing down the Weierstrass equation $y^2+a_1xy + a_3y = x^3 + a_2x^2+a_4x + a_6$ with the $a_i \in R$ and considering changes of coordinates $x=u^2x' + r$ and $y=u^3y' + u^2sx' + t$ for $u,r,s,t \in R$ in hopes of finding an equation with $v(\Delta')$ minimized, subject to each $a_i'$ being in $R$. There are certain congruence conditions that guarantee minimality of the new equation, e.g. $v(\Delta') < 12$, which only depend on the choice of $u$. However, guaranteeing the new equation has coefficients in $R$ requires solving other congruence relations depending on $r,s$ and $t$, e.g. you need $v(a_1+2s)\geq v(u)$ (because $a_1' = u^{-1}(a_1+2s)$). The few times I have done this by hand, I have just had to look at the equations and make some choices until something worked out.
My question is whether or not there exists a general method for obtaining a good change of coordinates $u,r,s,t$ and if not, then how do people go about writing down minimal Weierstrass models. I can't imagine there should be general methods for solving the system of non-linear congruences (higher powers of $u,r,s$ and $t$ appear in the other congruences) in the ring $R$, but if there is then I would also be interested in understanding that as well.
 A: If you want a very fast algorithm that computes a minimal Weierstrass equation over $\mathbf{Z}$ (or more generally over any PID), you can use a simple algorithm due to Laska. ("An algorithm for finding a minimal Weierstrass equation for an elliptic curve," Math. Comp. 38 (1982), 257-260.) The basic idea is that it's easy to find a minimal equation modulo all primes $p \ge 5$. Further, there's always a minimal model with $a_1,a_2,a_3$ equal to $-1$, $0$, or $1$. So you just have to check a small number of possibilities. 
A: A slightly more theoretical answer: there is an algorithm of Tate, called (unremarkably)
Tate's algorithm, which allows one to compute the minimal model over any local field.  I have a vague memory that it's not proved that this algorithm terminates in general, although it is expected to.  (Perhaps someone else can say something definitive about this.)  I would guess that this is what is implemented in Pari. 
A: I answer the question of M. Emerton on Tate's algorithm here. I am not allowed to write long comment. 
Sorry my memory is bad ! I just checked Tate's paper (Lect. Notes in Maths 476). The algorithm he describes is over a DVR with perfect residue field (note that the ring does not need to be complete actually). That the algorithms terminates is OK and is explained clearly in Tate and in Silverman (what I said in the above comment is not true). 
In Tate's paper, §0, he said at two places that the result is conjectural. The first one is on the value of $\nu$ for the type $I^*_{\nu}$. Actually the algorithm will give $\nu$, but in § 7, page 51, he said ''A crude estimate gives $\nu={\rm ord} \Delta -3$ if I'm not mistaken.''. This is a typo (it would imply that the conductor $f=-1$ with the formula of page 50, line 6). Even worst, in residue characteristic 2, there can not be formula relating directly ${\rm ord} \Delta$ to $\nu$ because $f={\rm ord}\Delta-4-\nu$ does not depend only on the reduction type in this case. Silverman does not make this mistake. 
The second place he said the result is conjectural is a few lines below, but I d'ont see what he was concerned with. Did he think aobut Ogg's formula 
$$f={\rm ord} \Delta - n +1$$ 
($n=$ number of geometric irrducible components in the Kodaira-Néron type) ? In that time, Ogg's formula was not fully proved. But this becomes a little off topic, I will write what I know on this formula in a response here.
A: By the way, Mike Szydlo, who got his Ph.D. with Mazur the same year as Emerton and I, wrote a 200-page thesis about a version of Tate's algorithm that worked over two-dimensional local fields!
In higher genus, I know Qing Liu did a lot of work on the genus 2 case, and I think had something (and even had code you can run) that handles everything away from characteristic 2.
A: Use the PARI/GP routine ellglobalred. See here for a list of elliptic curve routines for PARI. I copy the relevant part here, from that page:
ellglobalred(E)
calculates the arithmetic conductor, the global minimal model of E and the global Tamagawa number c. Here E is an elliptic curve given by a medium or long vector of the type given by ellinit, and is supposed to have all its coefficients a_i in Q. The result is a 3 component vector [N,v,c]. N is the arithmetic conductor of the curve, v is itself a vector [u,r,s,t] with rational components. It gives a coordinate change for E over Q such that the resulting model has integral coefficients, is everywhere minimal, a_1 is 0 or 1, a_2 is 0, 1 or -1 and a_3 is 0 or 1. Such a model is unique, and the vector v is unique if we specify that u is positive. To get the new model, simply type ellchangecurve(E,v). Finally c is the product of the local Tamagawa numbers c_p, a quantity which enters in the Birch and Swinnerton-Dyer conjecture.
