Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • Visual Paradigm
  • IBM
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Windows
      • Office
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • Visual Paradigm
  • IBM
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Windows
      • Office
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Archive for: February 2025

Month: February 2025

How can I reach the desired rotor speed of a three phase PMSM motor using a PI-Controller?
Matlab News

How can I reach the desired rotor speed of a three phase PMSM motor using a PI-Controller?

PuTI / 2025-02-01

For study purposes I modelled the Speed controlling of a DC-Motor on Matlab-Simscape using a controlled voltage source, a saturation for the Amplitude of the voltage input and a PI-Controller to control the Motor to rotate with the (desired) controlled rotor speed. This worked properly. (dont mind the blue outliers of the blue signal in the second picture (probably due to the I-Parameter of the PI-Controller).
See the DC-Motor speed (w) controlling and also the signal of both the desired one and actual one:

Now I got a task to do, which is to convert the DC-Motor into a three phase PMSM Motor under the same circumstances, which means I have to get the same rotor speed as the desired one and the same inertia of the motor as an output like the DC-Motor.Here is what I did:
I used the same PI-Controller but a mux as an output of three saturations and used a three phase controlled voltage soure for the motor.
Now both the desired rotor speed and the actual one look nearly also the same (except the outliers propably due to the P-Parameter).
What I dont understand ist that in the display I get the see weird rotor speed values with (e-5 to e-15) which nearly equals 0:

As if I am not 100% if I constructed the PMSM Model without mistaked, especially since the 3 currents of the three phases are not in a sinusoidal or repetitional nor with a shifted shape.. See the current signals..

I am looking for any suggestions how to build this or where might be the errors.
here are the settings of both motors from both models:
PMSM:

DC-Motor:

I used the same PI-Controller settings and also the same saturation and also Pulse Generator values… (for the PMSM I used 3 saturations since the three phase voltage source has 3 voltage inputs). Not sure If this is wrong and there is a correct way to do this..

Any help would be much appreciated! Thanks a lot in advance!For study purposes I modelled the Speed controlling of a DC-Motor on Matlab-Simscape using a controlled voltage source, a saturation for the Amplitude of the voltage input and a PI-Controller to control the Motor to rotate with the (desired) controlled rotor speed. This worked properly. (dont mind the blue outliers of the blue signal in the second picture (probably due to the I-Parameter of the PI-Controller).
See the DC-Motor speed (w) controlling and also the signal of both the desired one and actual one:

Now I got a task to do, which is to convert the DC-Motor into a three phase PMSM Motor under the same circumstances, which means I have to get the same rotor speed as the desired one and the same inertia of the motor as an output like the DC-Motor.Here is what I did:
I used the same PI-Controller but a mux as an output of three saturations and used a three phase controlled voltage soure for the motor.
Now both the desired rotor speed and the actual one look nearly also the same (except the outliers propably due to the P-Parameter).
What I dont understand ist that in the display I get the see weird rotor speed values with (e-5 to e-15) which nearly equals 0:

As if I am not 100% if I constructed the PMSM Model without mistaked, especially since the 3 currents of the three phases are not in a sinusoidal or repetitional nor with a shifted shape.. See the current signals..

I am looking for any suggestions how to build this or where might be the errors.
here are the settings of both motors from both models:
PMSM:

DC-Motor:

I used the same PI-Controller settings and also the same saturation and also Pulse Generator values… (for the PMSM I used 3 saturations since the three phase voltage source has 3 voltage inputs). Not sure If this is wrong and there is a correct way to do this..

Any help would be much appreciated! Thanks a lot in advance! For study purposes I modelled the Speed controlling of a DC-Motor on Matlab-Simscape using a controlled voltage source, a saturation for the Amplitude of the voltage input and a PI-Controller to control the Motor to rotate with the (desired) controlled rotor speed. This worked properly. (dont mind the blue outliers of the blue signal in the second picture (probably due to the I-Parameter of the PI-Controller).
See the DC-Motor speed (w) controlling and also the signal of both the desired one and actual one:

Now I got a task to do, which is to convert the DC-Motor into a three phase PMSM Motor under the same circumstances, which means I have to get the same rotor speed as the desired one and the same inertia of the motor as an output like the DC-Motor.Here is what I did:
I used the same PI-Controller but a mux as an output of three saturations and used a three phase controlled voltage soure for the motor.
Now both the desired rotor speed and the actual one look nearly also the same (except the outliers propably due to the P-Parameter).
What I dont understand ist that in the display I get the see weird rotor speed values with (e-5 to e-15) which nearly equals 0:

As if I am not 100% if I constructed the PMSM Model without mistaked, especially since the 3 currents of the three phases are not in a sinusoidal or repetitional nor with a shifted shape.. See the current signals..

I am looking for any suggestions how to build this or where might be the errors.
here are the settings of both motors from both models:
PMSM:

DC-Motor:

I used the same PI-Controller settings and also the same saturation and also Pulse Generator values… (for the PMSM I used 3 saturations since the three phase voltage source has 3 voltage inputs). Not sure If this is wrong and there is a correct way to do this..

Any help would be much appreciated! Thanks a lot in advance! electric_motor_control, matlab compiler, simulink, simulation, simscape, model MATLAB Answers — New Questions

​

4 pin SIC FET Model in MATLAB
Matlab News

4 pin SIC FET Model in MATLAB

PuTI / 2025-02-01

I am running a circuit simulation in MATLAB that has a 4 pin SIC FET. These pins include Drain, Gate and two Source pins.
The library of the part number is available from manufacturer website in .LIB and include subcircuit model of the 4 pin FET component.
I am basically using this link below to generate thae MATLAB model for this part using lookup table generation approach from subcircuit model:
https://www.mathworks.com/help/sps/ref/ee.spice.semiconductorsubcircuit2lookup.html
I am getting an error related to SIMetrix as attachement. Does matlab use SIMetrix engin for this model conversion? How I can fix this error? I have already installed SIMetrix at the mentioned directory in attachement.I am running a circuit simulation in MATLAB that has a 4 pin SIC FET. These pins include Drain, Gate and two Source pins.
The library of the part number is available from manufacturer website in .LIB and include subcircuit model of the 4 pin FET component.
I am basically using this link below to generate thae MATLAB model for this part using lookup table generation approach from subcircuit model:
https://www.mathworks.com/help/sps/ref/ee.spice.semiconductorsubcircuit2lookup.html
I am getting an error related to SIMetrix as attachement. Does matlab use SIMetrix engin for this model conversion? How I can fix this error? I have already installed SIMetrix at the mentioned directory in attachement. I am running a circuit simulation in MATLAB that has a 4 pin SIC FET. These pins include Drain, Gate and two Source pins.
The library of the part number is available from manufacturer website in .LIB and include subcircuit model of the 4 pin FET component.
I am basically using this link below to generate thae MATLAB model for this part using lookup table generation approach from subcircuit model:
https://www.mathworks.com/help/sps/ref/ee.spice.semiconductorsubcircuit2lookup.html
I am getting an error related to SIMetrix as attachement. Does matlab use SIMetrix engin for this model conversion? How I can fix this error? I have already installed SIMetrix at the mentioned directory in attachement. circuit model, spice, sic fet, 4 pin fet MATLAB Answers — New Questions

​

Why ,the quaternion values from sensor fusion toolbox are switched ?
Matlab News

Why ,the quaternion values from sensor fusion toolbox are switched ?

PuTI / 2025-02-01

Hello everyone,
I am using the Sensor Fusion and Tracking Toolbox. I have raw data from accelerometer and gyroscope.. I imported them to matlab and logged them to imufilter in order to estimate the orientation. ( i want to compare the results of matlab with my own algorithm for gettting the orientation)
However, The quaternions estimated from the toolbox have an unexpected behavior.
the i (x-axis) values are switched with the w values (the real part). So for example , the initial quaternions are someting like 0.0023 + 0.99i -0.001k + 0.001j.
and going along the data set .. it seems they are so similar to my orientation output except that the values of i and w components are switched. I wanted to know why ? or what i am doing wrong. Thank you

Update: I have now transformed the quaternions to normal vectors using (compact) and I noticed the following when I compared the results from the toolbox and results from my alogrithm (assuming Q = [w,x,y,z]) :
The scalar w component is at i (x) and has an inversed sign
The x compnent is at w position with the same sign
The y component is at the z position with an inversed sign
The z component is at the y position with the same signHello everyone,
I am using the Sensor Fusion and Tracking Toolbox. I have raw data from accelerometer and gyroscope.. I imported them to matlab and logged them to imufilter in order to estimate the orientation. ( i want to compare the results of matlab with my own algorithm for gettting the orientation)
However, The quaternions estimated from the toolbox have an unexpected behavior.
the i (x-axis) values are switched with the w values (the real part). So for example , the initial quaternions are someting like 0.0023 + 0.99i -0.001k + 0.001j.
and going along the data set .. it seems they are so similar to my orientation output except that the values of i and w components are switched. I wanted to know why ? or what i am doing wrong. Thank you

Update: I have now transformed the quaternions to normal vectors using (compact) and I noticed the following when I compared the results from the toolbox and results from my alogrithm (assuming Q = [w,x,y,z]) :
The scalar w component is at i (x) and has an inversed sign
The x compnent is at w position with the same sign
The y component is at the z position with an inversed sign
The z component is at the y position with the same sign Hello everyone,
I am using the Sensor Fusion and Tracking Toolbox. I have raw data from accelerometer and gyroscope.. I imported them to matlab and logged them to imufilter in order to estimate the orientation. ( i want to compare the results of matlab with my own algorithm for gettting the orientation)
However, The quaternions estimated from the toolbox have an unexpected behavior.
the i (x-axis) values are switched with the w values (the real part). So for example , the initial quaternions are someting like 0.0023 + 0.99i -0.001k + 0.001j.
and going along the data set .. it seems they are so similar to my orientation output except that the values of i and w components are switched. I wanted to know why ? or what i am doing wrong. Thank you

Update: I have now transformed the quaternions to normal vectors using (compact) and I noticed the following when I compared the results from the toolbox and results from my alogrithm (assuming Q = [w,x,y,z]) :
The scalar w component is at i (x) and has an inversed sign
The x compnent is at w position with the same sign
The y component is at the z position with an inversed sign
The z component is at the y position with the same sign imu, sensor fusion, orientation, quaternion MATLAB Answers — New Questions

​

Why does DQ Current control of 3 phase inverter work with Simscape SPS components but not with Simscape Electrical components?
Matlab News

Why does DQ Current control of 3 phase inverter work with Simscape SPS components but not with Simscape Electrical components?

PuTI / 2025-02-01

Hi Community,
I am building a current controller for a three phase inverter in the dq frame. I have two models. Both are attached here.
Model 1 is built with Simscape Specialised Pwer systems library components &
Model 2 has components from Simscape electrical.
Expected Results – Measured Id and Iq should follow the setpoint/references provided for each respectively. As there is PID control involved there will be some overshoot, rise time etc as expected, but eventually steady state values should converge to the reference.
With all the parameters and controller design same (to the best of my knowledge) I see desired results with Model 1 but not with Model 2. Any ideas why this could be happening?
Model 1

Model 1 results

Model 2

Model 2 results

This result not does not follow the setpoint but also becomes unstable. The PID parameters are the same but could there be a need for different tuning? If so why, since the input output ranges should be similar as all the other parameters are the same.

Due credit for Model 1
"Syed Abdul Rahman Kashif (2025). Grid Tied Inverter with Current Controller (https://www.mathworks.com/matlabcentral/fileexchange/130854-grid-tied-inverter-with-current-controller), MATLAB Central File Exchange. Retrieved January 31, 2025."Hi Community,
I am building a current controller for a three phase inverter in the dq frame. I have two models. Both are attached here.
Model 1 is built with Simscape Specialised Pwer systems library components &
Model 2 has components from Simscape electrical.
Expected Results – Measured Id and Iq should follow the setpoint/references provided for each respectively. As there is PID control involved there will be some overshoot, rise time etc as expected, but eventually steady state values should converge to the reference.
With all the parameters and controller design same (to the best of my knowledge) I see desired results with Model 1 but not with Model 2. Any ideas why this could be happening?
Model 1

Model 1 results

Model 2

Model 2 results

This result not does not follow the setpoint but also becomes unstable. The PID parameters are the same but could there be a need for different tuning? If so why, since the input output ranges should be similar as all the other parameters are the same.

Due credit for Model 1
"Syed Abdul Rahman Kashif (2025). Grid Tied Inverter with Current Controller (https://www.mathworks.com/matlabcentral/fileexchange/130854-grid-tied-inverter-with-current-controller), MATLAB Central File Exchange. Retrieved January 31, 2025." Hi Community,
I am building a current controller for a three phase inverter in the dq frame. I have two models. Both are attached here.
Model 1 is built with Simscape Specialised Pwer systems library components &
Model 2 has components from Simscape electrical.
Expected Results – Measured Id and Iq should follow the setpoint/references provided for each respectively. As there is PID control involved there will be some overshoot, rise time etc as expected, but eventually steady state values should converge to the reference.
With all the parameters and controller design same (to the best of my knowledge) I see desired results with Model 1 but not with Model 2. Any ideas why this could be happening?
Model 1

Model 1 results

Model 2

Model 2 results

This result not does not follow the setpoint but also becomes unstable. The PID parameters are the same but could there be a need for different tuning? If so why, since the input output ranges should be similar as all the other parameters are the same.

Due credit for Model 1
"Syed Abdul Rahman Kashif (2025). Grid Tied Inverter with Current Controller (https://www.mathworks.com/matlabcentral/fileexchange/130854-grid-tied-inverter-with-current-controller), MATLAB Central File Exchange. Retrieved January 31, 2025." dq control, current control, pq control, three phase inverter, mmc, simscape sps, simscape electrical MATLAB Answers — New Questions

​

Battery from library does not connect!
Matlab News

Battery from library does not connect!

PuTI / 2025-02-01

I have been trying to introduce a simple battery in my Simulink model. The 2 batteries included in the Matlab library cannot connect on any node. These batteries are the "elec_lib/Sources/Battery" and "elec_lib/Sources/Battery(Table-Based)". The help button for these blocks does not work either. Can anyone help?I have been trying to introduce a simple battery in my Simulink model. The 2 batteries included in the Matlab library cannot connect on any node. These batteries are the "elec_lib/Sources/Battery" and "elec_lib/Sources/Battery(Table-Based)". The help button for these blocks does not work either. Can anyone help? I have been trying to introduce a simple battery in my Simulink model. The 2 batteries included in the Matlab library cannot connect on any node. These batteries are the "elec_lib/Sources/Battery" and "elec_lib/Sources/Battery(Table-Based)". The help button for these blocks does not work either. Can anyone help? battery, simulink, power_electronics_control, battery_system_management MATLAB Answers — New Questions

​

How is the three-phase transformer with three windings modelled?
Matlab News

How is the three-phase transformer with three windings modelled?

PuTI / 2025-02-01

No equations for the modelling of the transformer with three windings are provided in the documentation. This would be however very helpful for an exact current control design of a grid converter. Is there any documentation available?No equations for the modelling of the transformer with three windings are provided in the documentation. This would be however very helpful for an exact current control design of a grid converter. Is there any documentation available? No equations for the modelling of the transformer with three windings are provided in the documentation. This would be however very helpful for an exact current control design of a grid converter. Is there any documentation available? transformer three windings MATLAB Answers — New Questions

​

Load flow app showing error
Matlab News

Load flow app showing error

PuTI / 2025-02-01

Doing load flow analysis in simulink of the following problem. The model runs without any error, but when using load flow app it shows "An error in the model prevented the load flow analysis".
I have attached the simulation file.
Thanks.Doing load flow analysis in simulink of the following problem. The model runs without any error, but when using load flow app it shows "An error in the model prevented the load flow analysis".
I have attached the simulation file.
Thanks. Doing load flow analysis in simulink of the following problem. The model runs without any error, but when using load flow app it shows "An error in the model prevented the load flow analysis".
I have attached the simulation file.
Thanks. load flow MATLAB Answers — New Questions

​

rtwbuildmatsim脚本执行过程报错:Error during script execution: coder.make.internal.getTMF:unable to locate template makefile: matsim_lcc64.tmf
Matlab News

rtwbuildmatsim脚本执行过程报错:Error during script execution: coder.make.internal.getTMF:unable to locate template makefile: matsim_lcc64.tmf

PuTI / 2025-02-01

我正在尝试使用rtwbuildmatsim脚本导出tutorial_matsim_start_spr_dmp_01.mdl的Simulink模型。
I am trying to export a Simulink model of tutorial_matsim_start_spr_dmp_01.mdl using the rtwbuildmatsim script.

之前在Simulink的Simulation菜单下的Model Configuration Parameters中选择的导出的目标文件类型为matsim.tlc。
The export target file type selected in Model Configuration Parameters under the Simulation menu of Simulink is matsim.tlc.

在执行脚本的过程中,发生了报错:unable to locate template makefile: matsim_lcc64.tmf
An error occurred while executing the script: unable to locate template makefile: matsim_lcc64.tmf

我从报错上判断问题就是MATLAB没有找到模板文件matsim_lcc64.tmf。然而我搜索了MATLAB的所有文件均未找到该模板文件。我搜索过该文件的版本包括MATLAB 2021b20219b2015a。我选择的编译器为MinGW 6.3。
I judged from the error that the problem was that MATLAB did not find the template file matsim_lcc64.tmf. However, I searched all the files in MATLAB and could not find the template file. I have searched for versions of this file including MATLAB 2021b20219b2015a. The compiler I chose is MinGW 6.3.
感谢您的帮助!
Thank you for your help!
附:报错全部内容:
Attached: All contents of the error:
### Generating code and artifacts to ‘Model specific’ folder structure ### Generating code into build folder: E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw 警告: Model ‘tutorial_matsim_start_spr_dmp_01’ is using a default value of 0.2 for maximum step size. You can disable this diagnostic by setting Automatic solver parameter selection to ‘none’ ### Invoking Target Language Compiler on tutorial_matsim_start_spr_dmp_01.rtw ### Using System Target File: E:SOFTMATLABR2019brtwcrtwsfcnrtwsfcn.tlc ### Loading TLC function libraries …. ### Initial pass through model to cache user defined code . ### Caching model source code …………………. ### Writing header file tutorial_matsim_start_spr_dmp_01_sf_types.h ### Writing header file tutorial_matsim_start_spr_dmp_01_sf.h ### Writing header file rtwtypes.h . ### Writing header file multiword_types.h ### Writing source file tutorial_matsim_start_spr_dmp_01_sf.c ### Writing header file tutorial_matsim_start_spr_dmp_01_sf_private.h ### Writing header file tutorial_matsim_start_spr_dmp_01_sid.h ### Writing header file tutorial_matsim_start_spr_dmp_01_mid.h ### Writing source file tutorial_matsim_start_spr_dmp_01_sf_data.c ### Writing header file rtGetNaN.h . ### Writing source file rtGetNaN.c ### Writing header file rt_nonfinite.h ### Writing source file rt_nonfinite.c ### Writing header file rt_defines.h ### Writing header file rtGetInf.h ### Writing source file rtGetInf.c . ### TLC code generation complete. ### Using toolchain: MinGW64 | gmake (64-bit Windows) ### Creating ‘E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtwtutorial_matsim_start_spr_dmp_01.mk’ … ### Building ‘tutorial_matsim_start_spr_dmp_01_sf’: "E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk all E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>cd . E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>if "" == "" ("E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk all ) else ("E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk ) "### Successfully generated all binary outputs." E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>exit 0 mex -f E:SOFTMATLABR2019bbinwin64mexoptsmingw64.xml -R2018a -outdir .. ‘CFLAGS=$CFLAGS -Wno-overlength-strings -pedantic -Wno-long-long -Wno-declaration-after-statement -fwrapv’ -DMODEL=tutorial_matsim_start_spr_dmp_01 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DTID01EQ=0 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 COPTIMFLAGS=-O0 -I.. -I..tutorial_matsim_start_spr_dmp_01_sfcn_rtw -IE:SOFTMATLABR2019bexterninclude -IE:SOFTMATLABR2019bsimulinkinclude -IE:SOFTMATLABR2019brtwcsrc tutorial_matsim_start_spr_dmp_01_sf.c rtGetInf.c rtGetNaN.c tutorial_matsim_start_spr_dmp_01_sf_data.c -LE:SOFTMATLABR2019bexternlibwin64mingw64 -lut -lfixedpoint ### Created mex file: ..tutorial_matsim_start_spr_dmp_01_sf.mexw64 ### Simulink cache artifacts for ‘tutorial_matsim_start_spr_dmp_01’ were created in ‘E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01.slxc’. 错误使用 getTMF Unable to locate template makefile: matsim_lcc64.tmf 出错 rtwprivate (line 16) [varargout{1:nargout}] = feval(function_name, varargin{1:end}); 出错 coder.internal.getMexCompilerForModel 出错 coder.internal.getMexCompilerForModel 出错 coder.internal.ModelCompInfo/createModelCompInfoPrivate 出错 coder.internal.ModelCompInfo.createModelCompInfo 出错 slbuild_private 出错 sl (line 15) [varargout{1:nargout}]=feval(varargin{:}); 出错 slbuild (line 98) sl(‘slbuild_private’, mdl, target, varargin{2:end}); 出错 rtwbuild (line 235) slbuild(sys, ‘StandaloneCoderTarget’, … 出错 rtwbuildmatsim (line 70) rtwbuild(p.Results.model); – Show complete stack trace Displaying stack trace: Error using getTMF • In getTMF • In rtwprivate (line 16) • In coder.internal.getMexCompilerForModel • In coder.internal.getMexCompilerForModel • In coder.internal.ModelCompInfo>ModelCompInfo.createModelCompInfoPrivate • In coder.internal.ModelCompInfo>ModelCompInfo.createModelCompInfo • In slbuild_private • In sl (line 15) • In slbuild (line 98) • In rtwbuild (line 235) • In rtwbuildmatsim (line 70)我正在尝试使用rtwbuildmatsim脚本导出tutorial_matsim_start_spr_dmp_01.mdl的Simulink模型。
I am trying to export a Simulink model of tutorial_matsim_start_spr_dmp_01.mdl using the rtwbuildmatsim script.

之前在Simulink的Simulation菜单下的Model Configuration Parameters中选择的导出的目标文件类型为matsim.tlc。
The export target file type selected in Model Configuration Parameters under the Simulation menu of Simulink is matsim.tlc.

在执行脚本的过程中,发生了报错:unable to locate template makefile: matsim_lcc64.tmf
An error occurred while executing the script: unable to locate template makefile: matsim_lcc64.tmf

我从报错上判断问题就是MATLAB没有找到模板文件matsim_lcc64.tmf。然而我搜索了MATLAB的所有文件均未找到该模板文件。我搜索过该文件的版本包括MATLAB 2021b20219b2015a。我选择的编译器为MinGW 6.3。
I judged from the error that the problem was that MATLAB did not find the template file matsim_lcc64.tmf. However, I searched all the files in MATLAB and could not find the template file. I have searched for versions of this file including MATLAB 2021b20219b2015a. The compiler I chose is MinGW 6.3.
感谢您的帮助!
Thank you for your help!
附:报错全部内容:
Attached: All contents of the error:
### Generating code and artifacts to ‘Model specific’ folder structure ### Generating code into build folder: E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw 警告: Model ‘tutorial_matsim_start_spr_dmp_01’ is using a default value of 0.2 for maximum step size. You can disable this diagnostic by setting Automatic solver parameter selection to ‘none’ ### Invoking Target Language Compiler on tutorial_matsim_start_spr_dmp_01.rtw ### Using System Target File: E:SOFTMATLABR2019brtwcrtwsfcnrtwsfcn.tlc ### Loading TLC function libraries …. ### Initial pass through model to cache user defined code . ### Caching model source code …………………. ### Writing header file tutorial_matsim_start_spr_dmp_01_sf_types.h ### Writing header file tutorial_matsim_start_spr_dmp_01_sf.h ### Writing header file rtwtypes.h . ### Writing header file multiword_types.h ### Writing source file tutorial_matsim_start_spr_dmp_01_sf.c ### Writing header file tutorial_matsim_start_spr_dmp_01_sf_private.h ### Writing header file tutorial_matsim_start_spr_dmp_01_sid.h ### Writing header file tutorial_matsim_start_spr_dmp_01_mid.h ### Writing source file tutorial_matsim_start_spr_dmp_01_sf_data.c ### Writing header file rtGetNaN.h . ### Writing source file rtGetNaN.c ### Writing header file rt_nonfinite.h ### Writing source file rt_nonfinite.c ### Writing header file rt_defines.h ### Writing header file rtGetInf.h ### Writing source file rtGetInf.c . ### TLC code generation complete. ### Using toolchain: MinGW64 | gmake (64-bit Windows) ### Creating ‘E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtwtutorial_matsim_start_spr_dmp_01.mk’ … ### Building ‘tutorial_matsim_start_spr_dmp_01_sf’: "E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk all E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>cd . E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>if "" == "" ("E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk all ) else ("E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk ) "### Successfully generated all binary outputs." E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>exit 0 mex -f E:SOFTMATLABR2019bbinwin64mexoptsmingw64.xml -R2018a -outdir .. ‘CFLAGS=$CFLAGS -Wno-overlength-strings -pedantic -Wno-long-long -Wno-declaration-after-statement -fwrapv’ -DMODEL=tutorial_matsim_start_spr_dmp_01 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DTID01EQ=0 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 COPTIMFLAGS=-O0 -I.. -I..tutorial_matsim_start_spr_dmp_01_sfcn_rtw -IE:SOFTMATLABR2019bexterninclude -IE:SOFTMATLABR2019bsimulinkinclude -IE:SOFTMATLABR2019brtwcsrc tutorial_matsim_start_spr_dmp_01_sf.c rtGetInf.c rtGetNaN.c tutorial_matsim_start_spr_dmp_01_sf_data.c -LE:SOFTMATLABR2019bexternlibwin64mingw64 -lut -lfixedpoint ### Created mex file: ..tutorial_matsim_start_spr_dmp_01_sf.mexw64 ### Simulink cache artifacts for ‘tutorial_matsim_start_spr_dmp_01’ were created in ‘E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01.slxc’. 错误使用 getTMF Unable to locate template makefile: matsim_lcc64.tmf 出错 rtwprivate (line 16) [varargout{1:nargout}] = feval(function_name, varargin{1:end}); 出错 coder.internal.getMexCompilerForModel 出错 coder.internal.getMexCompilerForModel 出错 coder.internal.ModelCompInfo/createModelCompInfoPrivate 出错 coder.internal.ModelCompInfo.createModelCompInfo 出错 slbuild_private 出错 sl (line 15) [varargout{1:nargout}]=feval(varargin{:}); 出错 slbuild (line 98) sl(‘slbuild_private’, mdl, target, varargin{2:end}); 出错 rtwbuild (line 235) slbuild(sys, ‘StandaloneCoderTarget’, … 出错 rtwbuildmatsim (line 70) rtwbuild(p.Results.model); – Show complete stack trace Displaying stack trace: Error using getTMF • In getTMF • In rtwprivate (line 16) • In coder.internal.getMexCompilerForModel • In coder.internal.getMexCompilerForModel • In coder.internal.ModelCompInfo>ModelCompInfo.createModelCompInfoPrivate • In coder.internal.ModelCompInfo>ModelCompInfo.createModelCompInfo • In slbuild_private • In sl (line 15) • In slbuild (line 98) • In rtwbuild (line 235) • In rtwbuildmatsim (line 70) 我正在尝试使用rtwbuildmatsim脚本导出tutorial_matsim_start_spr_dmp_01.mdl的Simulink模型。
I am trying to export a Simulink model of tutorial_matsim_start_spr_dmp_01.mdl using the rtwbuildmatsim script.

之前在Simulink的Simulation菜单下的Model Configuration Parameters中选择的导出的目标文件类型为matsim.tlc。
The export target file type selected in Model Configuration Parameters under the Simulation menu of Simulink is matsim.tlc.

在执行脚本的过程中,发生了报错:unable to locate template makefile: matsim_lcc64.tmf
An error occurred while executing the script: unable to locate template makefile: matsim_lcc64.tmf

我从报错上判断问题就是MATLAB没有找到模板文件matsim_lcc64.tmf。然而我搜索了MATLAB的所有文件均未找到该模板文件。我搜索过该文件的版本包括MATLAB 2021b20219b2015a。我选择的编译器为MinGW 6.3。
I judged from the error that the problem was that MATLAB did not find the template file matsim_lcc64.tmf. However, I searched all the files in MATLAB and could not find the template file. I have searched for versions of this file including MATLAB 2021b20219b2015a. The compiler I chose is MinGW 6.3.
感谢您的帮助!
Thank you for your help!
附:报错全部内容:
Attached: All contents of the error:
### Generating code and artifacts to ‘Model specific’ folder structure ### Generating code into build folder: E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw 警告: Model ‘tutorial_matsim_start_spr_dmp_01’ is using a default value of 0.2 for maximum step size. You can disable this diagnostic by setting Automatic solver parameter selection to ‘none’ ### Invoking Target Language Compiler on tutorial_matsim_start_spr_dmp_01.rtw ### Using System Target File: E:SOFTMATLABR2019brtwcrtwsfcnrtwsfcn.tlc ### Loading TLC function libraries …. ### Initial pass through model to cache user defined code . ### Caching model source code …………………. ### Writing header file tutorial_matsim_start_spr_dmp_01_sf_types.h ### Writing header file tutorial_matsim_start_spr_dmp_01_sf.h ### Writing header file rtwtypes.h . ### Writing header file multiword_types.h ### Writing source file tutorial_matsim_start_spr_dmp_01_sf.c ### Writing header file tutorial_matsim_start_spr_dmp_01_sf_private.h ### Writing header file tutorial_matsim_start_spr_dmp_01_sid.h ### Writing header file tutorial_matsim_start_spr_dmp_01_mid.h ### Writing source file tutorial_matsim_start_spr_dmp_01_sf_data.c ### Writing header file rtGetNaN.h . ### Writing source file rtGetNaN.c ### Writing header file rt_nonfinite.h ### Writing source file rt_nonfinite.c ### Writing header file rt_defines.h ### Writing header file rtGetInf.h ### Writing source file rtGetInf.c . ### TLC code generation complete. ### Using toolchain: MinGW64 | gmake (64-bit Windows) ### Creating ‘E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtwtutorial_matsim_start_spr_dmp_01.mk’ … ### Building ‘tutorial_matsim_start_spr_dmp_01_sf’: "E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk all E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>cd . E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>if "" == "" ("E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk all ) else ("E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk ) "### Successfully generated all binary outputs." E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>exit 0 mex -f E:SOFTMATLABR2019bbinwin64mexoptsmingw64.xml -R2018a -outdir .. ‘CFLAGS=$CFLAGS -Wno-overlength-strings -pedantic -Wno-long-long -Wno-declaration-after-statement -fwrapv’ -DMODEL=tutorial_matsim_start_spr_dmp_01 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DTID01EQ=0 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 COPTIMFLAGS=-O0 -I.. -I..tutorial_matsim_start_spr_dmp_01_sfcn_rtw -IE:SOFTMATLABR2019bexterninclude -IE:SOFTMATLABR2019bsimulinkinclude -IE:SOFTMATLABR2019brtwcsrc tutorial_matsim_start_spr_dmp_01_sf.c rtGetInf.c rtGetNaN.c tutorial_matsim_start_spr_dmp_01_sf_data.c -LE:SOFTMATLABR2019bexternlibwin64mingw64 -lut -lfixedpoint ### Created mex file: ..tutorial_matsim_start_spr_dmp_01_sf.mexw64 ### Simulink cache artifacts for ‘tutorial_matsim_start_spr_dmp_01’ were created in ‘E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01.slxc’. 错误使用 getTMF Unable to locate template makefile: matsim_lcc64.tmf 出错 rtwprivate (line 16) [varargout{1:nargout}] = feval(function_name, varargin{1:end}); 出错 coder.internal.getMexCompilerForModel 出错 coder.internal.getMexCompilerForModel 出错 coder.internal.ModelCompInfo/createModelCompInfoPrivate 出错 coder.internal.ModelCompInfo.createModelCompInfo 出错 slbuild_private 出错 sl (line 15) [varargout{1:nargout}]=feval(varargin{:}); 出错 slbuild (line 98) sl(‘slbuild_private’, mdl, target, varargin{2:end}); 出错 rtwbuild (line 235) slbuild(sys, ‘StandaloneCoderTarget’, … 出错 rtwbuildmatsim (line 70) rtwbuild(p.Results.model); – Show complete stack trace Displaying stack trace: Error using getTMF • In getTMF • In rtwprivate (line 16) • In coder.internal.getMexCompilerForModel • In coder.internal.getMexCompilerForModel • In coder.internal.ModelCompInfo>ModelCompInfo.createModelCompInfoPrivate • In coder.internal.ModelCompInfo>ModelCompInfo.createModelCompInfo • In slbuild_private • In sl (line 15) • In slbuild (line 98) • In rtwbuild (line 235) • In rtwbuildmatsim (line 70) error, mex compiler, simulink, toolbox MATLAB Answers — New Questions

​

Ejector (2P)
Matlab News

Ejector (2P)

PuTI / 2025-02-01

How can I design a two phase flow ejector in simulink / simscape because this components does not available in simulink?How can I design a two phase flow ejector in simulink / simscape because this components does not available in simulink? How can I design a two phase flow ejector in simulink / simscape because this components does not available in simulink? 2p ejector MATLAB Answers — New Questions

​

Dependency Analyzer – question re/ path
Matlab News

Dependency Analyzer – question re/ path

PuTI / 2025-02-01

I started using the Dependency Analyzer tool (in 2023b) to find out which Mathworks toolboxes are being invoked in my scripts and apps. I’m a bit confused on the output. So one of my scripts calls the ‘contains’ function. DA tool indicates the Mapping Toolbox is in use because it has a ‘contains’ function. However ‘which contains’ shows this is also in C:Program FilesMATLABR2023btoolboxmatlabstrfuncontains – and this is the right one.
So why is DA saying I’m using the Mapping Toolbox? Doesn’t it follow the Matlab path rules to find the right one (that takes priority)? Such output can be quite confusing and time-consuming. Or am I doing something wrong? Thanks for the guidance.
PVI started using the Dependency Analyzer tool (in 2023b) to find out which Mathworks toolboxes are being invoked in my scripts and apps. I’m a bit confused on the output. So one of my scripts calls the ‘contains’ function. DA tool indicates the Mapping Toolbox is in use because it has a ‘contains’ function. However ‘which contains’ shows this is also in C:Program FilesMATLABR2023btoolboxmatlabstrfuncontains – and this is the right one.
So why is DA saying I’m using the Mapping Toolbox? Doesn’t it follow the Matlab path rules to find the right one (that takes priority)? Such output can be quite confusing and time-consuming. Or am I doing something wrong? Thanks for the guidance.
PV I started using the Dependency Analyzer tool (in 2023b) to find out which Mathworks toolboxes are being invoked in my scripts and apps. I’m a bit confused on the output. So one of my scripts calls the ‘contains’ function. DA tool indicates the Mapping Toolbox is in use because it has a ‘contains’ function. However ‘which contains’ shows this is also in C:Program FilesMATLABR2023btoolboxmatlabstrfuncontains – and this is the right one.
So why is DA saying I’m using the Mapping Toolbox? Doesn’t it follow the Matlab path rules to find the right one (that takes priority)? Such output can be quite confusing and time-consuming. Or am I doing something wrong? Thanks for the guidance.
PV dependency analyzer, path MATLAB Answers — New Questions

​

Making a heat map from three vectors of different lengths
Matlab News

Making a heat map from three vectors of different lengths

PuTI / 2025-02-01

From a set of three vectors (x,y,z), I want to generate a heat map of x,y and z where the color bar would denote z-values.Perhaps this answer was relevant https://www.mathworks.com/matlabcentral/answers/105390-making-a-heat-map-from-three-vectorsBut it was erased from the database. Thanks!From a set of three vectors (x,y,z), I want to generate a heat map of x,y and z where the color bar would denote z-values.Perhaps this answer was relevant https://www.mathworks.com/matlabcentral/answers/105390-making-a-heat-map-from-three-vectorsBut it was erased from the database. Thanks! From a set of three vectors (x,y,z), I want to generate a heat map of x,y and z where the color bar would denote z-values.Perhaps this answer was relevant https://www.mathworks.com/matlabcentral/answers/105390-making-a-heat-map-from-three-vectorsBut it was erased from the database. Thanks! heat map, concatenate MATLAB Answers — New Questions

​

problem to solve incorrrect
Matlab News

problem to solve incorrrect

PuTI / 2025-02-01

%% R-RRR
clear all; clc; close all
% Input data
AB=0.325; %(m)
BC=0.938; %(m)
CD=0.675; %(m)
CE=0.6; %(m)
xD=0.8; %(m)
yD=-0.432; %(m)
phi =pi; %(rad)
xA = 0; yA = 0;
rA = [xA yA 0];
rD = [xD yD 0];
xB = AB*cos(phi); yB = AB*sin(phi); rB = [xB yB 0];
% Position of joint C
%
eqnC1 = ‘(xCsol – xB)^2 + (yCsol – yB)^2 = BC^2 ‘;
% Distance formula: CD=constant
eqnC2 = ‘(xCsol – xD)^2 + (yCsol – yD)^2 = CD^2 ‘;
% Simultaneously solve above equations
solC = solve(eqnC1, eqnC2, ‘xCsol, yCsol’);
% Two solutions for xC – vector form
xCpositions = eval(solC.xCsol);
% Two solutions for yC – vector form
yCpositions = eval(solC.yCsol);
% Separate the solutions in scalar form
% first component of the vector xCpositions
xC1 = xCpositions(1);
% second component of the vector xCpositions
xC2 = xCpositions(2);

yC1 = yCpositions(1);
% second component of the vector yCpositions
yC2 = yCpositions(2);
% Select the correct position for C
% for the given input angle
if xC1 > xD
xC = xC1; yC=yC1;
else
xC = xC2; yC=yC2;
end
rC = [xC yC 0]; % Position vector of C
% Position of joint E
% Distance formula: CE=constant
eqnE1='(xEsol-xC)^2+(yEsol-yC)^2=CE^2′;
% Slope formula:
% E, C, and D are on the same straight line
eqnE2='(yD-yC)/(xD-xC)=(yEsol-yC)/(xEsol-xC)’;
solE = solve(eqnE1, eqnE2, ‘xEsol, yEsol’);
xEpositions = eval(solE.xEsol);
yEpositions = eval(solE.yEsol);
xE1 = xEpositions(1); xE2 = xEpositions(2);
yE1 = yEpositions(1); yE2 = yEpositions(2);
if xE1 < xC
xE = xE1; yE=yE1;
else
xE = xE2; yE=yE2;
end
rE = [xE yE 0]; % Position vector of E
% Angles of the links with the horizontal
phi2 = atan((yB-yC)/(xB-xC));
phi3 = atan((yD-yC)/(xD-xC));
fprintf(‘Results nn’)
fprintf(‘rA = [ %g, %g, %g ] (m)n’, rA)
fprintf(‘rD = [ %g, %g, %g ] (m)n’, rD)
fprintf(‘rB = [ %g, %g, %g ] (m)n’, rB)
fprintf(‘rC = [ %g, %g, %g ] (m)n’, rC)
fprintf(‘rE = [ %g, %g, %g ] (m)n’, rE)
fprintf(‘phi2 = %g (degrees) n’, phi2*180/pi)
fprintf(‘phi3 = %g (degrees) n’, phi3*180/pi)

% Graphic of the mechanism
plot([xA,xB],[yA,yB],’k-o’,’LineWidth’,1.5)
hold on % holds the current plot
plot([xB,xC],[yB,yC],’b-o’,’LineWidth’,1.5)
hold on
plot([xD,xE],[yD,yE],’r-o’,’LineWidth’,1.5)
% adds major grid lines to the current axes
grid on,…
xlabel(‘x (m)’), ylabel(‘y (m)’),…
title(‘positions for phi = 45 (deg)’),…
text(xA,yA,’leftarrow A = ground’,…
‘HorizontalAlignment’,’left’),…
text(xB,yB,’ B’),…
text(xC,yC,’leftarrow C = ground’,…
‘HorizontalAlignment’,’left’),…
text(xD,yD,’leftarrow D = ground’,…
‘HorizontalAlignment’,’left’),…
text(xE,yE,’ E’), axis([-2 3 -2 3])%% R-RRR
clear all; clc; close all
% Input data
AB=0.325; %(m)
BC=0.938; %(m)
CD=0.675; %(m)
CE=0.6; %(m)
xD=0.8; %(m)
yD=-0.432; %(m)
phi =pi; %(rad)
xA = 0; yA = 0;
rA = [xA yA 0];
rD = [xD yD 0];
xB = AB*cos(phi); yB = AB*sin(phi); rB = [xB yB 0];
% Position of joint C
%
eqnC1 = ‘(xCsol – xB)^2 + (yCsol – yB)^2 = BC^2 ‘;
% Distance formula: CD=constant
eqnC2 = ‘(xCsol – xD)^2 + (yCsol – yD)^2 = CD^2 ‘;
% Simultaneously solve above equations
solC = solve(eqnC1, eqnC2, ‘xCsol, yCsol’);
% Two solutions for xC – vector form
xCpositions = eval(solC.xCsol);
% Two solutions for yC – vector form
yCpositions = eval(solC.yCsol);
% Separate the solutions in scalar form
% first component of the vector xCpositions
xC1 = xCpositions(1);
% second component of the vector xCpositions
xC2 = xCpositions(2);

yC1 = yCpositions(1);
% second component of the vector yCpositions
yC2 = yCpositions(2);
% Select the correct position for C
% for the given input angle
if xC1 > xD
xC = xC1; yC=yC1;
else
xC = xC2; yC=yC2;
end
rC = [xC yC 0]; % Position vector of C
% Position of joint E
% Distance formula: CE=constant
eqnE1='(xEsol-xC)^2+(yEsol-yC)^2=CE^2′;
% Slope formula:
% E, C, and D are on the same straight line
eqnE2='(yD-yC)/(xD-xC)=(yEsol-yC)/(xEsol-xC)’;
solE = solve(eqnE1, eqnE2, ‘xEsol, yEsol’);
xEpositions = eval(solE.xEsol);
yEpositions = eval(solE.yEsol);
xE1 = xEpositions(1); xE2 = xEpositions(2);
yE1 = yEpositions(1); yE2 = yEpositions(2);
if xE1 < xC
xE = xE1; yE=yE1;
else
xE = xE2; yE=yE2;
end
rE = [xE yE 0]; % Position vector of E
% Angles of the links with the horizontal
phi2 = atan((yB-yC)/(xB-xC));
phi3 = atan((yD-yC)/(xD-xC));
fprintf(‘Results nn’)
fprintf(‘rA = [ %g, %g, %g ] (m)n’, rA)
fprintf(‘rD = [ %g, %g, %g ] (m)n’, rD)
fprintf(‘rB = [ %g, %g, %g ] (m)n’, rB)
fprintf(‘rC = [ %g, %g, %g ] (m)n’, rC)
fprintf(‘rE = [ %g, %g, %g ] (m)n’, rE)
fprintf(‘phi2 = %g (degrees) n’, phi2*180/pi)
fprintf(‘phi3 = %g (degrees) n’, phi3*180/pi)

% Graphic of the mechanism
plot([xA,xB],[yA,yB],’k-o’,’LineWidth’,1.5)
hold on % holds the current plot
plot([xB,xC],[yB,yC],’b-o’,’LineWidth’,1.5)
hold on
plot([xD,xE],[yD,yE],’r-o’,’LineWidth’,1.5)
% adds major grid lines to the current axes
grid on,…
xlabel(‘x (m)’), ylabel(‘y (m)’),…
title(‘positions for phi = 45 (deg)’),…
text(xA,yA,’leftarrow A = ground’,…
‘HorizontalAlignment’,’left’),…
text(xB,yB,’ B’),…
text(xC,yC,’leftarrow C = ground’,…
‘HorizontalAlignment’,’left’),…
text(xD,yD,’leftarrow D = ground’,…
‘HorizontalAlignment’,’left’),…
text(xE,yE,’ E’), axis([-2 3 -2 3]) %% R-RRR
clear all; clc; close all
% Input data
AB=0.325; %(m)
BC=0.938; %(m)
CD=0.675; %(m)
CE=0.6; %(m)
xD=0.8; %(m)
yD=-0.432; %(m)
phi =pi; %(rad)
xA = 0; yA = 0;
rA = [xA yA 0];
rD = [xD yD 0];
xB = AB*cos(phi); yB = AB*sin(phi); rB = [xB yB 0];
% Position of joint C
%
eqnC1 = ‘(xCsol – xB)^2 + (yCsol – yB)^2 = BC^2 ‘;
% Distance formula: CD=constant
eqnC2 = ‘(xCsol – xD)^2 + (yCsol – yD)^2 = CD^2 ‘;
% Simultaneously solve above equations
solC = solve(eqnC1, eqnC2, ‘xCsol, yCsol’);
% Two solutions for xC – vector form
xCpositions = eval(solC.xCsol);
% Two solutions for yC – vector form
yCpositions = eval(solC.yCsol);
% Separate the solutions in scalar form
% first component of the vector xCpositions
xC1 = xCpositions(1);
% second component of the vector xCpositions
xC2 = xCpositions(2);

yC1 = yCpositions(1);
% second component of the vector yCpositions
yC2 = yCpositions(2);
% Select the correct position for C
% for the given input angle
if xC1 > xD
xC = xC1; yC=yC1;
else
xC = xC2; yC=yC2;
end
rC = [xC yC 0]; % Position vector of C
% Position of joint E
% Distance formula: CE=constant
eqnE1='(xEsol-xC)^2+(yEsol-yC)^2=CE^2′;
% Slope formula:
% E, C, and D are on the same straight line
eqnE2='(yD-yC)/(xD-xC)=(yEsol-yC)/(xEsol-xC)’;
solE = solve(eqnE1, eqnE2, ‘xEsol, yEsol’);
xEpositions = eval(solE.xEsol);
yEpositions = eval(solE.yEsol);
xE1 = xEpositions(1); xE2 = xEpositions(2);
yE1 = yEpositions(1); yE2 = yEpositions(2);
if xE1 < xC
xE = xE1; yE=yE1;
else
xE = xE2; yE=yE2;
end
rE = [xE yE 0]; % Position vector of E
% Angles of the links with the horizontal
phi2 = atan((yB-yC)/(xB-xC));
phi3 = atan((yD-yC)/(xD-xC));
fprintf(‘Results nn’)
fprintf(‘rA = [ %g, %g, %g ] (m)n’, rA)
fprintf(‘rD = [ %g, %g, %g ] (m)n’, rD)
fprintf(‘rB = [ %g, %g, %g ] (m)n’, rB)
fprintf(‘rC = [ %g, %g, %g ] (m)n’, rC)
fprintf(‘rE = [ %g, %g, %g ] (m)n’, rE)
fprintf(‘phi2 = %g (degrees) n’, phi2*180/pi)
fprintf(‘phi3 = %g (degrees) n’, phi3*180/pi)

% Graphic of the mechanism
plot([xA,xB],[yA,yB],’k-o’,’LineWidth’,1.5)
hold on % holds the current plot
plot([xB,xC],[yB,yC],’b-o’,’LineWidth’,1.5)
hold on
plot([xD,xE],[yD,yE],’r-o’,’LineWidth’,1.5)
% adds major grid lines to the current axes
grid on,…
xlabel(‘x (m)’), ylabel(‘y (m)’),…
title(‘positions for phi = 45 (deg)’),…
text(xA,yA,’leftarrow A = ground’,…
‘HorizontalAlignment’,’left’),…
text(xB,yB,’ B’),…
text(xC,yC,’leftarrow C = ground’,…
‘HorizontalAlignment’,’left’),…
text(xD,yD,’leftarrow D = ground’,…
‘HorizontalAlignment’,’left’),…
text(xE,yE,’ E’), axis([-2 3 -2 3]) plot MATLAB Answers — New Questions

​

Singularity error – Simulink
Matlab News

Singularity error – Simulink

PuTI / 2025-02-01

An error occurred while running the simulation and the simulation was terminated
Caused by:
Derivative of state ‘1’ in block ‘XXXXXX/Receiver/pre-amp/CTLE mode 2/Transfer Fcn15’ at time 3.3003349235944607E-9 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)

Please help.An error occurred while running the simulation and the simulation was terminated
Caused by:
Derivative of state ‘1’ in block ‘XXXXXX/Receiver/pre-amp/CTLE mode 2/Transfer Fcn15’ at time 3.3003349235944607E-9 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)

Please help. An error occurred while running the simulation and the simulation was terminated
Caused by:
Derivative of state ‘1’ in block ‘XXXXXX/Receiver/pre-amp/CTLE mode 2/Transfer Fcn15’ at time 3.3003349235944607E-9 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)

