febiosoftware / FEBio

FEBio Suite Solver
https://febio.org/
MIT License
174 stars 65 forks source link

Inconsistent use of loadcurve for dtmax parameter #42

Closed Kevin-Mattheus-Moerman closed 11 months ago

Kevin-Mattheus-Moerman commented 2 years ago

Summary: Usually for time varying parameters controlled by a loadcurve, the value used for a particular time is the result of multiplying the value set by the current loadcurve amplitude. It seems that for the dtmax parameter the value set is ingnored and the value is instead always solely based on the loadcurve amplitude.

When so-called "must-points" are needed the dtmax parameter can be specified with a load_controller / loadcurve. Below I assign the value 0.01 i.e. a constant dtmax, but by using the loadcurve I enforce must-points:

Time stepper parts of the control section:

        <time_stepper>
            <dtmin>1.0000000e-04</dtmin>
            <max_retries>5</max_retries>
            <opt_iter>12</opt_iter>
            <dtmax lc="1">1</dtmax>
        </time_stepper>

The load curve specification:

        <load_controller id="1" type="loadcurve">
            <interpolate>STEP</interpolate>
            <points>
                    <point>0.0000000e+00, 1.0000000e-02</point>
                    <point>2.5000000e-01, 1.0000000e-02</point>
                    <point>5.0000000e-01, 1.0000000e-02</point>
                    <point>7.5000000e-01, 1.0000000e-02</point>
                    <point>1.0000000e+00, 1.0000000e-02</point>
            </points>
        </load_controller>

The above works fine. However if I switch to the below the dtmax parameter appears to be 1 (the loadcurve amplitude), rather than 0.01 * the loadcurve amplitude.

Time stepper parts of the control section:

        <time_stepper>
            <dtmin>1.0000000e-04</dtmin>
            <max_retries>5</max_retries>
            <opt_iter>12</opt_iter>
            <dtmax lc="1">1.0000000e-02</dtmax>
        </time_stepper>

The load curve specification:

        <load_controller id="1" type="loadcurve">
            <interpolate>STEP</interpolate>
            <points>
                    <point>0.0000000e+00, 1.0000000e+00</point>
                    <point>2.5000000e-01, 1.0000000e+00</point>
                    <point>5.0000000e-01, 1.0000000e+00</point>
                    <point>7.5000000e-01, 1.0000000e+00</point>
                    <point>1.0000000e+00, 1.0000000e+00</point>
            </points>
        </load_controller>
SteveMaas1978 commented 2 years ago

Hi Kevin,

Your findings are correct. In the presence of a must point curve, the value for dtmax is basically ignored. We can change this, but I'm a little concerned about backward compatibility. When specifying a must point curve, the value for dtmax does not even have to be specified, and thus will be zero by default. This is the case for many test suite problems that use must point curves. Similarly, since the value is ignored, if a nonzero value was specified that differs from 1, the behavior of the solution might change (which is also the case for some test suite problems). So, given this, my preference would be to keep the current behavior in febio3, but implement a solution in febio4. The solution would be that the dtmax value will always have to be specified and the must point curve, if defined, will be multiplied by the dtmax value. Let me know if that is a workable compromise.

Thanks,

Steve

Kevin-Mattheus-Moerman commented 1 year ago

@SteveMaas1978 this is probably resolved in febio4, if so, feel free to close.

gateshian commented 11 months ago

Hi Kevin, I am going to close this issue, but if you are still concerned about it, please submit a new one. Thanks, Gerard