Hi,
i have a problem with one error, that MATLAB is reporting to me. Error message:
"Warning: In rapid accelerator mode, when the simulation is started from the command line, visualization blocks are not updated. If the simulation is started from the toolstrip, visualization blocks are updated.
I am working on app, that can run simulation and plot response of control system, but I am stuck on this error message.
This is part of my code in AppDesigner:
mdl = 'time_delay_filter';
in = Simulink.SimulationInput(mdl);
in = in.setModelParameter('StopTime','30');
in.ExternalInput = app.externalInput();
k=app.kEditField.Value;
T=app.TEditField.Value;
L=app.LEditField.Value;
s4 = -(3/L)-(1/(2*T))+sqrt((3/(L.^2))+(1/(4*(T.^2))));
Kp = (1/k)*((L.^2)*T*(s4.^3) + L*(3*T+L)*(s4.^2) + L*s4 - 1)*exp(L*s4);
Ti = -2*(((L.^2)*T*(s4.^3) + L*(3*T+L)*(s4.^2) + L*s4-1)/((s4.^3)*L*(L*T*s4 + 2*T + L)));
Td = (-1/2)*(((L.^2)*T*(s4.^2) + L*(4*T+L)*s4 + 2*L + 2*T)/((L.^2)*T*(s4.^3) + L*(3*T+L)*(s4.^2) + L*s4 - 1));
b=min(2/(Ti*abs(s4)),1);
c=min(1/(Ti*(s4^2)*Td),1);
Kd= Kp*Td;
Ki=Kp/Ti;
in = in.setVariable('b',b);
in = in.setVariable('c',c);
in = in.setVariable('s4',s4);
in = in.setVariable('Kp',Kp);
in = in.setVariable('Ki',Ki);
in = in.setVariable('Kd',Kd);
in = in.setVariable('L',L);
in = in.setVariable('k',k);
in = in.setVariable('T',T);
in = simulink.compiler.configureForDeployment(in);
simOut=sim(in);
plot(app.UIAxes,simOut.ScopeData.time,simOut.ScopeData.signals.values);
Can please somebody help me ?
Thank you.

댓글 수: 2

Mario Malic
Mario Malic 2020년 11월 14일
Hello,
It's warning, not an error message, your simulations should work.
I briefly checked what Rapid Accelerator, and I don't think your are able to process simulations in parallel easily. Did you want to do it with Rapid Accelerator (maybe it's on by default)? You might have to do something similar to this.
It's best to ask customer service.
Samuel Synak
Samuel Synak 2020년 11월 14일
Hi, thanks for your answer. Yeah, you are right.. warning.. It quite works.. but the graph of response is not correct. Totaly different. There is something wrong with parameters in blocks. When i simulate it without one block, it works fine.. about these modes.. I dont really know what is this rapid acceleration, but i tried to change it on 'Normal'. But it is still the same.

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

 채택된 답변

Samuel Synak
Samuel Synak 2020년 11월 17일

0 개 추천

So i solved it. There is no need to compile it like this:
in= simulink.compiler.configureForDeployment(in)
and creating some rapid accelerator things.
I just loaded the model into app like this:
load_system('my_model');
% now set your paremeters

댓글 수: 2

巴依塔克 巴合提
巴依塔克 巴合提 2022년 11월 18일
can this work with standalone app?I mean Stand-alone desktop software,I have same problem as yours,and my aim is to have standalone app ,that can run without matlab.
巴依塔克 巴合提
巴依塔克 巴合提 2022년 11월 18일
if you have a solution,please contact me 2241752161@qq.com

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Multicore Processor Targets에 대해 자세히 알아보기

질문:

2020년 11월 14일

댓글:

2022년 11월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by