Please help. simulink MATLAB Answers — New Questions

​

When DDPG optimizes PID parameters, how do I keep the first 10s of data from the system stabilization phase out of the experienceBuffer?
Matlab News

When DDPG optimizes PID parameters, how do I keep the first 10s of data from the system stabilization phase out of the experienceBuffer?

PuTI / 2025-02-01

Adaptive PID control using simulink’s own Agent. Since the first 20 is a buffer process for the system, the first 20s are not part of the transition process, but are necessary to exist. How to make the Agent block the first 20s of action, state, reward and other information, or how to make the first 20s does not affect the training effect. In fact, if the first 10s are learned by the intelligent body, then the training effect is very poor.Adaptive PID control using simulink’s own Agent. Since the first 20 is a buffer process for the system, the first 20s are not part of the transition process, but are necessary to exist. How to make the Agent block the first 20s of action, state, reward and other information, or how to make the first 20s does not affect the training effect. In fact, if the first 10s are learned by the intelligent body, then the training effect is very poor. Adaptive PID control using simulink’s own Agent. Since the first 20 is a buffer process for the system, the first 20s are not part of the transition process, but are necessary to exist. How to make the Agent block the first 20s of action, state, reward and other information, or how to make the first 20s does not affect the training effect. In fact, if the first 10s are learned by the intelligent body, then the training effect is very poor. reinforcement learning, simulink, agent MATLAB Answers — New Questions

