/*
* File: state_space_c.c
*
*
* --- THIS FILE GENERATED BY S-FUNCTION BUILDER: 3.0 ---
*
* This file is an S-function produced by the S-Function
* Builder which only recognizes certain fields. Changes made
* outside these fields will be lost the next time the block is
* used to load, edit, and resave this file. This file will be overwritten
* by the S-function Builder block. If you want to edit this file by hand,
* you must change it only in the area defined as:
*
* %%%-SFUNWIZ_defines_Changes_BEGIN
* #define NAME 'replacement text'
* %%% SFUNWIZ_defines_Changes_END
*
* DO NOT change NAME--Change the 'replacement text' only.
*
* For better compatibility with the Simulink Coder, the
* "wrapper" S-function technique is used. This is discussed
* in the Simulink Coder's Manual in the Chapter titled,
* "Wrapper S-functions".
*
* -------------------------------------------------------------------------
* | See matlabroot/simulink/src/sfuntmpl_doc.c for a more detailed template |
* -------------------------------------------------------------------------
*/
#define S_FUNCTION_LEVEL 2
#define S_FUNCTION_NAME state_space_c
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
/* %%%-SFUNWIZ_defines_Changes_BEGIN --- EDIT HERE TO _END */
#define NUM_INPUTS 1
/* Input Port 0 */
#define IN_PORT_0_NAME u0
#define INPUT_0_WIDTH 35
#define INPUT_DIMS_0_COL 1
#define INPUT_0_DTYPE real_T
#define INPUT_0_COMPLEX COMPLEX_NO
#define IN_0_FRAME_BASED FRAME_NO
#define IN_0_BUS_BASED 0
#define IN_0_BUS_NAME
#define IN_0_DIMS 1-D
#define INPUT_0_FEEDTHROUGH 1
#define IN_0_ISSIGNED 0
#define IN_0_WORDLENGTH 8
#define IN_0_FIXPOINTSCALING 1
#define IN_0_FRACTIONLENGTH 9
#define IN_0_BIAS 0
#define IN_0_SLOPE 0.125
#define NUM_OUTPUTS 1
/* Output Port 0 */
#define OUT_PORT_0_NAME y0
#define OUTPUT_0_WIDTH 7
#define OUTPUT_DIMS_0_COL 1
#define OUTPUT_0_DTYPE real_T
#define OUTPUT_0_COMPLEX COMPLEX_NO
#define OUT_0_FRAME_BASED FRAME_NO
#define OUT_0_BUS_BASED 0
#define OUT_0_BUS_NAME
#define OUT_0_DIMS 1-D
#define OUT_0_ISSIGNED 1
#define OUT_0_WORDLENGTH 8
#define OUT_0_FIXPOINTSCALING 1
#define OUT_0_FRACTIONLENGTH 3
#define OUT_0_BIAS 0
#define OUT_0_SLOPE 0.125
#define NPARAMS 0
#define SAMPLE_TIME_0 0
#define NUM_DISC_STATES 0
#define DISC_STATES_IC [0]
#define NUM_CONT_STATES 6
#define CONT_STATES_IC [2.228,0,0,0,0,0]
#define SFUNWIZ_GENERATE_TLC 1
#define SOURCEFILES "__SFB____SFB__"
#define PANELINDEX 0
#define USE_SIMSTRUCT 0
#define SHOW_COMPILE_STEPS 0
#define CREATE_DEBUG_MEXFILE 0
#define SAVE_CODE_ONLY 0
#define SFUNWIZ_REVISION 3.0
/* %%%-SFUNWIZ_defines_Changes_END --- EDIT HERE TO _BEGIN */
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
#include "simstruc.h"
extern void state_space_c_Outputs_wrapper(const real_T *u0,
real_T *y0,
const real_T *xC);
extern void state_space_c_Derivatives_wrapper(const real_T *u0,
real_T *y0,
real_T *dx,
real_T *xC);
/*====================*
* S-function methods *
*====================*/
/* Function: mdlInitializeSizes ===============================================
* Abstract:
* Setup sizes of the various vectors.
*/
static void mdlInitializeSizes(SimStruct *S)
{
DECL_AND_INIT_DIMSINFO(inputDimsInfo);
DECL_AND_INIT_DIMSINFO(outputDimsInfo);
ssSetNumSFcnParams(S, NPARAMS);
if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {
return; /* Parameter mismatch will be reported by Simulink */
}
ssSetNumContStates(S, NUM_CONT_STATES);
ssSetNumDiscStates(S, NUM_DISC_STATES);
if (!ssSetNumInputPorts(S, NUM_INPUTS)) return;
ssSetInputPortWidth(S, 0, INPUT_0_WIDTH);
ssSetInputPortDataType(S, 0, SS_DOUBLE);
ssSetInputPortComplexSignal(S, 0, INPUT_0_COMPLEX);
ssSetInputPortDirectFeedThrough(S, 0, INPUT_0_FEEDTHROUGH);
ssSetInputPortRequiredContiguous(S, 0, 1); /*direct input signal access*/
if (!ssSetNumOutputPorts(S, NUM_OUTPUTS)) return;
ssSetOutputPortWidth(S, 0, OUTPUT_0_WIDTH);
ssSetOutputPortDataType(S, 0, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 0, OUTPUT_0_COMPLEX);
ssSetNumSampleTimes(S, 1);
ssSetNumRWork(S, 0);
ssSetNumIWork(S, 0);
ssSetNumPWork(S, 0);
ssSetNumModes(S, 0);
ssSetNumNonsampledZCs(S, 0);
ssSetSimulinkVersionGeneratedIn(S, "8.9");
/* Take care when specifying exception free code - see sfuntmpl_doc.c */
ssSetOptions(S, (SS_OPTION_EXCEPTION_FREE_CODE |
SS_OPTION_USE_TLC_WITH_ACCELERATOR |
SS_OPTION_WORKS_WITH_CODE_REUSE));
}
#if defined(MATLAB_MEX_FILE)
#define MDL_SET_INPUT_PORT_DIMENSION_INFO
static void mdlSetInputPortDimensionInfo(SimStruct *S,
int_T port,
const DimsInfo_T *dimsInfo)
{
if(!ssSetInputPortDimensionInfo(S, port, dimsInfo)) return;
}
#endif
#define MDL_SET_OUTPUT_PORT_DIMENSION_INFO
#if defined(MDL_SET_OUTPUT_PORT_DIMENSION_INFO)
static void mdlSetOutputPortDimensionInfo(SimStruct *S,
int_T port,
const DimsInfo_T *dimsInfo)
{
if (!ssSetOutputPortDimensionInfo(S, port, dimsInfo)) return;
}
#endif
#define MDL_SET_INPUT_PORT_FRAME_DATA
static void mdlSetInputPortFrameData(SimStruct *S,
int_T port,
Frame_T frameData)
{
ssSetInputPortFrameData(S, port, frameData);
}
/* Function: mdlInitializeSampleTimes =========================================
* Abstract:
* Specifiy the sample time.
*/
static void mdlInitializeSampleTimes(SimStruct *S)
{
ssSetSampleTime(S, 0, SAMPLE_TIME_0);
ssSetModelReferenceSampleTimeDefaultInheritance(S);
ssSetOffsetTime(S, 0, 0.0);
}
#define MDL_INITIALIZE_CONDITIONS
/* Function: mdlInitializeConditions ========================================
* Abstract:
* Initialize the states
*/
static void mdlInitializeConditions(SimStruct *S)
{
real_T *xC = ssGetContStates(S);
xC[0] = 2.228;
xC[1] = 0;
xC[2] = 0;
xC[3] = 0;
xC[4] = 0;
xC[5] = 0;
}
#define MDL_SET_INPUT_PORT_DATA_TYPE
static void mdlSetInputPortDataType(SimStruct *S, int port, DTypeId dType)
{
ssSetInputPortDataType(S, 0, dType);
}
#define MDL_SET_OUTPUT_PORT_DATA_TYPE
static void mdlSetOutputPortDataType(SimStruct *S, int port, DTypeId dType)
{
ssSetOutputPortDataType(S, 0, dType);
}
#define MDL_SET_DEFAULT_PORT_DATA_TYPES
static void mdlSetDefaultPortDataTypes(SimStruct *S)
{
ssSetInputPortDataType(S, 0, SS_DOUBLE);
ssSetOutputPortDataType(S, 0, SS_DOUBLE);
}
/* Function: mdlOutputs =======================================================
*
*/
static void mdlOutputs(SimStruct *S, int_T tid)
{
const real_T *u0 = (const real_T *) ssGetInputPortSignal(S, 0);
real_T *y0 = (real_T *) ssGetOutputPortRealSignal(S, 0);
const real_T *xC = ssGetContStates(S);
state_space_c_Outputs_wrapper(u0, y0, xC);
}
#define MDL_DERIVATIVES /* Change to #undef to remove function */
/* Function: mdlDerivatives =================================================
* Abstract:
* In this function, you compute the S-function block's derivatives.
* The derivatives are placed in the derivative vector, ssGetdX(S).
*/
static void mdlDerivatives(SimStruct *S)
{
const real_T *u0 = (const real_T *) ssGetInputPortSignal(S, 0);
real_T *dx = ssGetdX(S);
real_T *xC = ssGetContStates(S);
real_T *y0 = (real_T *) ssGetOutputPortRealSignal(S, 0);
state
没有合适的资源?快使用搜索试试~ 我知道了~
基于Matlab实现船舶多MPC的蒙特卡罗模拟与鲁棒性分析 (源码+数据).rar
共126个文件
mat:85个
m:13个
l:9个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 70 浏览量
2023-07-21
09:43:24
上传
评论
收藏 3.76MB RAR 举报
温馨提示
1、资源内容:基于Matlab实现船舶多MPC的蒙特卡罗模拟与鲁棒性分析 (源码+数据).rar 2、适用人群:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业或毕业设计中的部分功能,作为“参考资料”使用。 3、解压说明:本资源需要电脑端使用WinRAR、7zip等解压工具进行解压,没有解压工具的自行百度下载即可。 4、免责声明:本资源作为“参考资料”而不是“定制需求”,代码只能作为参考,不能完全复制照搬。不一定能够满足所有人的需求,需要有一定的基础能够看懂代码,能够自行调试代码并解决报错,能够自行添加功能修改代码。由于作者大厂工作较忙,不提供答疑服务,如不存在资源缺失问题概不负责,谢谢理解。
资源推荐
资源详情
资源评论
收起资源包目录
基于Matlab实现船舶多MPC的蒙特卡罗模拟与鲁棒性分析 (源码+数据).rar (126个子文件)
Chapter_7_Section_5.asv 3KB
Chapter_7_Section_4.asv 2KB
Chapter_7_Section_4.asv 2KB
Chapter_7_Section_4.asv 2KB
Chapter_6_Multiple_MPC_Final.slx.autosave 233KB
state_space_c.c 8KB
state_space_c.c 8KB
state_space_c.c 8KB
state_space_c_wrapper.c 5KB
state_space_c_wrapper.c 5KB
state_space_c_wrapper.c 5KB
figure.fig 24KB
figure.fig 24KB
seNtzr56c3aZkjct9Thnlo.l 47KB
s3vLwvo3NnRRYQo6MLdo0bD.l 16KB
s9JdJhqSuO4UXdEKpwxF0OH.l 10KB
spla84okdRKFNhbJbJw4IT.l 9KB
sESpUCKl9jHV64lkhIEcdvB.l 9KB
sdeKKFGqT5Xg97luSVd1MJB.l 8KB
syK81QLEonN3QkYlN3KvLp.l 7KB
sWugIVA4DD0k1xIjVdG8tiH.l 7KB
smCT4bviTMDQS06eVHV1q3E.l 7KB
Chapter_7_Section_6.m 9KB
Chapter_7_Section_5.m 6KB
looking_up_n.m 4KB
looking_up_n.m 4KB
looking_up_n.m 4KB
rtwmakecfg.m 3KB
rtwmakecfg.m 3KB
rtwmakecfg.m 3KB
Chapter_7_Section_4.m 2KB
Chapter_7_Section_2.m 550B
init_mpc_controllers.m 6B
init_mpc_controllers.m 6B
init_mpc_controllers.m 6B
data_model.mat 1.19MB
data_model.mat 1.19MB
data_model.mat 1.19MB
seNtzr56c3aZkjct9Thnlo.mat 66KB
s3vLwvo3NnRRYQo6MLdo0bD.mat 46KB
sdeKKFGqT5Xg97luSVd1MJB.mat 12KB
s9JdJhqSuO4UXdEKpwxF0OH.mat 7KB
spla84okdRKFNhbJbJw4IT.mat 4KB
norm_rand_data.mat 3KB
norm_rand_data.mat 3KB
norm_rand_data.mat 3KB
norm_rand_data.mat 3KB
MPC_Controller_Mode_10.mat 3KB
MPC_Controller_Mode_10.mat 3KB
MPC_Controller_Mode_10.mat 3KB
MPC_Controller_Mode_9.mat 3KB
MPC_Controller_Mode_9.mat 3KB
MPC_Controller_Mode_9.mat 3KB
MPC_Controller_Mode_12.mat 3KB
MPC_Controller_Mode_12.mat 3KB
MPC_Controller_Mode_12.mat 3KB
MPC_Controller_Mode_7.mat 3KB
MPC_Controller_Mode_7.mat 3KB
MPC_Controller_Mode_7.mat 3KB
MPC_Controller_Mode_5.mat 3KB
MPC_Controller_Mode_6.mat 3KB
MPC_Controller_Mode_4.mat 3KB
MPC_Controller_Mode_5.mat 3KB
MPC_Controller_Mode_6.mat 3KB
MPC_Controller_Mode_4.mat 3KB
MPC_Controller_Mode_5.mat 3KB
MPC_Controller_Mode_6.mat 3KB
MPC_Controller_Mode_4.mat 3KB
MPC_Controller_Mode_3.mat 3KB
MPC_Controller_Mode_2.mat 3KB
MPC_Controller_Mode_3.mat 3KB
MPC_Controller_Mode_2.mat 3KB
MPC_Controller_Mode_3.mat 3KB
MPC_Controller_Mode_2.mat 3KB
MPC_Controller_Mode_8.mat 3KB
MPC_Controller_Mode_8.mat 3KB
MPC_Controller_Mode_8.mat 3KB
MPC_Controller_Mode_11.mat 3KB
MPC_Controller_Mode_11.mat 3KB
MPC_Controller_Mode_11.mat 3KB
MPC_Controller_Mode_1.mat 3KB
MPC_Controller_Mode_1.mat 3KB
MPC_Controller_Mode_1.mat 3KB
autoInferAccessInfo.mat 3KB
jitEngineAccessInfo.mat 2KB
emlReportAccessInfo.mat 2KB
sWugIVA4DD0k1xIjVdG8tiH.mat 2KB
syK81QLEonN3QkYlN3KvLp.mat 2KB
smCT4bviTMDQS06eVHV1q3E.mat 2KB
sESpUCKl9jHV64lkhIEcdvB.mat 2KB
binfo.mat 1KB
binfo.mat 1KB
seNtzr56c3aZkjct9Thnlo.mat 698B
spla84okdRKFNhbJbJw4IT.mat 687B
sdeKKFGqT5Xg97luSVd1MJB.mat 686B
syK81QLEonN3QkYlN3KvLp.mat 684B
sWugIVA4DD0k1xIjVdG8tiH.mat 684B
sESpUCKl9jHV64lkhIEcdvB.mat 681B
s3vLwvo3NnRRYQo6MLdo0bD.mat 680B
smCT4bviTMDQS06eVHV1q3E.mat 680B
共 126 条
- 1
- 2
资源评论
Matlab仿真实验室
- 粉丝: 2w+
- 资源: 2180
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- # 微信小程序-健康菜谱 基于微信小程序的一个查找检索菜谱的应用 ### 效果 !动态图(./res/gif/demo
- zabbix-get命令包资源
- 毕业设计,基于PyQt5实现的可视化界面的Python车牌自动识别系统源码
- 26-朴素贝叶斯分类.rar
- 没有安Matlab 也可以 生成FIR抽头系数工具.py
- python烟花代码.rar
- 实验目的: 1.构建基于verilog语言的组合逻辑电路和时序逻辑电路; 2.掌握verilog语言的电路设计技巧 3.完成如
- 扩展卡尔曼滤波matlab仿真
- 3_base.apk.1
- 躺赢者PRO飞控常见典型问题合集(续一)无名小哥 余义 20240501待修
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功