[Getdp] Time-dependent non-linear problem, time derivatives and usage of JacNL

michael.asam at infineon.com michael.asam at infineon.com
Wed Nov 7 19:10:40 CET 2012


Hi Jonathan,

it turned out that this kind of problem (nonlinear and time dependent)
is more challenging than expected, but finally here comes the solution.

Just some remarks:

1) Dt in the Galerkin equation is actually not implemented. The simulator uses
DtDof instead. Therefore your original H-based formulation is calculated not
correctly. To circumvent this, the time derivative has to be calculated manually.

2) All my tries to do this with the function AtAnteriorTimeStep did not succeed. It obviously
works not as I expected. But I've found a workaround: It's easy to store the past H
in a separate quantity (I call it Hpast) and use it to build the time derivative.

3) The function InterpolateAkima etc. should be called with a scalar value, not
a vector value. With a vector value it seems to work (no warning or error) but the result
is different. So I'm not sure what's going on when you call it with a vector value...

4) In general it's important to distinguish between scalar and vector values. E.g. the function B
should return a vector.
5) The word JacNL tells GetDP that Dof{H} corresponds to the change in H in the iteration,
not the unknown H itself. Unfortunately this is not documented very well in the reference
manual.
Please have a look in the pdf file where I've calculated the formulations for Picard's and
Newton's methods.

6) In the corrected example from you (see attachments) there are now resolutions
for the H-based problem with Picard's and Newton's method, as well a B-based
Newton resolution. (No warranty that they are correct. But I've made some
plausibility checks :-)

I hope this is of some help.

Cheers
Michael




From: Velasco Alvarado Jonathan [mailto:jonathan.velasco at aalto.fi]
Sent: Wednesday, October 31, 2012 10:04 AM
To: Asam Michael (IFAG ATV BP PD 1 M1); getdp at geuz.org
Subject: RE: Time-dependent non-linear problem and time derivatives


Thank you again for your response.



I have tried to take the derivative manually in the function block and it still doesn't seem to work. Here below I show two ways I've used to take the derivative of the magnetic flux density with respect to time (dBdt[Ir]). As you can see, in the first attempt I used the Dt function provided by GetDp, as that wouldn't work in my second attempt I used the  $Dtime function, as advised before.



Function{
                        .

                        .

                        .

  mu_non[Ir] = InterpolationAkima[$1]{ListAlt[h_mat2, mu_mat2]};
  B[Ir] = InterpolationAkima[$1]{ListAlt[h_mat2, b_mat2]};

  dBdt[Ir] = Dt[B[$1]];

  dBdt[Ir] = (B[$1] - B[AtAnteriorTimeStep[$1,1]])/$DTime;


 dmudh [Ir] = dInterpolationAkima[$1]{ListAlt[h_mat2, mu_mat2]};
 dbdh [Ir] = mu_non[$1]+Norm[$1]*dmudh[$1];



                        .

                        .

                        .
}





Formulation {

                        .

                        .

                        .
    }

    Equation {



 Galerkin { [ 1/sig[]* Dof{Curl H} , {Curl H}] ; In Stack ; Jacobian JMat ; Integration GaussIntegration ; }

 Galerkin { [ dBdt[{H}]                        , {H}]       ; In Stack    ; Jacobian JMat ; Integration GaussIntegration ; }
 Galerkin { JacNL [dbdh[{H}] * Dof{H}  , {H}]        ; In Stack    ; Jacobian JMat ; Integration GaussIntegration ; }
    }
  }
}



Any ideas of why this may not be working?



Best Regards,



Jonathan

________________________________
From: michael.asam at infineon.com [michael.asam at infineon.com]
Sent: Monday, October 15, 2012 12:07 PM
To: Velasco Alvarado Jonathan; getdp at geuz.org
Subject: RE: Time-dependent non-linear problem and time derivatives
Hi John,

I think the missing Dt implementation is not the root cause for the not working B formulation.
GetDP uses DtDof instead which will deliver a result (in your case probably the wrong one).
The calculation of the time derivative in a function could be done by using there the function
Dt (see manual page 16) or you can calculate it manually by using the variable $DTime (page 21).

The main problem is that you give the Dof as an argument to a function:  B[Dof{H}].
I think, this is not allowed. (Otherwise you could build nonlinear Galerkin equations ...)
Instead you should give H from the last iteration to the function: B[{H}].

