# WISDEM Blade Optimization Example: runnning check\_partials from .yaml input file

**URL:** <https://forums.nlr.gov/t/wisdem-blade-optimization-example-runnning-check-partials-from-yaml-input-file/2540>\
**Category:** Computer-Aided Engineering Software Tools\
**Created:** [September 2, 2021, 6:57am UTC](https://forums.nlr.gov/t/wisdem-blade-optimization-example-runnning-check-partials-from-yaml-input-file/2540 "2021-09-02T06:57:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henny.Bottini](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/henny.bottini/32/3236_2.png) [@Henny.Bottini](https://forums.nlr.gov/u/Henny.Bottini)\
**Post date:** [September 2, 2021, 6:57am UTC](https://forums.nlr.gov/t/wisdem-blade-optimization-example-runnning-check-partials-from-yaml-input-file/2540/1 "2021-09-02T06:57:51Z")

</div>

I would like to understand the connections among the classes called for the aerostructural optimization by running the openmdao command “check\_partials”.

Now, I run the case via the blade\_driver.py script in the examples\03\_blade folder, where the wisdem::run\_wisdem function is imported (from wisdem\glue\_code\runWISDEM.py, I believe) and used to run the optimization.  
In the script of this run\_wisdem function I have found the following lines

` if "check_partials" in opt_options["driver"]:
            if opt_options["driver"]["check_partials"]:
                wt_opt.run_model()
                checks = wt_opt.check_partials(compact_print=True)
`so I modify my analysis\_options\_aerostruct.yaml file as below (last two lines)

```auto
driver:
    optimization:
        flag: True # Flag to enable optimization
        tol: 1.e-5 # Optimality tolerance
        # max_major_iter: 10 # Maximum number of major design iterations (SNOPT)
        # max_minor_iter: 100 # Maximum number of minor design iterations (SNOPT)
        max_iter: 2 # Maximum number of iterations (SLSQP)
        solver: SLSQP # Optimization solver. Other options are 'SLSQP' - 'CONMIN'
        step_size: 1.e-3 # Step size for finite differencing
        form: forward # Finite differencing mode, either forward or central
    check_partials: # 1 Sept 2021
        flag: True
```

and run to try to have the results of check\_partials.  
After few seconds some NaNs appear in the CLI and the run gets stuck:

> [@](#):
>
> (wisdem-env) C:\Windows\System32\WISDEM\examples\03\_blade\>python blade\_driver.py  
> e[00me[00me[00me[00me[00me[00me[00me[00me[00me[00m########################################  
> Objectives  
> Turbine AEP: 24.0655361772 GWh  
> Blade Mass: 58749.2346697171 kg  
> LCOE: 40.8790954156 USD/MWh  
> Tip Defl.: 17.1066109591 m  
> ########################################  
> e[00me[00me[00me[00me[00m########################################  
> Objectives  
> Turbine AEP: 24.0655361772 GWh  
> Blade Mass: 58749.2346697171 kg  
> LCOE: 40.8790954156 USD/MWh  
> Tip Defl.: 17.1066109591 m  
> ########################################  
> NaNs at 29/30: 1e-06 1.4286309367843356e-12 1.5707963267948966  
> NaNs at 29/30: 1e-06 1.4286309367843356e-12 1.5707963267948966  
> NaNs at 29/30: 1e-06 1.4286309367843356e-12 1.5707963267948966  
> NaNs at 29/30: 1e-06 1.4286309367843356e-12 1.5707963267948966  
> NaNs at 29/30: 1e-06 1.4286309367843356e-12 1.5707963267948966

I abort the run with CTRL+C, and this message pops out in the CLI:

> [@](#):
>
> Traceback (most recent call last):  
> File “blade\_driver.py”, line 18, in   
> wt\_opt, modeling\_options, analysis\_options = run\_wisdem(fname\_wt\_input, fname\_modeling\_options, fname\_analysis\_options\_aerostruct)  
> File “c:\windows\system32\wisdem\wisdem\glue\_code\runWISDEM.py”, line 106, in run\_wisdem  
> checks = wt\_opt.check\_partials(compact\_print=True)  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\openmdao\core\problem.py”, line 1130, in check\_partials  
> comp.run\_linearize()  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\openmdao\core\system.py”, line 3879, in run\_linearize  
> self.\_linearize(self.\_assembled\_jac, sub\_do\_ln=do\_ln)  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\openmdao\core\explicitcomponent.py”, line 475, in \_linearize  
> approximation.compute\_approximations(self, jac=self.\_jacobian)  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\openmdao\approximation\_schemes\approximation\_scheme.py”, line 511, in compute\_approximations  
> under\_cs=system.\_outputs.\_under\_complex\_step):  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\openmdao\approximation\_schemes\finite\_difference.py”, line 198, in compute\_approx\_col\_iter  
> yield from self.\_compute\_approx\_col\_iter(system, total=total, under\_cs=under\_cs)  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\openmdao\approximation\_schemes\approximation\_scheme.py”, line 523, in \_compute\_approx\_col\_iter  
> yield from self.\_uncolored\_column\_iter(system, approx\_groups, total)  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\openmdao\approximation\_schemes\approximation\_scheme.py”, line 444, in \_uncolored\_column\_iter  
> app\_data, results\_array, total)  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\openmdao\approximation\_schemes\finite\_difference.py”, line 274, in \_run\_point  
> results = self.\_run\_sub\_point(system, idx\_info, delta, total)  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\openmdao\approximation\_schemes\finite\_difference.py”, line 308, in \_run\_sub\_point  
> system.run\_apply\_nonlinear()  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\openmdao\core\system.py”, line 3272, in run\_apply\_nonlinear  
> self.\_apply\_nonlinear()  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\openmdao\core\explicitcomponent.py”, line 258, in \_apply\_nonlinear  
> self.\_compute\_wrapper()  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\openmdao\core\explicitcomponent.py”, line 245, in \_compute\_wrapper  
> self.compute(\*args)  
> File “c:\windows\system32\wisdem\wisdem\ccblade\ccblade\_component.py”, line 558, in compute  
> inputs[“airfoils\_cm”][i, :, :, 0],  
> File “c:\windows\system32\wisdem\wisdem\ccblade\ccblade.py”, line 90, in **init**  
> self.cm\_spline = RectBivariateSpline(alpha, Re, cm, kx=kx, ky=ky, s=0.0001)  
> File “C:\ProgramData\Anaconda3\envs\wisdem-env\lib\site-packages\scipy\interpolate\fitpack2.py”, line 1338, in **init**  
> ye, kx, ky, s)  
> KeyboardInterrupt

I can not decipher the meaning of the stack, but the easiest cause of my problem may well be my input in the .yaml file is wrong.  
So may someone tell me how can I call correctly check\_partials from the analysis\_options.yaml file?

Thank you for your time and attention

---

<div class="post-metadata">

**Author:** ![Garrett.Barter](https://avatars.discourse-cdn.com/v4/letter/g/958977/32.png) [@Garrett.Barter](https://forums.nlr.gov/u/Garrett.Barter)\
**Post date:** [September 2, 2021, 4:32pm UTC](https://forums.nlr.gov/t/wisdem-blade-optimization-example-runnning-check-partials-from-yaml-input-file/2540/2 "2021-09-02T16:32:27Z")

</div>

Hi Henny,

You won’t get partial derivative information in WISDEM because we set it up to do finite differencing on the total derivatives. Everything dealing with partials in the WISDEM scripts should be treated as experimental or untested code.

Your desire to understand the connections would be better achieved using the OpenMDAO N2 or check\_connections tools ([url][http://openmdao.org/twodocs/versions/latest/basic\_user\_guide/command\_line/make\_n2.html[/url]](http://openmdao.org/twodocs/versions/latest/basic_user_guide/command_line/make_n2.html%5B/url%5D)):

```auto
 openmdao n2 blade_driver.py
```

Cheers,  
Garrett

---

<div class="post-metadata">

**Author:** ![Henny.Bottini](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/henny.bottini/32/3236_2.png) [@Henny.Bottini](https://forums.nlr.gov/u/Henny.Bottini)\
**Post date:** [September 3, 2021, 6:16am UTC](https://forums.nlr.gov/t/wisdem-blade-optimization-example-runnning-check-partials-from-yaml-input-file/2540/3 "2021-09-03T06:16:59Z")

</div>

Thank you also for this other useful hint.

Cheers,  
Henny
