def NPVCost(d):
    """
    

    Parameters
    ----------
    d : dict
        Output of PED/statusQ functions with all saved variables and results
        of optimization.

    Returns
    -------
    dic : dict
        dictonary with all relevant cost component of optimized solution.

    """
    dic = {}
    dic["fix"] = d["cost_OMfix"]
    dic["var"] = d["cost_OMvar"]
    #dic["fuel"] = d["cost_fuel"]
    #dic["CO2"] = d["cost_CO2"]    
    #dic["Ext"] = d["cost_Ext"]
    dic["rev"] = d["rev"]
    dicc = {}
    for key in dic:
        dicc[key + "_share"] = sum((dic[key][y])*(1/(1.05)**(y+1)) for y in range(len(dic[key])))
    dic = {**dic, **dicc}
    dic["NPV"] = d["obj"]
    dic["I"] = d["cost_I"]
    return dic