​

Distinguish land from ocean in harbors
Matlab News

Distinguish land from ocean in harbors

PuTI / 2025-02-01

I’m trying to distinguish land from ocean in harbors and have tried using the highest resolution maps from gshhs, but it isn’t detailed enough. Below are is an example showing that it isn’t detailed to the level I want. The one to the left showing th coastline boundaries and the other one showing the geoplot with basemap = ‘streets’

Since the map is able to plot in such detail, shown below, I would imagine that it should be able to distingusih land from ocean, just based on the colors.

Appriciate any help here! Thanks in advance.I’m trying to distinguish land from ocean in harbors and have tried using the highest resolution maps from gshhs, but it isn’t detailed enough. Below are is an example showing that it isn’t detailed to the level I want. The one to the left showing th coastline boundaries and the other one showing the geoplot with basemap = ‘streets’

Since the map is able to plot in such detail, shown below, I would imagine that it should be able to distingusih land from ocean, just based on the colors.

Appriciate any help here! Thanks in advance. I’m trying to distinguish land from ocean in harbors and have tried using the highest resolution maps from gshhs, but it isn’t detailed enough. Below are is an example showing that it isn’t detailed to the level I want. The one to the left showing th coastline boundaries and the other one showing the geoplot with basemap = ‘streets’

