There are problems when matlab and amesim jointly defend

조회 수: 10 (최근 30일)
昱绮
昱绮 2023년 12월 15일
편집: Aiswarya 2024년 2월 21일
Reinforcement learning is a problem that occurs when the s-function of amesim is invoked in the co-simulation of matlab and amesim
警告: Fast Restart mode cannot be enabled for model 'untitled1' for the following reasons:
警告: Fast Restart mode relies on the ability to save the model's operating point. However, the following error occurred when an attempt was made to save the operating point:
警告: Simulink is unable to save the operating point of the C Level-2 S-Function (testnew_) block 'untitled1/testnew2/S-Function' because the S-function has pointer work (PWork) vectors.
  댓글 수: 1
cm s
cm s 2024년 2월 20일
朋友你好,请问你解决这个问题了吗?我的也是matlab与amesim联仿进行强化学习方面的研究。我的程序和你有一样的“警告”,是可以跑,但跑起来在amesim中没任何数据产生,很苦恼,我检查了很多地方,怀疑就这三个“警告”的问题。可以的话,希望与你交流一下,可以有偿

댓글을 달려면 로그인하십시오.

답변 (1개)

Aiswarya
Aiswarya 2023년 12월 19일
편집: Aiswarya 2024년 2월 21일
嗨,我将用英语回答这个问题。
I see that you are trying to save the operating point of a model which involves S-functions. The error you are getting is because of Operating Point Compliance which handles S-function operating point information when saving the model operating point. In the error it shows that your S-function has pointer work (Pwork) vectors. When you use PWorks without explicitly specifying the operating point compliance, the compliance becomes DISALLOW_OPERATING_POINT after compilation. For this setting, the S-function does not allow saving or restoring its operating point and the software issues an error.
This error can be resolved by changing the OperatingPointCompliance in the S-function using ssSetOperatingPointCompliance (https://www.mathworks.com/help/simulink/sfg/sssetoperatingpointcompliance.html?searchHighlight=OperatingPointCompliance&s_tid=srchtitle_support_results_1_OperatingPointCompliance). The appropriate setting for S-functions that use Pwork vectors is 'USE_CUSTOM_OPERATING_POINT'. You can change this setting inside the 'mdlInitializeSizes' function of your S-function as follows:
ssOperatingPointCompliance setting = USE_CUSTOM_OPERATING_POINT;
ssSetOperatingPointCompliance(S, setting);
If you want to access the operating point information for your S-function in the 'Simulink.op.ModelOperatingPoint' object for the model you have to also enable the 'OperatingPointVisibility'.
boolean_T visibility = true;
ssSetOperatingPointVisibility(S, visibility);

카테고리

Help CenterFile Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by