Re: Solution to the sine-gordon equation

2019-03-21 Thread Guyer, Jonathan E. Dr. (Fed) via fipy
On Mar 21, 2019, at 1:44 PM, Daniel Wheeler wrote: > >> I get the error: >> >> ExplicitVariableError: Terms with explicit Variables cannot mix with Terms >> with implicit Variables. > > That's because of the parentheses I think. The problem is that in ``` eq = (DiffusionTerm(coeff=(1.0), var

Re: Solution to the sine-gordon equation

2019-03-21 Thread Meier Quintin
That worked thanks! > On 21 Mar 2019, at 18:44, Daniel Wheeler wrote: > > On Thu, Mar 21, 2019 at 1:14 PM Meier Quintin > wrote: >> >> Dear Daniel, >> Thanks a lot for the help. I got it to work by adding a transientterm(). >> >> If I try to use your second trick though: >> >> eq = (Diffusi

Re: Solution to the sine-gordon equation

2019-03-21 Thread Daniel Wheeler
On Thu, Mar 21, 2019 at 1:14 PM Meier Quintin wrote: > > Dear Daniel, > Thanks a lot for the help. I got it to work by adding a transientterm(). > > If I try to use your second trick though: > > eq = (DiffusionTerm(coeff=(1.0), var=phi) - numerix.sin(phi) + phi * > numerix.cos(phi)-ImplicitSource

Re: Solution to the sine-gordon equation

2019-03-21 Thread Meier Quintin
Dear Daniel, Thanks a lot for the help. I got it to work by adding a transientterm(). If I try to use your second trick though: eq = (DiffusionTerm(coeff=(1.0), var=phi) - numerix.sin(phi) + phi * numerix.cos(phi)-ImplicitSourceTerm(numerix.cos(phi)) == TransientTerm(var=phi)) I get the error:

Re: Solution to the sine-gordon equation

2019-03-21 Thread Daniel Wheeler
On Thu, Mar 21, 2019 at 11:48 AM Daniel Wheeler wrote: > > with a transient term in the equation. For small phi, this should > never be negative, since phi should only grow, but for delta_t > 1 That's wrong, phi should shrink, but not go negative. -- Daniel Wheeler _

Re: Solution to the sine-gordon equation

2019-03-21 Thread Daniel Wheeler
Hi Qunitin, I think you need to relax the updates on this. Introducing a transient term does that. I think that the b vector causes and instability. The b vector is phi_old - delta_t * sin(phi_old) with a transient term in the equation. For small phi, this should never be negative, since phi