Since the map is able to plot in such detail, shown below, I would imagine that it should be able to distingusih land from ocean, just based on the colors.

Appriciate any help here! Thanks in advance. geoplot, plot, colormap, map, marine, figure, gshhg MATLAB Answers — New Questions

​

sinusoidal representation networks or SIRENs
Matlab News

sinusoidal representation networks or SIRENs

PuTI / 2025-02-01

Hi there!
I am wondering if there is the matlab code for sinusoidal representation networks or SIRENs, which are suitable for solving PDEs in the frame of PINNs. The activation function of an SIREN in sin function, this activation layer has not been built in Matlab.

Thanks for any help.Hi there!
I am wondering if there is the matlab code for sinusoidal representation networks or SIRENs, which are suitable for solving PDEs in the frame of PINNs. The activation function of an SIREN in sin function, this activation layer has not been built in Matlab.

Thanks for any help. Hi there!
I am wondering if there is the matlab code for sinusoidal representation networks or SIRENs, which are suitable for solving PDEs in the frame of PINNs. The activation function of an SIREN in sin function, this activation layer has not been built in Matlab.

Thanks for any help. deep learning, pinns, siren MATLAB Answers — New Questions

​

I have an equation. I want to adjust one of the values in the equation until it hits a certain output. How do I run a loop to increment that certain value until it does this?
Matlab News

