There are problems when matlab and amesim jointly defend
1 回表示 (過去 30 日間)
古いコメントを表示
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
2024 年 2 月 20 日
朋友你好,请问你解决这个问题了吗?我的也是matlab与amesim联仿进行强化学习方面的研究。我的程序和你有一样的“警告”,是可以跑,但跑起来在amesim中没任何数据产生,很苦恼,我检查了很多地方,怀疑就这三个“警告”的问题。可以的话,希望与你交流一下,可以有偿
回答 (1 件)
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);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Manual Performance Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!