Dof{H} means the unknown values of H you are looking for in the actual iteration
in contrast to {H}, which represents the known values from the last nonlinear iteration.
(Have a look in your first formulation where the usage of {H} and Dof{H} is correct.)

Cheers
Michael


From: Velasco Alvarado Jonathan [mailto:jonathan.velasco at aalto.fi]
Sent: Monday, October 15, 2012 9:34 AM
To: Asam Michael (IFAG ATV BP PD 1 M1); getdp at geuz.org
Subject: RE: Time-dependent non-linear problem and time derivatives


Hi Michael,



Thanks for your prompt reply. I am actually interpolating B for each calculated value of H with my own measured data and I am building my Jacobian matrix using the JacNL function. The derivatives have been carried the way you've mentioned, as an external calculation in the Function field by applying the dAkimaInterpolation scheme. The first formulation (using permeability) gives me reasonable results. The formulation with B doesn't work though still. The fact that Dt has not been implemented might be the reason. How can the time derivative calculated in the Function block?



Best Regards,



Jonathan





________________________________
From: michael.asam at infineon.com [michael.asam at infineon.com]
Sent: Monday, October 15, 2012 9:57 AM
To: Velasco Alvarado Jonathan; getdp at geuz.org
Subject: RE: Time-dependent non-linear problem and time derivatives
Hi John,

regarding the first formulation:
The term-op-type Dt is actually not implemented. GetDP uses DtDof instead, which is
in many cases wrong. The newest version (nightly build) gives here now a warning.

You can overcome this problem when you calculate the time derivative of the complete
(nonlinear) expression in a separate function (located in the Function{ ... } block).

Regarding the 2nd formulation with B:
The Galerkin equation has to be linear with respect to the Dof, which is not the case
here. You have to linearize it, either with functional iterations (Picard iteration)
or with Newton's method.
Please have a look in the reference manual at page 22, chapter 4.10 Fields -> Dof.

Best regards,
Michael



From: getdp-bounces at ace20.montefiore.ulg.ac.be [mailto:getdp-bounces at ace20.montefiore.ulg.ac.be] On Behalf Of Velasco Alvarado Jonathan
Sent: Friday, October 12, 2012 3:29 PM
To: getdp at geuz.org
Subject: [Getdp] Time-dependent non-linear problem and time derivatives


Hello everyone,



I am currently working on a time-dependent non-linear magnetodynamic case. The permeability is my non-linear term but I don't want it to be included in my calculations for simplicity. For this reason, I am using the flux density instead of permeability times field strength (B = mu*H). I am currently using this formulation (T-ohm) and it seems to work:



Galerkin { Dt[ mu_non[{H}]*Dof{H}                ,  {H}] ; In Stack    ; Jacobian JMat ; Integration GaussIntegration ; }
     Galerkin { [ 1/sig[]* Dof{Curl H}        , {Curl H}] ; In Stack    ; Jacobian JMat ; Integration GaussIntegration ; }



However, if I substitute B into my equation:



Galerkin { Dt[ B[Dof{H}] , {H}] ; In Stack ; Jacobian JMat ; Integration GaussIntegration ; }
Galerkin { [ 1/sig[* Dof{Curl H} , {Curl H}] ; In Stack ; Jacobian JMat ; Integration GaussIntegration ; }



It doesn't seem to do anything. I was wondering if there is a way to take the time derivative of my non-linear term in terms of a magnetic flux density as shown above.



BR,



John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/getdp/attachments/20121107/84e29fc0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Formulation.pdf
Type: application/pdf
Size: 673532 bytes
Desc: Formulation.pdf
URL: <http://www.geuz.org/pipermail/getdp/attachments/20121107/84e29fc0/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Square.geo
Type: application/octet-stream
Size: 423 bytes
Desc: Square.geo
URL: <http://www.geuz.org/pipermail/getdp/attachments/20121107/84e29fc0/attachment.geo>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Square.pro
Type: application/octet-stream
Size: 9051 bytes
Desc: Square.pro
URL: <http://www.geuz.org/pipermail/getdp/attachments/20121107/84e29fc0/attachment.pro>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: GetDP_Test.txt
URL: <http://www.geuz.org/pipermail/getdp/attachments/20121107/84e29fc0/attachment.txt>