I have an equation. I want to adjust one of the values in the equation until it hits a certain output. How do I run a loop to increment that certain value until it does this?

PuTI / 2025-02-01

equation: X/Y=P
Increase Y by an increment of 1 until gives an output equal or less than P.
Example:
X=21
Y=4
P=3
equation: 21/4=5.25
GOAL: increment Y unitl it gives an output less than or equal to P.equation: X/Y=P
Increase Y by an increment of 1 until gives an output equal or less than P.
Example:
X=21
Y=4
P=3
equation: 21/4=5.25
GOAL: increment Y unitl it gives an output less than or equal to P. equation: X/Y=P
Increase Y by an increment of 1 until gives an output equal or less than P.
Example:
X=21
Y=4
P=3
equation: 21/4=5.25
GOAL: increment Y unitl it gives an output less than or equal to P. if loop, for loop, if else, if else statement MATLAB Answers — New Questions

​

transformPointsForward does not support PolynomialTransformation2D
Matlab News

transformPointsForward does not support PolynomialTransformation2D

PuTI / 2025-02-01

I would like to know why transformPointsForward does not support PolynomialTransformation2D as a transformation object. It is weird because transformPointsInverse does support PolynomialTransformation2D.
So the workaround is simple, instead of using:
tform = fitgeotform2d(movingPoints,fixedPoints,"polynomial",degree)
[x,y] = transformPointsForward(tform,u,v)
I used:
tform = fitgeotform2d(fixedPoints,movingPoints,"polynomial",degree)
[x,y] = transformPointsInverse(tform,u,v)
But it is still counterintuitive and increases the risk of making mistakes later in the code.
Please let me know if there is something I am overlooking or if this is really a missing functionality of the transformPointsForward function.

