chg_line.c

  name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-5572165936844014&dt=1194442938015&lmt=1194190197&format=336x280_as&output=html&correlator=1194442937843&url=file%3A%2F%2F%2FC%3A%2FDocuments%2520and%2520Settings%2Flhh1%2F%E6%A1%8C%E9%9D%A2%2FCLanguage.htm&color_bg=FFFFFF&color_text=000000&color_link=000000&color_url=FFFFFF&color_border=FFFFFF&ad_type=text&ga_vid=583001034.1194442938&ga_sid=1194442938&ga_hid=1942779085&flash=9&u_h=768&u_w=1024&u_ah=740&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="336" scrolling="no" height="280" allowtransparency="allowtransparency"> #include <stdio.h>

void main(void)
 {
   printf("File %s: Successfully reached line %d/n",
     __FILE__, __LINE__);

   // Other statements here
  
#line 100 "FILENAME.C"

   printf("File %s: Successfully reached line %d/n",
   __FILE__, __LINE__);
 }

static void oplus_vooc_switch_check_work(struct work_struct *work) 1719 { 1720 struct delayed_work *dwork = to_delayed_work(work); 1721 struct oplus_chg_vooc *chip = container_of(dwork, struct oplus_chg_vooc, 1722 vooc_switch_check_work); 1723 int chg_type; 1724 bool present = false; 1725 bool retry_flag = false; 1726 static unsigned long fastchg_check_timeout; 1727 unsigned long schedule_delay = 0; 1728 int rc; 1729 union mms_msg_data data = { 0 }; 1730 struct timespec64 uptime; 1731 1732 chg_info("vooc switch check\n"); 1733 1734 rc = oplus_vooc_cpa_switch_start(chip); 1735 if (rc < 0) { 1736 chg_info("cpa protocol not vooc, return\n"); 1737 return; 1738 } 1739 if (!chip->config.svooc_support) { 1740 chg_info("The SVOOC project does not allow fast charge" 1741 "again after the VOOC adapter is recognized\n"); 1742 oplus_vooc_cpa_switch_end(chip); 1743 return; 1744 } 1745 1746 present = oplus_wired_is_present(); 1747 if (!present) { 1748 if (!chip->vooc_online) { 1749 chip->switch_retry_count = 0; 1750 oplus_vooc_cpa_switch_end(chip); 1751 } 1752 chg_info("vooc_online = %d, present is false, return\n", chip->vooc_online); 1753 return; 1754 } 1755 1756 if (chip->abnormal_adapter_dis_cnt > 0 && 1757 chip->support_abnormal_over_80w_adapter && 1758 (chip->pre_is_abnormal_adapter & ABNOMAL_ADAPTER_IS_OVER_80W_ADAPTER)) { 1759 if (chip->abnormal_adapter_dis_cnt >= chip->abnormal_over_80w_adapter_cur_arraycnt) { 1760 chg_info("abnormal over_80w adapter dis cnt is %d >= vooc_max, switch to noraml and clear the count \n", 1761 chip->abnormal_adapter_dis_cnt); 1762 chip->abnormal_adapter_dis_cnt = 0; 1763 oplus_chg_clear_abnormal_adapter_var(chip); 1764 if (oplus_chg_vooc_get_switch_mode(chip->vooc_ic) != 1765 VOOC_SWITCH_MODE_NORMAL) { 1766 switch_normal_chg(chip->vooc_ic); 1767 oplus_vooc_set_reset_sleep(chip->vooc_ic); 1768 } 1769 oplus_vooc_cpa_switch_end(chip); 1770 return; 1771 } 1772 } else if (chip->abnormal_adapter_dis_cnt > 0 && 1773 chip->support_abnormal_adapter && 1774 (chip->pre_is_abnormal_adapter & ABNOMAL_ADAPTER_IS_65W_ABNOMAL_ADAPTER) && 1775 (chip->abnormal_adapter_dis_cnt >= chip->abnormal_adapter_cur_arraycnt)) { 1776 chg_info("abnormal adapter dis cnt is %d >= vooc_max, switch to noraml and clear the count\n", 1777 chip->abnormal_adapter_dis_cnt); 1778 chip->abnormal_adapter_dis_cnt = 0; 1779 oplus_chg_clear_abnormal_adapter_var(chip); 1780 if (oplus_chg_vooc_get_switch_mode(chip->vooc_ic) != 1781 VOOC_SWITCH_MODE_NORMAL) { 1782 switch_normal_chg(chip->vooc_ic); 1783 oplus_vooc_set_reset_sleep(chip->vooc_ic); 1784 } 1785 oplus_vooc_cpa_switch_end(chip); 1786 return; 1787 } 1788 1789 if (chip->fastchg_disable) { 1790 chip->switch_retry_count = 0; 1791 chg_info("fastchg disable, return\n"); 1792 oplus_vooc_cpa_switch_end(chip); 1793 return; 1794 } 1795 if (chip->fastchg_started) { 1796 chip->switch_retry_count = 0; 1797 chg_err("fastchg_started=%d\n", chip->fastchg_started); 1798 return; 1799 } 1800 1801 if (chip->cpa_support) 1802 chg_type = oplus_vooc_get_real_wired_type(chip); 1803 else 1804 chg_type = oplus_wired_get_chg_type(); 1805 if ((chip->ufcs_vid == OPLUS_SVID) && 1806 (chg_type == OPLUS_CHG_USB_TYPE_PD_PPS || chg_type == OPLUS_CHG_USB_TYPE_PD)) { 1807 chg_err("chg type is pd/pps and get ufcs vid is 0x22d9, enable pd svooc\n"); 1808 vote(chip->pd_svooc_votable, SVID_VOTER, true, 1, false); 1809 } 1810 /* The cpa module will ensure the correctness of the type*/ 1811 if (!chip->cpa_support) { 1812 switch (chg_type) { 1813 case OPLUS_CHG_USB_TYPE_DCP: 1814 case OPLUS_CHG_USB_TYPE_ACA: 1815 case OPLUS_CHG_USB_TYPE_APPLE_BRICK_ID: 1816 case OPLUS_CHG_USB_TYPE_SVOOC: 1817 case OPLUS_CHG_USB_TYPE_VOOC: 1818 break; 1819 case OPLUS_CHG_USB_TYPE_PD: 1820 case OPLUS_CHG_USB_TYPE_PD_PPS: 1821 if (!chip->pd_svooc) { 1822 chip->switch_retry_count = 0; 1823 chg_info("pd_svooc=false\n"); 1824 return; 1825 } 1826 break; 1827 default: 1828 chip->switch_retry_count = 0; 1829 chg_info("chg_type=%s, not support fastchg\n", 1830 oplus_wired_get_chg_type_str(chg_type)); 1831 return; 1832 } 1833 } else { 1834 /* The cpa module not ensure pd_svooc when pd_pps*/ 1835 if ((chg_type == OPLUS_CHG_USB_TYPE_PD_PPS || 1836 chg_type == OPLUS_CHG_USB_TYPE_PD) && 1837 !chip->pd_svooc) { 1838 reinit_completion(&chip->pdsvooc_check_ack); 1839 rc = wait_for_completion_timeout(&chip->pdsvooc_check_ack, 1840 msecs_to_jiffies(PDSVOOC_CHECK_WAIT_TIME_MS)); 1841 chg_info("pdsvooc check ack rc: %d, pd_svooc: %d\n", rc, chip->pd_svooc); 1842 if (!rc || !chip->pd_svooc) { 1843 chip->switch_retry_count = 0; 1844 oplus_cpa_switch_end(chip->cpa_topic, CHG_PROTOCOL_VOOC); 1845 return; 1846 } 1847 } 1848 } 1849 1850 reinit_completion(&chip->vooc_wait_bc12); 1851 chg_info("chg_type=%d\n", chg_type); 1852 if (chg_type == OPLUS_CHG_USB_TYPE_UNKNOWN) { 1853 wait_for_completion_timeout( 1854 &chip->vooc_wait_bc12, 1855 msecs_to_jiffies(VOOC_WAIT_BC1P2_GET_TYPE)); 1856 chg_type = oplus_wired_get_chg_type(); 1857 if (chg_type == OPLUS_CHG_USB_TYPE_UNKNOWN || chip->fastchg_started) { 1858 if (!chip->vooc_online) { 1859 chip->switch_retry_count = 0; 1860 oplus_cpa_switch_end(chip->cpa_topic, CHG_PROTOCOL_VOOC); 1861 } 1862 return; 1863 } 1864 } 1865 1866 if (chip->switch_retry_count == 0 && oplus_wired_get_ibus() < BEFORE_VOOC_CURR_CHECK) { 1867 rc = oplus_mms_get_item_data(chip->wired_topic, WIRED_ITEM_ICL_DONE_STATUS, &data, true); 1868 if (rc == 0 && data.intval == 0) { 1869 reinit_completion(&chip->icl_done_ack); 1870 rc = wait_for_completion_timeout(&chip->icl_done_ack, 1871 msecs_to_jiffies(WAIT_CURR_STARUP)); 1872 chg_info("wait wired icl done over\n"); 1873 } 1874 } 1875 1876 chg_info("switch_retry_count=%d, fast_chg_status=%d fastchg_check_timeout=%lu\n", 1877 chip->switch_retry_count, chip->fast_chg_status, fastchg_check_timeout); 1878 if (chip->switch_retry_count == 0) { 1879 if (oplus_chg_get_boot_reset_adapter_support_flags() && !chip->check_boot_reset_adapter) { 1880 ktime_get_boottime_ts64(&uptime); 1881 if ((unsigned long)uptime.tv_sec < BOOT_RESETADAPTER_20S) { 1882 chip->check_boot_reset_adapter = true; 1883 chip->reset_adapter = true; 1884 } 1885 } 1886 if ((chip->fast_chg_status == 1887 CHARGER_STATUS_SWITCH_TEMP_RANGE || 1888 chip->fast_chg_status == CHARGER_STATUS_FAST_TO_WARM || 1889 chip->fast_chg_status == CHARGER_STATUS_FAST_DUMMY || 1890 chip->fast_chg_status == CHARGER_STATUS_TIMEOUT_RETRY || 1891 chip->fast_chg_status == CHARGER_STATUS_CURR_LIMIT || 1892 chip->reset_adapter) && 1893 oplus_vooc_is_allow_fast_chg(chip) && 1894 is_wired_charge_suspend_votable_available(chip)) { 1895 chg_info("fast_chg_status=%d reset adapter\n", 1896 chip->fast_chg_status); 1897 chip->reset_adapter = false; 1898 /* Reset adapter */ 1899 oplus_reset_adapter(chip); 1900 } 1901 1902 fastchg_check_timeout = jiffies; 1903 chg_err("switch to fastchg, jiffies=%lu\n", fastchg_check_timeout); 1904 1905 chip->switch_retry_count++; 1906 oplus_vooc_switch_fast_chg(chip); 1907 schedule_delayed_work(&chip->vooc_switch_check_work, msecs_to_jiffies(5000)); 1908 return; 1909 1910 } else if (chip->switch_retry_count <= RETRY_15S_COUNT) { 1911 if ((chip->switch_retry_count == 1) && 1912 time_is_after_jiffies(fastchg_check_timeout + (unsigned long)(5 * HZ))) { 1913 schedule_delay = fastchg_check_timeout + (unsigned long)(5 * HZ) - jiffies; 1914 schedule_delayed_work(&chip->vooc_switch_check_work, schedule_delay); 1915 chg_err("Concurrent invalid calls lead to early triggering." 1916 "The 5s interval has not expired, so continue to wait %lu jiffies\n", 1917 schedule_delay); 1918 return; 1919 } else if ((chip->switch_retry_count == RETRY_15S_COUNT) && 1920 time_is_after_jiffies(fastchg_check_timeout + (unsigned long)(15 * HZ))) { 1921 schedule_delay = fastchg_check_timeout + (unsigned long)(15 * HZ) - jiffies; 1922 schedule_delayed_work(&chip->vooc_switch_check_work, schedule_delay); 1923 chg_err("Concurrent invalid calls lead to early triggering." 1924 "The 15s interval has not expired, so continue to wait %lu jiffies\n", 1925 schedule_delay); 1926 return; 1927 } 1928 1929 oplus_vooc_get_retry_flag(chip->vooc_ic, &retry_flag); 1930 if (chip->switch_retry_count == 1 && !retry_flag) { 1931 chip->switch_retry_count++; 1932 schedule_delayed_work(&chip->vooc_switch_check_work, msecs_to_jiffies(10000)); 1933 return; 1934 } 1935 if (is_wired_charge_suspend_votable_available(chip)) { 1936 if (chip->vooc_ic->type == OPLUS_CHG_IC_VIRTUAL_VPHY) 1937 switch_normal_chg(chip->vooc_ic); 1938 /* Reset adapter */ 1939 oplus_reset_adapter(chip); 1940 } 1941 if (chip->wired_online && 1942 (oplus_chg_vooc_get_switch_mode(chip->vooc_ic) != 1943 VOOC_SWITCH_MODE_VOOC)) { 1944 switch_fast_chg(chip->vooc_ic); 1945 chg_err("D+D- did not switch to VOOC mode, try switching\n"); 1946 } 1947 oplus_vooc_set_reset_active(chip->vooc_ic); 1948 if (chip->switch_retry_count == RETRY_15S_COUNT) 1949 schedule_delayed_work(&chip->vooc_switch_check_work, msecs_to_jiffies(15000)); 1950 else 1951 schedule_delayed_work(&chip->vooc_switch_check_work, msecs_to_jiffies(10000)); 1952 chip->switch_retry_count++; 1953 return; 1954 } else { 1955 if ((chip->switch_retry_count == 3) && 1956 time_is_after_jiffies(fastchg_check_timeout + (unsigned long)(30 * HZ))) { 1957 schedule_delay = fastchg_check_timeout + (unsigned long)(30 * HZ) - jiffies; 1958 schedule_delayed_work(&chip->vooc_switch_check_work, schedule_delay); 1959 chg_err("Concurrent invalid calls lead to early triggering." 1960 "The 30s interval has not expired, so continue to wait %lu jiffies\n", 1961 schedule_delay); 1962 return; 1963 } 1964 1965 chip->switch_retry_count = 0; 1966 switch_normal_chg(chip->vooc_ic); 1967 oplus_vooc_set_reset_sleep(chip->vooc_ic); 1968 1969 if (chg_type == OPLUS_CHG_USB_TYPE_QC2 || 1970 chg_type == OPLUS_CHG_USB_TYPE_QC3 || 1971 chg_type == OPLUS_CHG_USB_TYPE_DCP || 1972 chg_type == OPLUS_CHG_USB_TYPE_APPLE_BRICK_ID) { 1973 if (is_wired_charge_suspend_votable_available(chip)) { 1974 chg_err("reset adapter before detect qc\n"); 1975 vote(chip->wired_charge_suspend_votable, ADAPTER_RESET_VOTER, true, 1, false); 1976 if (chip->wired_online) 1977 msleep(MSLEEP_1000MS); 1978 vote(chip->wired_charge_suspend_votable, ADAPTER_RESET_VOTER, false, 0, false); 1979 if (chip->wired_online) 1980 msleep(MSLEEP_500MS); 1981 } 1982 if (!chip->cpa_support) { 1983 chg_err("detect qc\n"); 1984 oplus_qc_check_setup_timer(chip, QC_CHECK_TIMER); 1985 oplus_wired_qc_detect_enable(true); 1986 } else { 1987 oplus_cpa_request(chip->cpa_topic, CHG_PROTOCOL_QC); 1988 } 1989 } 1990 if (chip->cpa_support && chip->pd_svooc) { 1991 /* recheck pd */ 1992 oplus_cpa_request(chip->cpa_topic, CHG_PROTOCOL_PD); 1993 } 1994 1995 if (chip->wired_online) 1996 vote(chip->vooc_disable_votable, TIMEOUT_VOTER, true, 1, false); 1997 vote(chip->pd_svooc_votable, DEF_VOTER, false, 0, false); 1998 vote(chip->pd_svooc_votable, SVID_VOTER, false, 0, false); 1999 oplus_cpa_switch_end(chip->cpa_topic, CHG_PROTOCOL_VOOC); 2000 return; 2001 } 2002 } 2003 逐行注释
11-20
static void oplus_wired_otg_cc_limit_by_soc_work(struct work_struct *work) { struct tcpc_device *tcpc = NULL; struct pd_port *pd_port = &tcpc->pd_port; tcpc = tcpc_dev_get_by_name("type_c_port0"); /* 初始化一个结构体,但会在后面修改 */ struct tcpm_power_cap cap = { 1, {0x00019082} }; struct oplus_mms_wired *chip = container_of(work, struct oplus_mms_wired, otg_cc_limit_by_soc_work); struct oplus_usbtemp_spec_config *spec; int rc = 0; int otg_online = 0; union mms_msg_data data = { 0 }; spec = &chip->usbtemp_spec; if (tcpc == NULL) { chg_err("get type_c_port0 fail\n"); return; } rc = oplus_mms_get_item_data(chip->comm_topic, COMM_ITEM_UI_SOC, &data, false); if (!rc) { chip->ui_soc = data.intval; otg_online = oplus_wired_get_otg_online_status(chip->wired_topic); if (otg_online) { if (chip->ui_soc <= OPCHG_OTG_CC_LIMIT_LOW_SOC){ chg_err("ui_soc is below 10, limit otg_cc to default 1.3A\n"); rc = oplus_wired_set_otg_boost_curr_limit(OPCHG_USBTEMP_OTG_CC_BOOT_CURRENT_LIMIT); if (rc < 0) { chg_err("oplus_wired_set_otg_boost_curr_limit error\n"); return; } cap.cnt = 1; cap.pdos[0] = 0x00019082; // 注意:原数组第三个元素 if (tcpc->pd_port.pe_pd_state == PE_SRC_READY){ rc = tcpm_set_pd_local_source_cap(tcpc, &cap); if (rc < 0) { chg_err("tcpm_set_pd_local_source_cap error\n"); return; } rc = tcpm_dpm_pd_source_cap(tcpc, NULL); if (rc < 0) { chg_err("tcpm_dpm_pd_source_cap error\n"); return;} } }else if (chip->ui_soc >= OPCHG_OTG_CC_LIMIT_HIGH_SOC){ chg_err("ui_soc is below 10, limit otg_cc to high 2.1A\n"); rc = oplus_wired_set_otg_boost_curr_limit(OPCHG_USBTEMP_OTG_CC_BOOT_CURRENT_HIGH_LIMIT); if (rc < 0) { chg_err("oplus_wired_set_otg_boost_curr_limit error\n"); return; } cap.cnt = 1; cap.pdos[0] = 0x000190C8; // 注意:原数组第三个元素 if (tcpc->pd_port.pe_pd_state == PE_SRC_READY){ rc = tcpm_set_pd_local_source_cap(tcpc, &cap); if (rc < 0) { chg_err("tcpm_set_pd_local_source_cap error\n"); return; } rc = tcpm_dpm_pd_source_cap(tcpc, NULL); if (rc < 0) { chg_err("tcpm_dpm_pd_source_cap error\n"); return;} } }else { chg_err("ui_soc is below 10, limit otg_cc to high 1.8A\n"); rc = oplus_wired_set_otg_boost_curr_limit(OPCHG_USBTEMP_OTG_CC_BOOT_CURRENT_MIU_LIMIT); if (rc < 0) { chg_err("oplus_wired_set_otg_boost_curr_limit error\n"); return; } cap.cnt = 1; cap.pdos[0] = 0x000190B4; // 注意:原数组第三个元素 if (tcpc->pd_port.pe_pd_state == PE_SRC_READY){ rc = tcpm_set_pd_local_source_cap(tcpc, &cap); if (rc < 0) { chg_err("tcpm_set_pd_local_source_cap error\n"); return; } rc = tcpm_dpm_pd_source_cap(tcpc, NULL); if (rc < 0) { chg_err("tcpm_dpm_pd_source_cap error\n"); return;} } } } else { rc = oplus_wired_set_otg_boost_curr_limit(spec->usbtemp_otg_cc_boot_current_limit); if (rc < 0) { chg_err("oplus_wired_set_otg_boost_curr_limit error\n"); return; } } } } 将cap.cnt = 1; cap.pdos[0] = 0x000190C8; // 注意:原数组第三个元素 if (tcpc->pd_port.pe_pd_state == PE_SRC_READY){ rc = tcpm_set_pd_local_source_cap(tcpc, &cap); if (rc < 0) { chg_err("tcpm_set_pd_local_source_cap error\n"); return; } rc = tcpm_dpm_pd_source_cap(tcpc, NULL); if (rc < 0) { chg_err("tcpm_dpm_pd_source_cap error\n"); return;} }封装成一个函数
07-11
Line 626: <6>[ 1.181831][ T1] [INFO]: OPLUS_CHG[CORE]([oplus_chg_modules_init][508]): oplus_recovery init Line 635: <7>[ 1.182362][ T1] probe of soc:oplus,chg_recovery returned 0 after 472 usecs Line 689: <5>[ 1.193027][ T1] [MTK6895]([chg_get_cmd][996]): chg_get_cmd: bootargs: console=tty0 root=/dev/ram vmalloc=400M swiotlb=noforce 8250.nr_uarts=2 restrict_cma_redirect log_buf_len=2m cgroup.memory=nosocket,nokmem firmware_class.path=/vendor/firmware loop.max_part=7 initcall_debug=1 transparent_hugepage=never has_battery_removed=0 loop.max_part=7 emmc_max_chunck_size=4194304 ramoops.mem_address=0x4d010000 ramoops.mem_size=0xe0000 ramoops.pmsg_size=0x80000 ramoops.console_size=0x40000 phx_rus_conf.main_on=1 phx_rus_conf.recovery_method=2 phx_rus_conf.kernel_time=240 phx_rus_conf.android_time=250 mtkboot.sbootstate=on bootopt=64S3,32N2,64N2 buildvariant=user root=/dev/ram oplus_region=154 oplusboot.mode=normal oplus.avbkeysha256=552d218c71839b0cb250ebd2f0179a575db7766c73c75ba41d49839d6e458875 oplusboot.serialno=YDW4WSTSPFBA6DDU lcm=1-panel_ae190_p_19_a0035_dsi_video--1-fps=6014 oplus_bsp_tp_custom.dsi_display0=panel_ae190_p_19_a0035_dsi_video-panel_ae190_p_19_a0035_dsi_video-nf_ili7807s touch_panel0=0:nf_ili7807s:txd oplus_uiso Line 1059: <5>[ 1.264495][ T1] fgauge:is_recovery_mode, bootmdoe = 0 Line 1066: <5>[ 1.265009][ T1] fgauge:is_recovery_mode, bootmdoe = 0 Line 1934: <6>[ 1.738619][ T1] [TP]ILITEK: [INFO](ilitek_tddi_fw_iram_upgrade, 497): recovery DMA 1 parameters Line 6175: <6>[ 8.318755][ T442] [PHOENIX] phx_parse_cmdline: hang_oplus_recovery_method 2 Line 7861: <6>[ 15.211731][ T136] [TP]ILITEK: [INFO](ilitek_tddi_fw_iram_upgrade, 497): recovery DMA 1 parameters Line 14649: <14>[ 59.321153][ T734] apexd: Deleting unused dm device com.android.crashrecovery Line 16872: <6>[ 112.257780][ T78] [TP]ILITEK: [INFO](ilitek_tddi_fw_iram_upgrade, 497): recovery DMA 1 parameters Line 17059: <6>[ 112.523065][ T78] [TP]ILITEK: [INFO](ilitek_tddi_fw_iram_upgrade, 497): recovery DMA 1 parameters Line 17502: <5>[ 128.987585][ T131] < 128.977>TCPC-TYPEC:** ErrorRecovery Line 20828: <6>[ 229.340623][ T9087] [TP]ILITEK: [INFO](ilitek_tddi_fw_iram_upgrade, 497): recovery DMA 1 parameters Line 20977: <6>[ 229.531060][ T9087] [TP]ILITEK: [INFO](ilitek_tddi_fw_iram_upgrade, 497): recovery DMA 1 parameters
12-14
D:\金融数学\.venv\Scripts\python.exe C:\Users\HP\Desktop\mod\financial_analysis.py 当前列名: Index(['ts_code', 'trade_date', 'open', 'high', 'low', 'close', 'pre_close', 'change', 'pct_chg', 'vol', 'amount'], dtype='object') 警告:avg_price 列不存在,正在手动计算 ts_code trade_date open ... vol amount avg_price 0 000001.SZ 20241231 11.93 ... 1475367.33 1747242.074 11.8300 1 000001.SZ 20241230 11.78 ... 1351846.36 1610892.096 11.8700 2 000001.SZ 20241227 11.87 ... 1290012.28 1518383.345 11.8150 3 000001.SZ 20241226 11.92 ... 1000074.70 1183745.519 11.8725 4 000001.SZ 20241225 11.86 ... 1475282.94 1759956.630 11.9100 [5 rows x 12 columns] Traceback (most recent call last): File "D:\金融数学\.venv\Lib\site-packages\pandas\core\indexes\base.py", line 3812, in get_loc return self._engine.get_loc(casted_key) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^ File "pandas/_libs/index.pyx", line 167, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index.pyx", line 196, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 7088, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 7096, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'avg_price' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\HP\Desktop\mod\financial_analysis.py", line 76, in <module> df['close'] = df['avg_price'] # 逆回购用平均价格代替收盘价 ~~^^^^^^^^^^^^^ File "D:\金融数学\.venv\Lib\site-packages\pandas\core\frame.py", line 4107, in __getitem__ indexer = self.columns.get_loc(key) File "D:\金融数学\.venv\Lib\site-packages\pandas\core\indexes\base.py", line 3819, in get_loc raise KeyError(key) from err KeyError: 'avg_price'
08-25
基于可靠性评估序贯蒙特卡洛模拟法的配电网可靠性评估研究(Matlab代码实现)内容概要:本文围绕“基于可靠性评估序贯蒙特卡洛模拟法的配电网可靠性评估研究”,介绍了利用Matlab代码实现配电网可靠性的仿真分析方法。重点采用序贯蒙特卡洛模拟法对配电网进行长时间段的状态抽样与统计,通过模拟系统元件的故障与修复过程,评估配电网的关键可靠性指标,如系统停电频率、停电持续时间、负荷点可靠性等。该方法能够有效处理复杂网络结构与设备时序特性,提升评估精度,适用于含分布式电源、电动汽车等新型负荷接入的现代配电网。文中提供了完整的Matlab实现代码与案例分析,便于复现和扩展应用。; 适合人群:具备电力系统基础知识和Matlab编程能力的高校研究生、科研人员及电力行业技术人员,尤其适合从事配电网规划、运行与可靠性分析相关工作的人员; 使用场景及目标:①掌握序贯蒙特卡洛模拟法在电力系统可靠性评估中的基本原理与实现流程;②学习如何通过Matlab构建配电网仿真模型并进行状态转移模拟;③应用于含新能源接入的复杂配电网可靠性定量评估与优化设计; 阅读建议:建议结合文中提供的Matlab代码逐段调试运行,理解状态抽样、故障判断、修复逻辑及指标统计的具体实现方式,同时可扩展至不同网络结构或加入更多不确定性因素进行深化研究。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值