`

如何获取 Android 设备的CPU核数、时钟频率以及内存大小

阅读更多
原帖:
http://www.jianshu.com/p/f7add443cd32

Device Year Class 的主要功能是根据 CPU核数、时钟频率 以及 内存大小 对设备进行分级。
下表是 Facebook 公司提供的分级标准,其中 Year 栏表示分级结果。




以下类就是从Facebook 的开源项目Device Year Class中拿出来的
package com.yirui.youbao.util;

import android.annotation.TargetApi;
import android.app.ActivityManager;
import android.content.Context;
import android.os.Build;

import java.io.*;
/**
 * Helper class for accessing hardware specifications, including the number of CPU cores, CPU clock speed
 * and total available RAM.
 */
public class DeviceInfo {

  /**
   * The default return value of any method in this class when an
   * error occurs or when processing fails (Currently set to -1). Use this to check if
   * the information about the device in question was successfully obtained.
   */
  public static final int DEVICEINFO_UNKNOWN = -1;

  /**
   * Reads the number of CPU cores from {@code /sys/devices/system/cpu/}.
   *
   * @return Number of CPU cores in the phone, or DEVICEINFO_UKNOWN = -1 in the event of an error.
   */
  public static int getNumberOfCPUCores() {
    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
      // Gingerbread doesn't support giving a single application access to both cores, but a
      // handful of devices (Atrix 4G and Droid X2 for example) were released with a dual-core
      // chipset and Gingerbread; that can let an app in the background run without impacting
      // the foreground application. But for our purposes, it makes them single core.
      return 1;
    }
    int cores;
    try {
      cores = new File("/sys/devices/system/cpu/").listFiles(CPU_FILTER).length;
    } catch (SecurityException e) {
      cores = DEVICEINFO_UNKNOWN;
    } catch (NullPointerException e) {
      cores = DEVICEINFO_UNKNOWN;
    }
    return cores;
  }

  private static final FileFilter CPU_FILTER = new FileFilter() {
    @Override
    public boolean accept(File pathname) {
      String path = pathname.getName();
      //regex is slow, so checking char by char.
      if (path.startsWith("cpu")) {
        for (int i = 3; i < path.length(); i++) {
          if (path.charAt(i) < '0' || path.charAt(i) > '9') {
            return false;
          }
        }
        return true;
      }
      return false;
    }
  };

  /**
   * Method for reading the clock speed of a CPU core on the device. Will read from either
   * {@code /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq} or {@code /proc/cpuinfo}.
   *
   * @return Clock speed of a core on the device, or -1 in the event of an error.
   */
  public static int getCPUMaxFreqKHz() {
    int maxFreq = DEVICEINFO_UNKNOWN;
    try {
      for (int i = 0; i < getNumberOfCPUCores(); i++) {
        String filename =
            "/sys/devices/system/cpu/cpu" + i + "/cpufreq/cpuinfo_max_freq";
        File cpuInfoMaxFreqFile = new File(filename);
        if (cpuInfoMaxFreqFile.exists()) {
          byte[] buffer = new byte[128];
          FileInputStream stream = new FileInputStream(cpuInfoMaxFreqFile);
          try {
            stream.read(buffer);
            int endIndex = 0;
            //Trim the first number out of the byte buffer.
            while (buffer[endIndex] >= '0' && buffer[endIndex] <= '9'
                && endIndex < buffer.length) endIndex++;
            String str = new String(buffer, 0, endIndex);
            Integer freqBound = Integer.parseInt(str);
            if (freqBound > maxFreq) maxFreq = freqBound;
          } catch (NumberFormatException e) {
            //Fall through and use /proc/cpuinfo.
          } finally {
            stream.close();
          }
        }
      }
      if (maxFreq == DEVICEINFO_UNKNOWN) {
        FileInputStream stream = new FileInputStream("/proc/cpuinfo");
        try {
          int freqBound = parseFileForValue("cpu MHz", stream);
          freqBound *= 1000; //MHz -> kHz
          if (freqBound > maxFreq) maxFreq = freqBound;
        } finally {
          stream.close();
        }
      }
    } catch (IOException e) {
      maxFreq = DEVICEINFO_UNKNOWN; //Fall through and return unknown.
    }
    return maxFreq;
  }

  /**
   * Calculates the total RAM of the device through Android API or /proc/meminfo.
   *
   * @param c - Context object for current running activity.
   * @return Total RAM that the device has, or DEVICEINFO_UNKNOWN = -1 in the event of an error.
   */
  @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
  public static long getTotalMemory(Context c) {
    // memInfo.totalMem not supported in pre-Jelly Bean APIs.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
      ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
      ActivityManager am = (ActivityManager) c.getSystemService(Context.ACTIVITY_SERVICE);
      am.getMemoryInfo(memInfo);
      if (memInfo != null) {
        return memInfo.totalMem;
      } else {
        return DEVICEINFO_UNKNOWN;
      }
    } else {
      long totalMem = DEVICEINFO_UNKNOWN;
      try {
        FileInputStream stream = new FileInputStream("/proc/meminfo");
        try {
          totalMem = parseFileForValue("MemTotal", stream);
          totalMem *= 1024;
        } finally {
          stream.close();
        }
      } catch (IOException e) {
      }
      return totalMem;
    }
  }

  /**
   * Helper method for reading values from system files, using a minimised buffer.
   *
   * @param textToMatch - Text in the system files to read for.
   * @param stream      - FileInputStream of the system file being read from.
   * @return A numerical value following textToMatch in specified the system file.
   * -1 in the event of a failure.
   */
  private static int parseFileForValue(String textToMatch, FileInputStream stream) {
    byte[] buffer = new byte[1024];
    try {
      int length = stream.read(buffer);
      for (int i = 0; i < length; i++) {
        if (buffer[i] == '\n' || i == 0) {
          if (buffer[i] == '\n') i++;
          for (int j = i; j < length; j++) {
            int textIndex = j - i;
            //Text doesn't match query at some point.
            if (buffer[j] != textToMatch.charAt(textIndex)) {
              break;
            }
            //Text matches query here.
            if (textIndex == textToMatch.length() - 1) {
              return extractValue(buffer, j);
            }
          }
        }
      }
    } catch (IOException e) {
      //Ignore any exceptions and fall through to return unknown value.
    } catch (NumberFormatException e) {
    }
    return DEVICEINFO_UNKNOWN;
  }

  /**
   * Helper method used by {@link #parseFileForValue(String, FileInputStream) parseFileForValue}. Parses
   * the next available number after the match in the file being read and returns it as an integer.
   * @param index - The index in the buffer array to begin looking.
   * @return The next number on that line in the buffer, returned as an int. Returns
   * DEVICEINFO_UNKNOWN = -1 in the event that no more numbers exist on the same line.
   */
  private static int extractValue(byte[] buffer, int index) {
    while (index < buffer.length && buffer[index] != '\n') {
      if (buffer[index] >= '0' && buffer[index] <= '9') {
        int start = index;
        index++;
        while (index < buffer.length && buffer[index] >= '0' && buffer[index] <= '9') {
          index++;
        }
        String str = new String(buffer, 0, start, index - start);
        return Integer.parseInt(str);
      }
      index++;
    }
    return DEVICEINFO_UNKNOWN;
  }
}



package com.yirui.youbao.util;

import java.util.ArrayList;
import java.util.Collections;

import android.content.Context;

public class YearClass {
  // Year definitions
  public static final int CLASS_UNKNOWN = -1;
  public static final int CLASS_2008 = 2008;
  public static final int CLASS_2009 = 2009;
  public static final int CLASS_2010 = 2010;
  public static final int CLASS_2011 = 2011;
  public static final int CLASS_2012 = 2012;
  public static final int CLASS_2013 = 2013;
  public static final int CLASS_2014 = 2014;

  private static final long MB = 1024 * 1024;
  private static final int MHZ_IN_KHZ = 1000;

  private volatile static Integer mYearCategory;

  /**
   * Entry Point of YearClass. Extracts YearClass variable with memoizing.
   * Example usage:
   * <p>
   * <pre>
   *   int yearClass = YearClass.get(context);
   * </pre>
   */
  public static int get(Context c) {
    if (mYearCategory == null) {
      synchronized(YearClass.class) {
        if (mYearCategory == null) {
          mYearCategory = categorizeByYear(c);
        }
      }
    }
    return mYearCategory;
  }

  private static void conditionallyAdd(ArrayList<Integer> list, int value) {
    if (value != CLASS_UNKNOWN) {
      list.add(value);
    }
  }

  /**
   * Calculates the "best-in-class year" of the device. This represents the top-end or flagship
   * devices of that year, not the actual release year of the phone. For example, the Galaxy Duos
   * S was released in 2012, but its specs are very similar to the Galaxy S that was released in
   * 2010 as a then top-of-the-line phone, so it is a 2010 device.
   *
   * @return The year when this device would have been considered top-of-the-line.
   */
  private static int categorizeByYear(Context c) {
    ArrayList<Integer> componentYears = new ArrayList<Integer>();
    conditionallyAdd(componentYears, getNumCoresYear());
    conditionallyAdd(componentYears, getClockSpeedYear());
    conditionallyAdd(componentYears, getRamYear(c));
    if (componentYears.isEmpty())
      return CLASS_UNKNOWN;
    Collections.sort(componentYears);
    if ((componentYears.size() & 0x01) == 1) {  // Odd number; pluck the median.
      return componentYears.get(componentYears.size() / 2);
    } else { // Even number. Average the two "center" values.
      int baseIndex = componentYears.size() / 2 - 1;
      // There's an implicit rounding down in here; 2011.5 becomes 2011.
      return componentYears.get(baseIndex) +
          (componentYears.get(baseIndex + 1) - componentYears.get(baseIndex)) / 2;
    }
  }

  /**
   * Calculates the year class by the number of processor cores the phone has.
   * Evaluations are based off the table below:
   * <table border="1">
   * <thead>
   * <tr><th width="50%">Amount</th><th>Year</th></tr>
   * <thead>
   * <tbody>
   * <tr><td>>4 or More</td><td>2012</td></tr>
   * <tr><td>2 or 3</td><td>2011</td></tr>
   * <tr><td>1</td><td>2008</td></tr>
   * </tbody>
   * </table>
   *
   * @return the year in which top-of-the-line phones had the same number of processors as this phone.
   */
  private static int getNumCoresYear() {
    int cores = DeviceInfo.getNumberOfCPUCores();
    if (cores < 1) return CLASS_UNKNOWN;
    if (cores == 1) return CLASS_2008;
    if (cores <= 3) return CLASS_2011;
    return CLASS_2012;
  }

  /**
   * Calculates the year class by the clock speed of the cores in the phone.
   * Evaluations are based off the table below:
   * <table border="1">
   * <thead>
   * <tr><th width="50%">Amount</th><th>Year</th></tr>
   * <thead>
   * <tbody>
   * <tr><td>>2GHz</td><td>2014</td></tr>
   * <tr><td><=2GHz</td><td>2013</td></tr>
   * <tr><td><=1.5GHz</td><td>2012</td></tr>
   * <tr><td><=1.2GHz</td><td>2011</td></tr>
   * <tr><td><=1GHz</td><td>2010</td></tr>
   * <tr><td><=600MHz</td><td>2009</td></tr>
   * <tr><td><=528MHz</td><td>2008</td></tr>
   * </tbody>
   * </table>
   *
   * @return the year in which top-of-the-line phones had the same clock speed.
   */
  private static int getClockSpeedYear() {
    long clockSpeedKHz = DeviceInfo.getCPUMaxFreqKHz();
    if (clockSpeedKHz == DeviceInfo.DEVICEINFO_UNKNOWN) return CLASS_UNKNOWN;
    // These cut-offs include 20MHz of "slop" because my "1.5GHz" Galaxy S3 reports
    // its clock speed as 1512000. So we add a little slop to keep things nominally correct.
    if (clockSpeedKHz <= 528 * MHZ_IN_KHZ) return CLASS_2008;
    if (clockSpeedKHz <= 620 * MHZ_IN_KHZ) return CLASS_2009;
    if (clockSpeedKHz <= 1020 * MHZ_IN_KHZ) return CLASS_2010;
    if (clockSpeedKHz <= 1220 * MHZ_IN_KHZ) return CLASS_2011;
    if (clockSpeedKHz <= 1520 * MHZ_IN_KHZ) return CLASS_2012;
    if (clockSpeedKHz <= 2020 * MHZ_IN_KHZ) return CLASS_2013;
    return CLASS_2014;
  }

  /**
   * Calculates the year class by the amount of RAM the phone has.
   * Evaluations are based off the table below:
   * <table border="1">
   * <thead>
   * <tr><th width="50%">Amount</th><th>Year</th></tr>
   * <thead>
   * <tbody>
   * <tr><td>>2GB</td><td>2014</td></tr>
   * <tr><td><=2GB</td><td>2013</td></tr>
   * <tr><td><=1.5GB</td><td>2012</td></tr>
   * <tr><td><=1GB</td><td>2011</td></tr>
   * <tr><td><=512MB</td><td>2010</td></tr>
   * <tr><td><=256MB</td><td>2009</td></tr>
   * <tr><td><=128MB</td><td>2008</td></tr>
   * </tbody>
   * </table>
   *
   * @return the year in which top-of-the-line phones had the same amount of RAM as this phone.
   */
  private static int getRamYear(Context c) {
    long totalRam = DeviceInfo.getTotalMemory(c);
    if (totalRam <= 0) return CLASS_UNKNOWN;
    if (totalRam <= 192 * MB) return CLASS_2008;
    if (totalRam <= 290 * MB) return CLASS_2009;
    if (totalRam <= 512 * MB) return CLASS_2010;
    if (totalRam <= 1024 * MB) return CLASS_2011;
    if (totalRam <= 1536 * MB) return CLASS_2012;
    if (totalRam <= 2048 * MB) return CLASS_2013;
    return CLASS_2014;
  }
}


使用方法:
import android.app.Activity;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.widget.TextView;
import com.facebook.device.yearclass.YearClass;

public class MainActivity extends Activity {
  private static final String PREF_FILE = "YearClass";
  private static final String PREF_NAME = "yearclass";
  private TextView mYearClass;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    GetOrComputeYearClass findYearClass = new GetOrComputeYearClass();
    findYearClass.execute();
    mYearClass = (TextView) findViewById(R.id.year_class);
  }

  private class GetOrComputeYearClass extends AsyncTask<Void, Void, Integer> {

    @Override
    protected Integer doInBackground(Void... voids) {
      int yearClass = YearClass.CLASS_UNKNOWN;
      SharedPreferences prefs = getSharedPreferences(PREF_FILE, 0);
      if (prefs.contains(PREF_NAME)) {
        yearClass = prefs.getInt(PREF_NAME, YearClass.CLASS_UNKNOWN);
      }
      //Try again if device was previously unknown.
      if (yearClass == YearClass.CLASS_UNKNOWN) {
        yearClass = YearClass.get(getApplicationContext());
        SharedPreferences.Editor editor = prefs.edit();
        editor.putInt(PREF_NAME, yearClass);
        editor.apply();
      }
      return yearClass;
    }

    @Override
    protected void onPostExecute(Integer yearClass) {
      //update UI
      mYearClass.setText(Integer.toString(yearClass));
    }
  }
}


运行在Android设备上,启动本程序之后,在任何窗口可显示当前CPU工作频率等状态,显示当前电压电流电池容量等信息
https://github.com/will86/android-runninginfo
  • 大小: 15.8 KB
分享到:
评论

相关推荐

    Android获取设备CPU核数、时钟频率以及内存大小的方法

    本文实例讲述了Android获取设备CPU核数、时钟频率以及内存大小的方法。分享给大家供大家参考,具体如下: 因项目需要,分析了一下 Facebook 的开源项目 – Device Year Class。 Device Year Class 的主要功能是根据 ...

    基于主从博弈的共享储能与综合能源微网优化运行研究:MATLAB与CPLEX实现

    内容概要:本文详细探讨了在主从博弈框架下,共享储能与综合能源微网的优化运行及其仿真复现。通过MATLAB和CPLEX的联合使用,展示了微网运营商和用户聚合商之间的动态博弈过程。上层模型关注微网运营商的定价策略,旨在最大化利润,考虑售电收益、储能运维成本等因素。下层模型则聚焦于用户聚合商的响应,根据电价调整电热负荷并参与共享储能调度。文中还介绍了电热耦合约束、充放电互斥约束等关键技术细节,并通过迭代博弈实现了策略更新。最终仿真结果显示,在引入电制热设备后,用户侧热负荷弹性提升,博弈收敛速度加快,达到双赢效果。 适合人群:从事能源系统优化、博弈论应用、MATLAB编程的研究人员和技术人员。 使用场景及目标:适用于希望深入了解主从博弈在综合能源系统中应用的学者和工程师。目标是掌握如何通过数学建模和编程实现复杂的能源系统优化,理解电热耦合机制和共享储能的作用。 其他说明:文章提供了详细的代码片段和仿真结果,帮助读者更好地理解和复现实验。此外,还讨论了一些常见的调试问题和解决方案,如约束冲突等。

    【基于矢量射线的衍射积分 (VRBDI)】基于矢量射线的衍射积分 (VRBDI) 和仿真工具附Matlab代码.rar

    1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    【深度学习应用综述】多领域关键技术及应用场景汇总:从计算机视觉到金融风控的全面解析

    内容概要:深度学习在多个领域有着广泛应用。在计算机视觉方面,涵盖图像分类、目标检测、图像分割等任务,应用于自动驾驶、医疗影像分析等领域;在自然语言处理上,包括机器翻译、文本分类、文本生成等功能,服务于信息检索、内容创作等;语音识别与合成领域,实现了语音到文本的转换以及文本到语音的生成,推动了智能交互的发展;医疗领域,深度学习助力医学影像分析、疾病预测、个性化治疗及健康监测;金融领域,深度学习用于信用风险评估、欺诈检测、高频交易等,保障金融安全并优化投资策略;自动驾驶方面,环境感知与决策控制系统确保车辆安全行驶;娱乐与媒体领域,个性化推荐和内容生成提升了用户体验;工业与制造业中,质量检测和预测性维护提高了生产效率和产品质量。 适合人群:对深度学习及其应用感兴趣的初学者、研究人员以及相关领域的从业者。 使用场景及目标:帮助读者全面了解深度学习在不同行业的具体应用场景,明确各领域中深度学习解决的实际问题,为后续深入研究或项目实施提供方向指引。 其他说明:随着深度学习技术的持续进步,其应用范围也在不断扩大,文中提及的应用实例仅为当前主要成果展示,未来还有更多潜力待挖掘。

    【ARIMA-LSTM】合差分自回归移动平均方法-长短期记忆神经网络研究附Python代码.rar

    1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    周梁伟-大模型在融合通信中的应用实践.pdf

    周梁伟-大模型在融合通信中的应用实践

    基于S7-200 PLC与组态王的花式喷泉控制系统设计及应用

    内容概要:本文详细介绍了利用西门子S7-200 PLC和组态王软件构建的一个花式喷泉控制系统的设计与实现。首先阐述了系统的硬件组成,包括三个环形喷泉组、七彩LED灯带以及功放喇叭等组件,并给出了详细的IO分配表。接着深入解析了关键的梯形图程序逻辑,如自动模式循环、灯光控制、喷泉舞步等部分的具体实现方法。此外,还分享了一些实际调试过程中遇到的问题及其解决方案,例如电源隔离、电磁干扰处理等。最后展示了组态王界面上生动有趣的动画效果设计思路。 适合人群:对PLC编程和工业自动化感兴趣的工程师和技术爱好者。 使用场景及目标:适用于需要设计类似互动娱乐设施的专业人士,旨在帮助他们掌握从硬件选型、程序编写到界面美化的完整流程,从而能够独立完成类似的工程项目。 其他说明:文中不仅提供了理论知识讲解,还包括了许多实践经验教训,对于初学者来说非常有价值。同时,作者还在系统中加入了一些趣味性的元素,如隐藏模式等,增加了项目的吸引力。

    基于COMSOL的电弧熔池多物理场耦合仿真技术详解

    内容概要:本文详细介绍了利用COMSOL进行电弧熔池多物理场耦合仿真的方法和技术要点。首先解释了电弧熔池的本质及其复杂性,然后依次讲解了几何建模、材料属性设置、求解器配置以及后处理等方面的具体步骤和注意事项。文中提供了大量实用的MATLAB、Java和Python代码片段,帮助用户更好地理解和应用相关技术。此外,作者分享了许多实践经验,如分阶段激活物理场、使用光滑过渡函数处理相变、优化网格划分等,强调了参数选择和边界条件设定的重要性。 适合人群:从事电弧熔池仿真研究的专业人士,尤其是有一定COMSOL使用经验的研究人员。 使用场景及目标:适用于需要精确模拟电弧熔池行为的研究项目,旨在提高仿真精度并减少计算时间。主要目标是掌握多物理场耦合仿真的关键技术,解决实际工程中遇到的问题。 其他说明:文章不仅提供了详细的理论指导,还包括许多实用的操作技巧和常见错误的解决方案,有助于读者快速上手并深入理解电弧熔池仿真的难点和重点。

    9f148310e17f2960fea3ff60af384a37_098bb292f553b9f4ff9c67367379fafd.png

    9f148310e17f2960fea3ff60af384a37_098bb292f553b9f4ff9c67367379fafd

    spring-ai-hanadb-store-1.0.0-M7.jar中文-英文对照文档.zip

    # 【spring-ai-hanadb-store-1.0.0-M7.jar中文-英文对照文档.zip】 中包含: 中文-英文对照文档:【spring-ai-hanadb-store-1.0.0-M7-javadoc-API文档-中文(简体)-英语-对照版.zip】 jar包下载地址:【spring-ai-hanadb-store-1.0.0-M7.jar下载地址(官方地址+国内镜像地址).txt】 Maven依赖:【spring-ai-hanadb-store-1.0.0-M7.jar Maven依赖信息(可用于项目pom.xml).txt】 Gradle依赖:【spring-ai-hanadb-store-1.0.0-M7.jar Gradle依赖信息(可用于项目build.gradle).txt】 源代码下载地址:【spring-ai-hanadb-store-1.0.0-M7-sources.jar下载地址(官方地址+国内镜像地址).txt】 # 本文件关键字: spring-ai-hanadb-store-1.0.0-M7.jar中文-英文对照文档.zip,java,spring-ai-hanadb-store-1.0.0-M7.jar,org.springframework.ai,spring-ai-hanadb-store,1.0.0-M7,org.springframework.ai.vectorstore.hanadb,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,springframework,spring,ai,hanadb,store,中文-英文对照API文档,手册,开发手册,使用手册,参考手册 # 使用方法: 解压 【spring-ai-hanadb-store-1.0.0-M7.jar中文-英文

    azure-ai-openai-1.0.0-beta.7.jar中文文档.zip

    # 压缩文件中包含: 中文文档 jar包下载地址 Maven依赖 Gradle依赖 源代码下载地址 # 本文件关键字: jar中文文档.zip,java,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,中文API文档,手册,开发手册,使用手册,参考手册 # 使用方法: 解压最外层zip,再解压其中的zip包,双击 【index.html】 文件,即可用浏览器打开、进行查看。 # 特殊说明: ·本文档为人性化翻译,精心制作,请放心使用。 ·只翻译了该翻译的内容,如:注释、说明、描述、用法讲解 等; ·不该翻译的内容保持原样,如:类名、方法名、包名、类型、关键字、代码 等。 # 温馨提示: (1)为了防止解压后路径太长导致浏览器无法打开,推荐在解压时选择“解压到当前文件夹”(放心,自带文件夹,文件不会散落一地); (2)有时,一套Java组件会有多个jar,所以在下载前,请仔细阅读本篇描述,以确保这就是你需要的文件;

    3dmax插件复制属性.ms

    3dmax插件

    单相全桥PWM整流双闭环控制系统:电压环PI与电流环PR控制策略及其应用

    内容概要:本文详细介绍了单相全桥PWM整流器采用双闭环控制策略的具体实现方法和技术要点。电压环采用PI控制器来稳定直流侧电压,电流环则使用PR控制器确保交流电流与电压同相位并实现单位功率因数。文中提供了详细的MATLAB、C和Python代码片段,解释了各个控制器的设计思路和参数整定方法。此外,文章还讨论了突加负载测试、电压前馈补偿、PWM生成以及硬件选型等方面的内容,强调了系统的稳定性和快速响应能力。 适合人群:从事电力电子、自动控制领域的工程师和技术人员,尤其是对PWM整流器和双闭环控制感兴趣的读者。 使用场景及目标:适用于需要精确控制直流电压和交流电流的应用场景,如工业电源、新能源发电等领域。目标是提高系统的电能质量和动态响应速度,确保在负载变化时仍能保持稳定的输出。 其他说明:文章不仅提供了理论分析,还包括了大量的实际测试数据和波形图,帮助读者更好地理解和掌握双闭环控制的实际效果。同时,文中提到的一些调试技巧和注意事项对于实际工程应用非常有价值。

    easyocr安装包和模型

    easyocr安装包和模型

    AC-DIMMER交流调光灯stm32.7z

    AC_DIMMER交流调光灯stm32.7z

    仲量联行-负责任的房地产:实现社会价值,赋能建筑环境,创造积极的环境和社会影响.pdf

    仲量联行-负责任的房地产:实现社会价值,赋能建筑环境,创造积极的环境和社会影响

    C语言全部知识点复习资料.doc

    C语言全部知识点复习资料.doc

    【蓝桥杯EDA】客观题解析:第十二届省赛第一场真题.pdf

    【蓝桥杯EDA】客观题解析

    电-气-热综合能源系统调度:MATLAB与CPLEX优化模型及其应用

    内容概要:本文详细介绍了电-气-热综合能源系统的优化调度方法,重点探讨了如何利用MATLAB和CPLEX进行建模和求解。文章首先分别阐述了电网、气网和热网的建模方法,包括电网的直流潮流模型、气网的线性化处理以及热网的状态空间方程。接着深入讨论了各个网络之间的耦合关系,如电转气设备(P2G)、燃气轮机和电热锅炉的作用机制。文中还分享了一些实用技巧,如变量定义顺序对求解速度的影响、分段线性化的精度与效率权衡等。最后展示了完整的优化模型结构,并通过实例验证了模型的有效性和优越性。 适合人群:从事综合能源系统研究和开发的技术人员,尤其是熟悉MATLAB和CPLEX工具的研究者。 使用场景及目标:适用于希望深入了解并掌握电-气-热综合能源系统调度优化方法的专业人士。主要目标是提高能源利用效率,降低成本,增强系统的稳定性和可靠性。 其他说明:文章不仅提供了详细的理论解释和技术实现步骤,还分享了许多实践经验,帮助读者更好地理解和应用相关技术。

Global site tag (gtag.js) - Google Analytics