This is the error I am getting when using transformPointsForward:
Incorrect number or types of inputs or outputs for function transformPointsForward.I would like to know why transformPointsForward does not support PolynomialTransformation2D as a transformation object. It is weird because transformPointsInverse does support PolynomialTransformation2D.
So the workaround is simple, instead of using:
tform = fitgeotform2d(movingPoints,fixedPoints,"polynomial",degree)
[x,y] = transformPointsForward(tform,u,v)
I used:
tform = fitgeotform2d(fixedPoints,movingPoints,"polynomial",degree)
[x,y] = transformPointsInverse(tform,u,v)
But it is still counterintuitive and increases the risk of making mistakes later in the code.
Please let me know if there is something I am overlooking or if this is really a missing functionality of the transformPointsForward function.

This is the error I am getting when using transformPointsForward:
Incorrect number or types of inputs or outputs for function transformPointsForward. I would like to know why transformPointsForward does not support PolynomialTransformation2D as a transformation object. It is weird because transformPointsInverse does support PolynomialTransformation2D.
So the workaround is simple, instead of using:
tform = fitgeotform2d(movingPoints,fixedPoints,"polynomial",degree)
[x,y] = transformPointsForward(tform,u,v)
I used:
tform = fitgeotform2d(fixedPoints,movingPoints,"polynomial",degree)
[x,y] = transformPointsInverse(tform,u,v)
But it is still counterintuitive and increases the risk of making mistakes later in the code.
Please let me know if there is something I am overlooking or if this is really a missing functionality of the transformPointsForward function.

