## Interpolation Method for H-B Curve

Numerical methods and mathematical models of Elmer
Bavragor
Posts: 32
Joined: 07 Nov 2013, 14:10
Antispam: Yes

### Interpolation Method for H-B Curve

Hi Elmer-users,

Did anyone know how the H-B curve for a nonlinear electromagnetic steel is interpolated during the calculation?
I use the the method which is described in: https://github.com/ElmerCSC/elmerfem/bl ... h/case.sif

Code: Select all

``````  H-B Curve(31,2) = Real
INCLUDE HB``````
Bavragor
raback
Posts: 3774
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: Interpolation Method for H-B Curve

Hi Bavragor

The default interpolation method is linear interpolation between points (x_i,y_i) - and extrapolation if the value of x is beyond the interval. All this applies to all keywords that may vary, not just the H-B curve.

I would personally use the following syntax with "End" that frees from the agony of having to know the size.

Code: Select all

``````  H-B Curve = Variable "dummy"
Real
include HB
End
``````
Linear interpolation is not always optimal. For this purpose "cubic" spline interpolation may be requested. It ensures continuity of derivaties as well.

Code: Select all

``````  H-B Curve = Variable "dummy"
Real Cubic
include HB
End
``````
For poor data the spline could at times give negative dH/dB. For this purpose there the user may request the fitting to be monotonic:

Code: Select all

``````  H-B Curve = Variable "dummy"
Real Cubic Monotone
include HB
End
``````
To my knowledge this is the choice for most production runs involving H-B curves.

-Peter
Bavragor
Posts: 32
Joined: 07 Nov 2013, 14:10
Antispam: Yes

### Re: Interpolation Method for H-B Curve

Thank you very much for the quick reply Peter

That is very helpful, in fact more than I expected
Bavragor
Posts: 32
Joined: 07 Nov 2013, 14:10
Antispam: Yes

### Re: Interpolation Method for H-B Curve

Another question: is it possible to print that interpolated curves in Elmer or in the postprocessor? (paraview would be nice)
raback
Posts: 3774
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: Interpolation Method for H-B Curve

Hi

There is an undocumented solver: SaveDependence. You could perhaps try it. Looking at the code the syntax could be something like:

Code: Select all

``````Solver solver_id
Name = "SaveDep"
Procedure = "SaveData" "SaveDependence"
Filename = dep.dat
Lower Limit = Real 0.0
Upper Limit = Real 100.0
Number of Points = Integer 100
Expression 1 = Real ...
Expression 2 = Real ...
End
``````
I wrote it sometimes just for debugging purposes so it is far from perfect. In your case you should copy your expression of H-B curve to be "Expression 1" etc. Perhaps you could give feedback if this works...

-Peter
Bavragor
Posts: 32
Joined: 07 Nov 2013, 14:10
Antispam: Yes

### Re: Interpolation Method for H-B Curve

Hi Peter,

I tried it and it's excactly what i needed! Thx

Code example:

Code: Select all

`````` Solver 6
Name = "SaveDep"
Procedure = "SaveData" "SaveDependence"
Filename = dep.dat
Lower Limit = Real 0.0
Upper Limit = Real 1.5
Number of Points = Integer 100
Expression 1 = Variable "dummy"
Real Cubic
include HB
End
End ``````