Failed initializing task: optimize

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • bbjohnston
    Junior Member
    • Jun 2020
    • 22

    Failed initializing task: optimize

    Hello,

    I am trying to run a constrained levmar optimization on a biphasic material with data fit to stress experimental data and I am getting the error message Failed initializing task: optimize. I think it may have to do with how I am formatting my parameter but I am not sure. I have tried to trouble shoot but cannot seem to find my error, I have included the file and the simulation file if anyone has suggestions. I have run optimizations before so I know I have the package installed correctly, and I tried to just copy the text file and change the parameters and data points but I am not sure what went wrong.

    Thanks in advance
    Ben

    Default2_op.feb
    Default2.feb
  • ateshian
    Developer
    • Dec 2007
    • 1830

    #2
    Hi Ben,

    If you are getting this error that's probably because the executable you are using for FEBio was not compiled with the correct option for "constrained levmar". Please download the latest version of FEBioStudio from FEBio.org. It includes the executable for FEBio3, which should be compiled properly for this option. (If not, please let us know).

    Best,

    Gerard

    Comment

    • bbjohnston
      Junior Member
      • Jun 2020
      • 22

      #3
      Gerard,

      Thank you for the response.
      I will try redownloading FEBio, but I just tried running a different file that is also "constrained levmar" and it worked fine, I am only getting this error with this specific file.

      Please let me know if you have any other thoughts.

      Thanks,
      Ben

      Comment

      • maas
        Lead Code Developer
        • Nov 2007
        • 3435

        #4
        Hi Ben,

        The approach you are trying to use is deprecated. We are working on a different mechanism for accessing element (and nodal values) in the optimization module, but this was not finished in the 3.0 release of FEBio. I will look into finishing this new feature in 3.1. I will try to keep you updated, but feel free to check in in a couple of weeks, if you have not heard back from me.

        Cheers,

        Steve
        Department of Bioengineering, University of Utah
        Scientific Computing and Imaging institute, University of Utah

        Comment

        • bbjohnston
          Junior Member
          • Jun 2020
          • 22

          #5
          Steve,

          Thanks for the response, but I am not entirely sure what you mean. Are you saying that the way I am accessing the element is what is causing the problem? And that the only solution is to wait for a fix? I just want to be sure theres nothing else that might work in the mean time.
          I am mostly just confused because I can run other optimizations, and while they are accessing nodes, not elements, the access method seems to be similar from what I can tell.

          Thanks,
          Ben

          Comment

          • maas
            Lead Code Developer
            • Nov 2007
            • 3435

            #6
            Hi Ben,

            FEBio does not support accessing nodal and element data very well. The only options available are hardcoded. For nodes this is the "position" and the solution variables. For elements, only the stress is accessible, but only for elastic materials, not for biphasic materials. For an elastic material, this would be the syntax:

            Code:
            <param name="fem.mesh.elem[10].var('stress').zz"/>
            This approach is proving to be difficult to generalize, so instead we are looking at an alternative approach that uses the same data options as are available in the log data sections. That is the new method I was referring to in my previous post. I don't have a beta version of that yet, but hopefully I will in the next couple of weeks.

            Cheers,

            Steve
            Department of Bioengineering, University of Utah
            Scientific Computing and Imaging institute, University of Utah

            Comment

            • bbjohnston
              Junior Member
              • Jun 2020
              • 22

              #7
              Steve,

              Thanks for the clarification. I look forward to hopefully hearing more soon.

              Ben

              Comment

              • maas
                Lead Code Developer
                • Nov 2007
                • 3435

                #8
                Hi Ben,

                When looking further into this, I realized that this alternative mechanism I mentioned is already partly implemented. (I guess I forgot how far along this implementation was.) Although it's far from finished, I think it will work for your needs. This new approach essentially requires two steps:
                1. Define a "data" section in the Output section of your input file that says what additional data you want FEBio to calculate. In this case, this will be the stress.

                Code:
                	<data>
                		<element_data data="sx">1</element_data>
                	</data>
                The value of the data attribute can be any of the element data variables that can be used in the logdata section. (See section 3.17.1.2 in the user manual)

                2. In the optimization file, reference this data variable in your objective definition.

                Code:
                	<fnc type="parameter">
                		<param name="fem.data('sx').value[0]"/>
                	</fnc>
                The "value" parameter is an array, so it needs a (zero-based) index.

                I've attached an example input file that shows this approach. To run it, just type:

                Code:
                >febio3 -i model1.feb -s opt.feb
                Please take a look at the example, then give this approach a try in your model and let me know what you find.

                Cheers,

                Steve
                Attached Files
                Department of Bioengineering, University of Utah
                Scientific Computing and Imaging institute, University of Utah

                Comment

                • bbjohnston
                  Junior Member
                  • Jun 2020
                  • 22

                  #9
                  Steve,

                  Thank you for posting another helpful update. I added the code you provided to my optimization files and I am no longer getting the error initializing optimization in FEBio 2.9. The optimization ran for over 5000 iterations before I terminated it, but I would guess this is due to something I am missing in my model.

                  On a different note, I downloaded FEBio Studio, and am trying to run the example files you provided, but have been unable to deduce how to run optimizations from the GUI, and I did not notice it in the user manual. Additionally, I have been unable to find the download for FEBio 3.0 as a standalone on the website. I apologize if these are trivial questions, but I appreciate any advice you may have.

                  Thanks,
                  Ben Johnston

                  Comment

                  • maas
                    Lead Code Developer
                    • Nov 2007
                    • 3435

                    #10
                    Hi Ben,

                    The features I was referring to are supported in FEBio3. I think some of that initial development was started in FEBio2.9, but I definitely recommend using FEBio3.

                    When you install FEBio Studio, it will automatically install FEBio3 for you as well. You do not need to install FEBio3 separately.

                    You can run optimization problems from within FEBio Studio, but it requires overriding the command line. (When you open the Run FEBio dialog button, click the Advanced button, then check the "override command" and then enter the correct commands for running the optimization.) We will be adding some better support for optimizations in one of the next releases, but if this does not work, you should be able to use FEBio3 as a standalone program, just like you use FEbio2 (just use febio3 as the executable's name.) Please give that a try and let me know what you find.

                    Cheers,

                    Steve
                    Department of Bioengineering, University of Utah
                    Scientific Computing and Imaging institute, University of Utah

                    Comment

                    • bbjohnston
                      Junior Member
                      • Jun 2020
                      • 22

                      #11
                      Thank you! Things are working as expected with the files given. Hopefully the matter is now settled.

                      Ben

                      Comment

                      • bbjohnston
                        Junior Member
                        • Jun 2020
                        • 22

                        #12
                        Hi Steve,

                        I have been playing with this optimization for a while longer now, and after some initial success with very simple inputs, am having difficulty getting convergence. I have decreased tau and f_dif_scale substantially to no apparent effect, and am not sure what other parameters may be involved/causing issues at this point.

                        I am also having the surprising issue that the optimization is attempting to use permeability values outside of the range I prescribe in my file. I set my range from 1e-16 to 1e-14 and it will often try a value around 1e-7 before cycling indefinitely at the minimum boundary of my range. This can be seen in the .log file included.
                        I have attached the two files again if you are able to offer any insight.

                        Thank you for your help,
                        Ben Johnston
                        Attached Files

                        Comment

                        • Tim.Gadzella
                          Junior Member
                          • Jan 2021
                          • 21

                          #13
                          Originally posted by maas View Post
                          Hi Ben,

                          When looking further into this, I realized that this alternative mechanism I mentioned is already partly implemented. (I guess I forgot how far along this implementation was.) Although it's far from finished, I think it will work for your needs. This new approach essentially requires two steps:
                          1. Define a "data" section in the Output section of your input file that says what additional data you want FEBio to calculate. In this case, this will be the stress.

                          Code:
                          <data>
                          <element_data data="sx">1</element_data>
                          </data>
                          The value of the data attribute can be any of the element data variables that can be used in the logdata section. (See section 3.17.1.2 in the user manual)

                          2. In the optimization file, reference this data variable in your objective definition.

                          Code:
                          <fnc type="parameter">
                          <param name="fem.data('sx').value[0]"/>
                          </fnc>
                          The "value" parameter is an array, so it needs a (zero-based) index.

                          I've attached an example input file that shows this approach. To run it, just type:

                          Code:
                          >febio3 -i model1.feb -s opt.feb
                          Please take a look at the example, then give this approach a try in your model and let me know what you find.

                          Cheers,

                          Steve
                          I was just wondering if this is the required format in the 3.2 release of FEBio. I have an optimization file that calls a rigid body reaction force using the syntax:

                          <param name="fem.rigidbody('Rigid1').Fy"/>

                          This syntax works on my machine which is running 3.1, but when I try to run it in 3.2 on a different machine I get the "failed to initialize" error. I installed 3.1 on the second machine and it ran. Should I be defining <data> fields for optimization going forward?

                          Thanks,

                          Tim

                          Comment

                          • maas
                            Lead Code Developer
                            • Nov 2007
                            • 3435

                            #14
                            Hi Tim,

                            Can you please attach the input file and the optimization file that are not working for you in FEBio 3.2? Or you may email them to steve dot maas at utah dot edu. This could be a bug so I'd like to take a closer look.

                            Thanks,

                            Steve
                            Department of Bioengineering, University of Utah
                            Scientific Computing and Imaging institute, University of Utah

                            Comment

                            Working...
                            X
                            😀
                            😂
                            🥰
                            😘
                            🤢
                            😎
                            😞
                            😡
                            👍
                            👎