This is the error I am getting when using transformPointsForward:
Incorrect number or types of inputs or outputs for function transformPointsForward. image processing MATLAB Answers — New Questions

​

vpa, simplify, solve, etc don’t fully simplify symbolic function.
Matlab News

vpa, simplify, solve, etc don’t fully simplify symbolic function.

PuTI / 2025-02-01

I am doing integration using MATLAB’s symbolic toolbox. I have many functions of my independent variable, z. This is my code, with numbers changed and the problem simplified. I have F1 print at the end just so I can see what the function resolves to.
l = 50;
a = 10;
W = 1200;
syms Q(z);
Q(z) = 1200 + 56*z – 2.5*z^2;

R = – int(Q(z), [0 l]) + W;
syms F1(z) F2(z) F3(z);
F1(z) = simplify(- int(Q(z), [0 z]) – R,"IgnoreAnalyticConstraints",true);

F1
Even with simplify and "IgnoreAnalyticConstraints" being set to true, F1 is in the form "73900/3 – (z*(- 5*z^2 + 168*z + 7200))/6" instead of az^3/b + cz^2/d + ez/f + g, the fully simplified method. vpa just puts all fractions in numeric form, and eval doesn’t really do anything. What am I missing, as I know that there should be some method to this simple operation of simplifying a polynomial.I am doing integration using MATLAB’s symbolic toolbox. I have many functions of my independent variable, z. This is my code, with numbers changed and the problem simplified. I have F1 print at the end just so I can see what the function resolves to.
l = 50;
a = 10;
W = 1200;
syms Q(z);
Q(z) = 1200 + 56*z – 2.5*z^2;

