iphone数据库(sqlite3)的用法操作

本文介绍如何在 iPhone 应用中使用 SQLite 数据库进行增删改查等基本操作,包括数据库的创建、打开及 SQL 语句的执行。

iphone数据库(sqlite3)的用法操作
2012-05-30 14:36:36      我来说两句      
收藏     我要投稿

首先你在用之前要在项目中加入libsqlite3.dylib

1、定义模型

[cpp] #import <Foundation/Foundation.h>  
#import "sqlite3.h"  
@class NotePad; 
@class NoteDb; 
@interface NoteSqlite : NSObject{ 
    sqlite3 *database; 
    sqlite3_stmt *statement; 
    char *errorMsg; 

//打开数据库  
-(BOOL)open; 
//创建青  
-(BOOL)create; 
 
//增加、删除、修改、查询  
-(BOOL)insert:(NotePad*)aNote; 
-(BOOL)deleteALLNote; 
-(BOOL)deleteaNote:(NotePad*)aNote; 
-(BOOL)update:(NotePad*)aNote; 
 
-(NoteDb*)selecteAll; 
-(NoteDb*)selectNotes:(NotePad*)aNote; 
 
@end 
#import <Foundation/Foundation.h>
#import "sqlite3.h"
@class NotePad;
@class NoteDb;
@interface NoteSqlite : NSObject{
    sqlite3 *database;
    sqlite3_stmt *statement;
    char *errorMsg;
}
//打开数据库
-(BOOL)open;
//创建青
-(BOOL)create;

//增加、删除、修改、查询
-(BOOL)insert:(NotePad*)aNote;
-(BOOL)deleteALLNote;
-(BOOL)deleteaNote:(NotePad*)aNote;
-(BOOL)update:(NotePad*)aNote;

-(NoteDb*)selecteAll;
-(NoteDb*)selectNotes:(NotePad*)aNote;

@end

2、实现方法

[cpp] #import "NoteSqlite.h"  
#import "NotePad.h"  
#import "NoteDb.h"  
@implementation NoteSqlite 
 
-(id)init{ 
    self=[super init]; 
    return self; 

//打开数据库  
-(BOOL)open{ 
    NSArray *paths= NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
    NSString *documentsDirectory = [paths objectAtIndex:0]; 
    NSString *path = [documentsDirectory stringByAppendingPathComponent:@"noteList.db"]; 
    NSFileManager *fileManager = [NSFileManager defaultManager]; 
    BOOL find = [fileManager fileExistsAtPath:path]; 
    //判断文件是否存在  
    if (find) { 
        NSLog(@"数据库文件已经存在"); 
        //打开数据库、返回操作是否正确  
        if(sqlite3_open([path UTF8String], &database) == SQLITE_OK) { 
            NSLog(@"打开成功数据库"); 
        } 
        return YES; 
    }else{ 
        if(sqlite3_open([path UTF8String], &database) == SQLITE_OK) { 
            //调用createMusicList创建数据库和表  
            [self create];              
            return YES; 
        } else { 
            sqlite3_close(database); 
            NSLog(@"Error: open database file."); 
            return NO; 
        } 
        return NO; 
    } 
 

//创建表  
-(BOOL)create{ 
    //创建表语句  
    const char *createSql="create table if not exists note (id integer primary key autoincrement,theme text,information text,ndate text,priority integer)";  
    //创建表是否成功  
    if (sqlite3_exec(database, createSql, NULL, NULL, &errorMsg)==SQLITE_OK) {        
        NSLog(@"create ok.");    
        return YES; 
    }else{ 
        //打印出错信息  
        NSLog(@"error: %s",errorMsg);  
        sqlite3_free(errorMsg); 
    } 
    return NO; 
 

 
//增加、删除、修改、查询  
-(BOOL)insert:(NotePad*)aNote{ 
    //向表中插入记录    
    //定义一个sql语句          
    NSString *insertStatementNS = [NSString stringWithFormat: 
                                   @"insert into \"note\"\ 
                                   (theme, information, ndate,priority)\ 
                                   values (\"%@\", \"%@\", \"%@\",%d)", 
                                   aNote.theme,aNote.information,[NSString stringWithFormat:@"%@",aNote.ndate],aNote.priority 
                                    ]; 
    //将定义的NSString的sql语句,转换成UTF8的c风格的字符串  
    const char *insertSql = [insertStatementNS UTF8String]; 
    //执行插入语句   
    if (sqlite3_exec(database, insertSql, NULL, NULL, &errorMsg)==SQLITE_OK) {   
        NSLog(@"insert ok.");  
        return YES; 
    }else{ 
        NSLog(@"error: %s",errorMsg);  
        sqlite3_free(errorMsg); 
    }  
    return NO; 
 

-(BOOL)deleteALLNote{ 
    //删除所有数据,条件为1>0永真  
    const char *deleteAllSql="delete from note where 1>0"; 
    //执行删除语句  
    if(sqlite3_exec(database, deleteAllSql, NULL, NULL, &errorMsg)==SQLITE_OK){ 
        NSLog(@"删除所有数据成功"); 
    } 
    return YES; 

-(BOOL)deleteaNote:(NotePad*)aNote{ 
    //删除某条数据  
    NSString *deleteString=[NSString stringWithFormat:@"delete from note where id=%d",aNote.noteId]; 
    //转成utf-8的c的风格  
    const char *deleteSql=[deleteString UTF8String]; 
    //执行删除语句  
    if(sqlite3_exec(database, deleteSql, NULL, NULL, &errorMsg)==SQLITE_OK){ 
        NSLog(@"删除成功"); 
    } 
    return YES; 

-(BOOL)update:(NotePad*)aNote{ 
    //更新语句  
    NSString *updateString=[NSString stringWithFormat:@"update note set theme='%@'information='%@',ndate='%@',priority=%d where id=%d",aNote.theme,aNote.information,aNote.ndate,aNote.priority,aNote.noteId]; 
   // NSLog(@"%@",aNote);  
    const char *updateSql=[updateString UTF8String]; 
    //执行更新语句  
    if(sqlite3_exec(database, updateSql, NULL, NULL, &errorMsg)==SQLITE_OK){ 
        NSLog(@"更新成功"); 
    }    
    return YES; 

 
-(NoteDb*)selecteAll{ 
    NoteDb *noteDb=[[[NoteDb alloc]init]autorelease]; 
    //查询所有语句  
    const char *selectAllSql="select * from note"; 
    //执行查询  
    if (sqlite3_prepare_v2(database, selectAllSql, -1, &statement, nil)==SQLITE_OK) { 
        NSLog(@"select ok.");   
        //如果查询有语句就执行step来添加数据  
        while (sqlite3_step(statement)==SQLITE_ROW) { 
            NotePad *note=[[NotePad alloc]init]; 
             
            int noteid=sqlite3_column_int(statement, 0); 
            NSMutableString *theme=[NSMutableString stringWithCString:(char*)sqlite3_column_text(statement, 1) encoding:NSUTF8StringEncoding]; 
            NSMutableString *information=[NSMutableString stringWithCString:(char*)sqlite3_column_text(statement, 2) encoding:NSUTF8StringEncoding]; 
            NSString *ndateString=[NSString stringWithCString:(char*)sqlite3_column_text(statement, 3) encoding:NSUTF8StringEncoding]; 
            NSDateFormatter* formater = [[NSDateFormatter alloc] init]; 
            [formater setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; 
             
            NSDate *ndate=[formater dateFromString:[ndateString substringToIndex:[ndateString length]-5]]; 
           // NSLog(@"%@",[ndateString substringToIndex:[ndateString length]-5]);  
            [formater release]; 
            int proriory=sqlite3_column_int(statement, 4); 
             
            note.noteId=noteid; 
            note.theme=theme; 
            note.information=information; 
            note.ndate=ndate; 
            note.priority=proriory; 
            [noteDb addNote:note]; 
            [note release]; 
             
        } 
        return noteDb; 
    } 
    return noteDb; 

-(NoteDb*)selectNotes:(NotePad*)aNote{ 
    NoteDb *noteDb=[[[NoteDb alloc]init]autorelease]; 
    NSString *selectNSSql=[NSString stringWithFormat:@"select * from note where id=%i",aNote.noteId]; 
    //查询所有语句  
    const char *selectSql=[selectNSSql UTF8String]; 
    //执行查询  
    if (sqlite3_prepare_v2(database, selectSql, -1, &statement, nil)==SQLITE_OK) { 
        NSLog(@"select ok.");   
        //如果查询有语句就执行step来添加数据  
        while (sqlite3_step(statement)==SQLITE_ROW) { 
            NotePad *note=[[NotePad alloc]init]; 
             
            int noteid=sqlite3_column_int(statement, 0); 
            NSMutableString *theme=[NSMutableString stringWithCString:(char*)sqlite3_column_text(statement, 1) encoding:NSUTF8StringEncoding]; 
            NSMutableString *information=[NSMutableString stringWithCString:(char*)sqlite3_column_text(statement, 2) encoding:NSUTF8StringEncoding]; 
            NSString *ndateString=[NSString stringWithCString:(char*)sqlite3_column_text(statement, 3) encoding:NSUTF8StringEncoding]; 
            NSDateFormatter* formater = [[NSDateFormatter alloc] init]; 
            [formater setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; 
             
            NSDate *ndate=[formater dateFromString:[ndateString substringToIndex:[ndateString length]-5]]; 
            // NSLog(@"%@",[ndateString substringToIndex:[ndateString length]-5]);  
            [formater release]; 
            int proriory=sqlite3_column_int(statement, 4); 
             
            note.noteId=noteid; 
            note.theme=theme; 
            note.information=information; 
            note.ndate=ndate; 
            note.priority=proriory; 
            [noteDb addNote:note]; 
            [note release]; 
             
        } 
        return noteDb; 
    } 
    return noteDb; 

@end 
#import "NoteSqlite.h"
#import "NotePad.h"
#import "NoteDb.h"
@implementation NoteSqlite

-(id)init{
    self=[super init];
    return self;
}
//打开数据库
-(BOOL)open{
    NSArray *paths= NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *path = [documentsDirectory stringByAppendingPathComponent:@"noteList.db"];
    NSFileManager *fileManager = [NSFileManager defaultManager];
    BOOL find = [fileManager fileExistsAtPath:path];
    //判断文件是否存在 www.2cto.com
    if (find) {
        NSLog(@"数据库文件已经存在");
        //打开数据库、返回操作是否正确
        if(sqlite3_open([path UTF8String], &database) == SQLITE_OK) {
            NSLog(@"打开成功数据库");
        }
        return YES;
    }else{
        if(sqlite3_open([path UTF8String], &database) == SQLITE_OK) {
            //调用createMusicList创建数据库和表
            [self create];            
            return YES;
        } else {
            sqlite3_close(database);
            NSLog(@"Error: open database file.");
            return NO;
        }
        return NO;
    }

}
//创建表
-(BOOL)create{
    //创建表语句
    const char *createSql="create table if not exists note (id integer primary key autoincrement,theme text,information text,ndate text,priority integer)";
    //创建表是否成功
    if (sqlite3_exec(database, createSql, NULL, NULL, &errorMsg)==SQLITE_OK) {      
        NSLog(@"create ok.");  
        return YES;
    }else{
        //打印出错信息
        NSLog(@"error: %s",errorMsg);
        sqlite3_free(errorMsg);
    }
    return NO;

}

//增加、删除、修改、查询
-(BOOL)insert:(NotePad*)aNote{
    //向表中插入记录 
    //定义一个sql语句       
    NSString *insertStatementNS = [NSString stringWithFormat:
           @"insert into \"note\"\
           (theme, information, ndate,priority)\
           values (\"%@\", \"%@\", \"%@\",%d)",
           aNote.theme,aNote.information,[NSString stringWithFormat:@"%@",aNote.ndate],aNote.priority
                                    ];
    //将定义的NSString的sql语句,转换成UTF8的c风格的字符串
    const char *insertSql = [insertStatementNS UTF8String];
    //执行插入语句
    if (sqlite3_exec(database, insertSql, NULL, NULL, &errorMsg)==SQLITE_OK) { 
        NSLog(@"insert ok.");
        return YES;
    }else{
        NSLog(@"error: %s",errorMsg);
        sqlite3_free(errorMsg);
    }
    return NO;

}
-(BOOL)deleteALLNote{
    //删除所有数据,条件为1>0永真
    const char *deleteAllSql="delete from note where 1>0";
    //执行删除语句
    if(sqlite3_exec(database, deleteAllSql, NULL, NULL, &errorMsg)==SQLITE_OK){
        NSLog(@"删除所有数据成功");
    }
    return YES;
}
-(BOOL)deleteaNote:(NotePad*)aNote{
    //删除某条数据
    NSString *deleteString=[NSString stringWithFormat:@"delete from note where id=%d",aNote.noteId];
    //转成utf-8的c的风格
    const char *deleteSql=[deleteString UTF8String];
    //执行删除语句
    if(sqlite3_exec(database, deleteSql, NULL, NULL, &errorMsg)==SQLITE_OK){
        NSLog(@"删除成功");
    }
    return YES;
}
-(BOOL)update:(NotePad*)aNote{
    //更新语句
    NSString *updateString=[NSString stringWithFormat:@"update note set theme='%@'information='%@',ndate='%@',priority=%d where id=%d",aNote.theme,aNote.information,aNote.ndate,aNote.priority,aNote.noteId];
   // NSLog(@"%@",aNote);
    const char *updateSql=[updateString UTF8String];
    //执行更新语句
    if(sqlite3_exec(database, updateSql, NULL, NULL, &errorMsg)==SQLITE_OK){
        NSLog(@"更新成功");
    }  
    return YES;
}

-(NoteDb*)selecteAll{
    NoteDb *noteDb=[[[NoteDb alloc]init]autorelease];
    //查询所有语句
    const char *selectAllSql="select * from note";
    //执行查询
    if (sqlite3_prepare_v2(database, selectAllSql, -1, &statement, nil)==SQLITE_OK) {
        NSLog(@"select ok."); 
        //如果查询有语句就执行step来添加数据
        while (sqlite3_step(statement)==SQLITE_ROW) {
            NotePad *note=[[NotePad alloc]init];
           
            int noteid=sqlite3_column_int(statement, 0);
            NSMutableString *theme=[NSMutableString stringWithCString:(char*)sqlite3_column_text(statement, 1) encoding:NSUTF8StringEncoding];
            NSMutableString *information=[NSMutableString stringWithCString:(char*)sqlite3_column_text(statement, 2) encoding:NSUTF8StringEncoding];
            NSString *ndateString=[NSString stringWithCString:(char*)sqlite3_column_text(statement, 3) encoding:NSUTF8StringEncoding];
            NSDateFormatter* formater = [[NSDateFormatter alloc] init];
            [formater setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
           
            NSDate *ndate=[formater dateFromString:[ndateString substringToIndex:[ndateString length]-5]];
           // NSLog(@"%@",[ndateString substringToIndex:[ndateString length]-5]);
            [formater release];
            int proriory=sqlite3_column_int(statement, 4);
           
            note.noteId=noteid;
            note.theme=theme;
            note.information=information;
            note.ndate=ndate;
            note.priority=proriory;
            [noteDb addNote:note];
            [note release];
           
        }
        return noteDb;
    }
    return noteDb;
}
-(NoteDb*)selectNotes:(NotePad*)aNote{
    NoteDb *noteDb=[[[NoteDb alloc]init]autorelease];
    NSString *selectNSSql=[NSString stringWithFormat:@"select * from note where id=%i",aNote.noteId];
    //查询所有语句
    const char *selectSql=[selectNSSql UTF8String];
    //执行查询
    if (sqlite3_prepare_v2(database, selectSql, -1, &statement, nil)==SQLITE_OK) {
        NSLog(@"select ok."); 
        //如果查询有语句就执行step来添加数据
        while (sqlite3_step(statement)==SQLITE_ROW) {
            NotePad *note=[[NotePad alloc]init];
           
            int noteid=sqlite3_column_int(statement, 0);
            NSMutableString *theme=[NSMutableString stringWithCString:(char*)sqlite3_column_text(statement, 1) encoding:NSUTF8StringEncoding];
            NSMutableString *information=[NSMutableString stringWithCString:(char*)sqlite3_column_text(statement, 2) encoding:NSUTF8StringEncoding];
            NSString *ndateString=[NSString stringWithCString:(char*)sqlite3_column_text(statement, 3) encoding:NSUTF8StringEncoding];
            NSDateFormatter* formater = [[NSDateFormatter alloc] init];
            [formater setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
           
            NSDate *ndate=[formater dateFromString:[ndateString substringToIndex:[ndateString length]-5]];
            // NSLog(@"%@",[ndateString substringToIndex:[ndateString length]-5]);
            [formater release];
            int proriory=sqlite3_column_int(statement, 4);
           
            note.noteId=noteid;
            note.theme=theme;
            note.information=information;
            note.ndate=ndate;
            note.priority=proriory;
            [noteDb addNote:note];
            [note release];
           
        }
        return noteDb;
    }
    return noteDb;
}
@end

 

 

摘自 任海丽(3G/移动开发)


内容概要:本文围绕“计及蓄意攻击的电网多阶段级联故障诱发机制与MILP优化模型”展开,提出了一种基于混合整数线性规划(MILP)的双层优化模型,用于模拟和分析在蓄意攻击下电力系统多阶段级联故障的传播机理与脆弱性特征。通过构建攻击者与系统运行之间的博弈框架,上层模型刻画攻击者以最小代价最大化系统损失的最优攻击策略,下层模型模拟电网在故障后的交流潮流重分布、负荷切除及系统恢复行为,从而实现对关键脆弱元件和攻击路径的精准识别。研究依托Matlab平台实现完整算法流程,并结合IEEE 39节点、33节点等标准系统进行仿真验证,有效评估了电网在恶意攻击场景下的安全性与韧性水平,为电力系统的防御加固、关键资产保护及应急预案制定提供了理论依据与技术支撑。; 适合人群:具备电力系统分析、运筹学优化理论基础及Matlab编程能力的研究生、高校科研人员以及从事电网安全评估、电力系统规划与防御策略研究的工程技术人员。; 使用场景及目标:①用于电力系统关键节点与线路的脆弱性评估,识别潜在攻击目标;②支撑电网主动防御体系设计,优化防护资源布局;③作为高水平学术研究参考资料,复现并拓展顶级EI期刊论文中的建模方法与仿真流程,进一步研究N-k故障、虚假数据注入攻击等延伸问题。; 阅读建议:建议结合提供的Matlab代码与网盘资料,逐步调试运行仿真案例,深入理解MILP建模技巧、双层优化求解机制及YALMIP工具包的应用,同时可尝试引入不确定性因素或动态恢复策略以提升模型的实用性与前沿性。
源码链接: https://pan.quark.cn/s/a4b39357ea24 ### 从网络页面中获取视频文件链接 #### 一、前言 随着互联网技术的不断进步,越来越多的用户倾向于在网络上进行视频内容的观看。然而,对于部分用户而言,将视频资源保存至本地以便离线观看的需求日益凸显。本文将系统阐述通过特定平台和技术手段完成网页视频资源的在线获取及下载过程。 #### 二、获取网页视频资源链接的途径 ##### 2.1 借助专业平台提取视频资源链接 一种便捷的操作方式是利用专门的在线平台来获取网页中的视频资源链接。例如,可以借助`http://www.flvcd.com`这类平台来高效提取视频资源地址。具体操作流程如下: 1. **复制网页标识符**:定位至期望下载的视频页面,复制该页面的网络地址。 2. **进入提取平台**:在浏览器中访问`http://www.flvcd.com`网站。 3. **粘贴并分析**:将复制的网络地址粘贴到网站提供的视频解析框内,点击“开始GO”按钮。该平台会针对输入的链接进行解析,并尝试提取视频文件的实际下载路径。 4. **获取下载路径**:解析完成后,系统会展示一个或多个可用的下载链接,用户可通过这些链接利用下载工具(如迅雷)将视频文件保存至本地。 此类在线提取方法的最大优势在于无需安装任何客户端软件或插件,操作流程简明扼要,特别适合应急使用或无法安装软件的场景。 ##### 2.2 使用专用软件提取并保存视频资源 对于经常需要下载视频的用户群体,采用专业软件可能是更为高效的选择。其中,“硕鼠”是一款备受推崇的视频获取工具。具体操作步骤如下: 1. **获取并部署软件**:前往官方网站`http://download...
内容概要:本文围绕《【EI复现】梯级水光互补系统最大化可消纳电量期望短期优化调度模型(Matlab代码实现)》这一技术资源展开,详细介绍了一个针对水电与光伏发电协同运行的短期优化调度模型。该模型以提升可再生能源的可消纳电量期望为核心目标,重点应对光伏出力不确定性带来的调度挑战。研究采用Matlab作为实现平台,通过构建数学优化模型(如MILP),结合场景生成与缩减技术(如拉丁超立方抽样)处理光伏出力的随机性,实现了对梯级水电站与光伏电站的联合优化调度。模型综合考虑了水资源约束、电力系统潮流、设备运行特性等多种因素,旨在通过科学的调度决策,提高清洁能源的整体利用率和系统运行的经济性与稳定性。; 适合人群:具备一定电力系统、可再生能源或优化理论背景,从事相关科研工作的研究生、科研人员及工程技术人员。; 使用场景及目标:①复现高水平期刊(EI)论文中的优化调度模型;②研究梯级水电与光伏发电的协同调度策略;③掌握基于Matlab的能源系统优化建模与求解方法;④提升在新能源消纳、电力系统调度等领域的科研与实践能力。; 阅读建议:建议读者结合提供的Matlab代码,深入理解模型的数学推导与算法实现细节,重点关注目标函数构建、约束条件设定及不确定性处理方法,并尝试在不同场景下进行仿真验证与结果分析。
内容概要:本报告围绕手机端CRM企业版的开发需求进行全面分析,涵盖用户角色权限设计、多渠道沟通数据接入、AI智能化能力集成、系统架构设计、隐私合规安全策略、UI/UX优化、系统集成同步、关键指标监控及部署运维方案。系统需支持销售员、高管、老板三类核心角色,实现差异化功能权限与界面展示,并聚合微信、QQ、邮件、电话录音、短信等多渠道客户沟通数据,构建统一客户画像。通过集成AI模型实现客户意向识别、情感分析、成交概率预测与智能提醒,提升销售决策效率。系统采用微服务架构,结合Kafka/RabbitMQ消息队列,支持实时推送与离线批处理,确保高性能与可扩展性。同时,严格遵循《个人信息保护法》要求,实施数据加密、脱敏、访问控制与审计日志等安全措施,保障数据合规。报告还提出了快速MVP、标准版与企业级三种实施路径,分别对应不同的开发周期、人月投入与预算范围,助力企业分阶段落地CRM系统。; 适合人群:产品经理、技术负责人及企业数字化转型决策者,尤其适用于计划开发或升级移动CRM系统的企业团队。; 使用场景及目标:①构建支持多角色、多终端的企业级CRM系统;②实现跨渠道客户数据聚合与统一管理;③集成AI能力以提升销售转化与客户洞察;④确保系统符合国内数据安全与隐私合规要求;⑤制定合理的技术选型与分阶段实施路线。; 阅读建议:此资源作为企业级CRM产品的需求规格说明书,内容详实且具备高度可操作性,建议结合自身业务场景,从中提取适配的角色权限模型、技术架构方案与合规控制点,并在开发过程中分阶段验证MVP功能,持续迭代优化。
内容概要:本文围绕基于粒子群算法(PSO)的电动汽车充电动态优化策略展开研究,并提供了完整的Matlab代码实现。通过构建综合考虑电网负荷平衡、充电成本、用户需求响应及可再生能源波动等多重因素的数学模型,利用粒子群算法对电动汽车充电行为进行动态优化调度,旨在实现降低充电成本、平抑电网负荷峰谷差、提高能源利用效率的目标。文章详细阐述了优化模型的设计思路、粒子群算法的核心机制及其在充电调度问题中的具体求解流程,并通过仿真实验验证了所提策略在优化效果和收敛性能方面的有效性与优越性,为智能电网环境下电动汽车有序充电管理提供了理论支持和技术路径。; 适合人群:具备一定电力系统基础知识、智能优化算法理论背景或Matlab编程能力的研究生、科研人员及电力系统相关领域的工程技术人员。; 使用场景及目标:①应用于智能电网中大规模电动汽车接入场景下的有序充电管理;②为提升可再生能源消纳能力与电力系统调度灵活性提供优化解决方案;③作为粒子群算法在能源系统调度领域应用的教学案例,服务于科研复现与算法教学实践。; 阅读建议:建议读者结合所提供的Matlab代码进行动手实践,深入理解算法实现细节与模型构建逻辑,同时可根据实际研究需求调整优化目标函数与约束条件,以适应不同的应用场景与研究方向。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值