R = – int(Q(z), [0 l]) + W;
syms F1(z) F2(z) F3(z);
F1(z) = simplify(- int(Q(z), [0 z]) – R,"IgnoreAnalyticConstraints",true);

F1
Even with simplify and "IgnoreAnalyticConstraints" being set to true, F1 is in the form "73900/3 – (z*(- 5*z^2 + 168*z + 7200))/6" instead of az^3/b + cz^2/d + ez/f + g, the fully simplified method. vpa just puts all fractions in numeric form, and eval doesn’t really do anything. What am I missing, as I know that there should be some method to this simple operation of simplifying a polynomial. I am doing integration using MATLAB’s symbolic toolbox. I have many functions of my independent variable, z. This is my code, with numbers changed and the problem simplified. I have F1 print at the end just so I can see what the function resolves to.
l = 50;
a = 10;
W = 1200;
syms Q(z);
Q(z) = 1200 + 56*z – 2.5*z^2;

R = – int(Q(z), [0 l]) + W;
syms F1(z) F2(z) F3(z);
F1(z) = simplify(- int(Q(z), [0 z]) – R,"IgnoreAnalyticConstraints",true);

F1
Even with simplify and "IgnoreAnalyticConstraints" being set to true, F1 is in the form "73900/3 – (z*(- 5*z^2 + 168*z + 7200))/6" instead of az^3/b + cz^2/d + ez/f + g, the fully simplified method. vpa just puts all fractions in numeric form, and eval doesn’t really do anything. What am I missing, as I know that there should be some method to this simple operation of simplifying a polynomial. symbolic, function MATLAB Answers — New Questions

​

Why do I receive a mask initialization error when I run Simulink file in a newer version of Simulink?
Matlab News

Why do I receive a mask initialization error when I run Simulink file in a newer version of Simulink?

PuTI / 2025-02-01

Hi,
I can run the Simscape model below in Simulink 2015b:
https://www.mathworks.com/matlabcentral/fileexchange/54771-10-machine-new-england-power-system-ieee-benchmark
However, I am trying to generate a compiled version of this code, which requires using a newer version of Simulink. When I try to run the same code in Simulink 2020b, I get the following error:
"Failed to evaluate mask initialization commands.Caused by:Index exceeds the number of array elements (1)."
It happens in generator G1. I can’t debug it (if I copy and paste the code in Matlab, it can’t find one of the functions").

Any ideas on how to fix this error?Hi,
I can run the Simscape model below in Simulink 2015b:
https://www.mathworks.com/matlabcentral/fileexchange/54771-10-machine-new-england-power-system-ieee-benchmark
However, I am trying to generate a compiled version of this code, which requires using a newer version of Simulink. When I try to run the same code in Simulink 2020b, I get the following error:
"Failed to evaluate mask initialization commands.Caused by:Index exceeds the number of array elements (1)."
It happens in generator G1. I can’t debug it (if I copy and paste the code in Matlab, it can’t find one of the functions").

Any ideas on how to fix this error? Hi,
I can run the Simscape model below in Simulink 2015b:
https://www.mathworks.com/matlabcentral/fileexchange/54771-10-machine-new-england-power-system-ieee-benchmark
However, I am trying to generate a compiled version of this code, which requires using a newer version of Simulink. When I try to run the same code in Simulink 2020b, I get the following error:
"Failed to evaluate mask initialization commands.Caused by:Index exceeds the number of array elements (1)."
It happens in generator G1. I can’t debug it (if I copy and paste the code in Matlab, it can’t find one of the functions").

Any ideas on how to fix this error? simscape, mask initialization error, power system simulation MATLAB Answers — New Questions

​

Previous 1 … 14 15 16 17 Next

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss