Category: Matlab
Category Archives: Matlab
Link between ansys workbench and matlab
How can i link between ansys workbench and matlab ?How can i link between ansys workbench and matlab ? How can i link between ansys workbench and matlab ? ansys workbench, matlab MATLAB Answers — New Questions
selstruc(): How to avoid hitting “Return” in command window?
I’m building a little App (.mlapp) for System Identification based on this example: https://www.mathworks.com/help/ident/gs/identify-linear-models-using-the-command-line.html
I’m using selstruc(arxstruc(…)) to estimate model parameter but after selection, it’s not sufficient to close with the "Close" button, but I have to switch to main Matlab command window and hit return, as mentioned in the dialog.
Is there any way to avoid this and continue directly after pressing "Close"?I’m building a little App (.mlapp) for System Identification based on this example: https://www.mathworks.com/help/ident/gs/identify-linear-models-using-the-command-line.html
I’m using selstruc(arxstruc(…)) to estimate model parameter but after selection, it’s not sufficient to close with the "Close" button, but I have to switch to main Matlab command window and hit return, as mentioned in the dialog.
Is there any way to avoid this and continue directly after pressing "Close"? I’m building a little App (.mlapp) for System Identification based on this example: https://www.mathworks.com/help/ident/gs/identify-linear-models-using-the-command-line.html
I’m using selstruc(arxstruc(…)) to estimate model parameter but after selection, it’s not sufficient to close with the "Close" button, but I have to switch to main Matlab command window and hit return, as mentioned in the dialog.
Is there any way to avoid this and continue directly after pressing "Close"? system identification, selstruc MATLAB Answers — New Questions
how can I download my licenses
how can I download my licenseshow can I download my licenses how can I download my licenses download licenses MATLAB Answers — New Questions
Error in DNG Server Login Configuration
We are trying to configure DNG Server Login Configuration, but we found error "Domain name not resolved: our-domain.com".
From our investigation, we think that the error occur in function rmiut.InputUtils.validateDomainName().
Below is our suspects.
Fact: our domain name is private domain and it cannot be resolved by DNS.
Fact: current we are using host file to solve this domain name.
We think that function rmiut.InputUtils.validateDomainName() do not use information in host file when it validate the domain name.
This domain use self-signed cert and we don’t have .crt of it too, but we think the error occur at validation step, not load the web yet.
Could you please confirm our suspect and suggest the solution.
Thank you.We are trying to configure DNG Server Login Configuration, but we found error "Domain name not resolved: our-domain.com".
From our investigation, we think that the error occur in function rmiut.InputUtils.validateDomainName().
Below is our suspects.
Fact: our domain name is private domain and it cannot be resolved by DNS.
Fact: current we are using host file to solve this domain name.
We think that function rmiut.InputUtils.validateDomainName() do not use information in host file when it validate the domain name.
This domain use self-signed cert and we don’t have .crt of it too, but we think the error occur at validation step, not load the web yet.
Could you please confirm our suspect and suggest the solution.
Thank you. We are trying to configure DNG Server Login Configuration, but we found error "Domain name not resolved: our-domain.com".
From our investigation, we think that the error occur in function rmiut.InputUtils.validateDomainName().
Below is our suspects.
Fact: our domain name is private domain and it cannot be resolved by DNS.
Fact: current we are using host file to solve this domain name.
We think that function rmiut.InputUtils.validateDomainName() do not use information in host file when it validate the domain name.
This domain use self-signed cert and we don’t have .crt of it too, but we think the error occur at validation step, not load the web yet.
Could you please confirm our suspect and suggest the solution.
Thank you. simulink requirements, slreq.dngconfigure MATLAB Answers — New Questions
How to generate a TLC file for a MEX file externally obtained?
Hello,
I have a Simulink simulation utilizing an S-Function block tied to an externally generated MEX file, which I am trying to make code generation compatible.
I have reviewed these articles about the topic:
Use Level-2 MATLAB S-function: https://www.mathworks.com/help/simulink/slref/level2matlabsfunction.html
TLC Files: https://www.mathworks.com/help/rtw/tlc/tlc-files.html
However, I was wondering how I would generate a TLC file if the MEX was auto-generated by an external modeling software. Do I need access to the source C Code before MEX file generation? Is there a way to manually build it without knowledge of how the MEX is built?
Just looking for information on what information/access I would need.
Thanks!Hello,
I have a Simulink simulation utilizing an S-Function block tied to an externally generated MEX file, which I am trying to make code generation compatible.
I have reviewed these articles about the topic:
Use Level-2 MATLAB S-function: https://www.mathworks.com/help/simulink/slref/level2matlabsfunction.html
TLC Files: https://www.mathworks.com/help/rtw/tlc/tlc-files.html
However, I was wondering how I would generate a TLC file if the MEX was auto-generated by an external modeling software. Do I need access to the source C Code before MEX file generation? Is there a way to manually build it without knowledge of how the MEX is built?
Just looking for information on what information/access I would need.
Thanks! Hello,
I have a Simulink simulation utilizing an S-Function block tied to an externally generated MEX file, which I am trying to make code generation compatible.
I have reviewed these articles about the topic:
Use Level-2 MATLAB S-function: https://www.mathworks.com/help/simulink/slref/level2matlabsfunction.html
TLC Files: https://www.mathworks.com/help/rtw/tlc/tlc-files.html
However, I was wondering how I would generate a TLC file if the MEX was auto-generated by an external modeling software. Do I need access to the source C Code before MEX file generation? Is there a way to manually build it without knowledge of how the MEX is built?
Just looking for information on what information/access I would need.
Thanks! simulink, tlc, matlab, code generation, mex, simulink compiler MATLAB Answers — New Questions
Interpret CNN classification model for EEG signals.
I have a CNN model for EEG signals classification, I built the model, train and test it. I want to interpret the decision-making process of the CNN model , How can I do that ? Should I use on of the attached methodes?I have a CNN model for EEG signals classification, I built the model, train and test it. I want to interpret the decision-making process of the CNN model , How can I do that ? Should I use on of the attached methodes? I have a CNN model for EEG signals classification, I built the model, train and test it. I want to interpret the decision-making process of the CNN model , How can I do that ? Should I use on of the attached methodes? eeg, interpretability, cnn, imagelime MATLAB Answers — New Questions
Array of SimulationInput objects gets modified upon running with sim command
I am creating an array of SimulationInput objects, ‘simIn’. If I try to run a single simulation, for example using simOut(1) = sim(simIn(1)) to run the first case, why does simIn lose all other array elementes. It changes to a 1×1 SimulationInput object, whereas before the sim command it was a 1×28 object
for casenumber = 1:NumFile
if ~isempty(char(file{FileIdx(casenumber),1}))
if exist(strrep(char(file{FileIdx(casenumber),1}), ‘;’, ”), ‘file’)
%% Setup parallel Simulation
simIn(casenumber)=Simulink.SimulationInput(‘XWB_MSL_EEC’);
simIn(casenumber) = simIn(casenumber).setVariable(‘Experiment’,Experiment);
simIn(casenumber) = simIn(casenumber).setVariable(‘Enable_MSL_Validation_Logging’,Enable_MSL_Validation_Logging);
simIn(casenumber) = simIn(casenumber).setVariable(‘SimStartTime’,0);
simIn(casenumber) = simIn(casenumber).setVariable(‘TimeMode1’,TimeMode1);
simIn(casenumber) = simIn(casenumber).setVariable(‘TimeMode2’,TimeMode2);
simIn(casenumber) = simIn(casenumber).setVariable(‘parallel_casenumber’,casenumber);
simIn(casenumber) = simIn(casenumber).setVariable(‘ModelPath’,ModelPath);
simIn(casenumber) = simIn(casenumber).setVariable(‘toolGitStatus’,toolGitStatus);
simIn(casenumber) = simIn(casenumber).setVariable(‘configGitStatus’,configGitStatus);
simIn(casenumber) = simIn(casenumber).setVariable(‘toolConfigVersion’,toolConfigVersion);
simIn(casenumber) = simIn(casenumber).setVariable(‘configGitInfo’,configGitInfo);
simIn(casenumber) = simIn(casenumber).setVariable(‘switchBatchMode’,switchBatchMode);
simIn(casenumber) = simIn(casenumber).setVariable(‘resultsDir’,resultsDir);
simIn(casenumber) = simIn(casenumber).setVariable(‘switchExportDataToPhobos’,switchExportDataToPhobos);
if ~isempty(Suffix)
simIn(casenumber) = simIn(casenumber).setVariable(‘CurveName’,sprintf(‘%s_%s’,file{FileIdx(casenumber),1},Suffix));
else
simIn(casenumber) = simIn(casenumber).setVariable(‘CurveName’,file{FileIdx(casenumber),1});
end
% Use a temporary variable for the SimIn element to avoid runaway memory usage when using a preSimFcn with parsim
tmpSimIn = simIn(casenumber);
preSimFcnInputs = {file{FileIdx(casenumber)}, tmpSimIn};
simIn(casenumber)=simIn(casenumber).setPreSimFcn(@(x) parsimMSLPreSimFcn(preSimFcnInputs));
simIn(casenumber) = simIn(casenumber).setPostSimFcn(@(y) parsimMSLPostSimFcn(y, tmpSimIn));
else
error([‘Could not find Case "’,strrep(char(file{FileIdx(casenumber),1}), ‘;’, ”),’"!’])
end
end
endI am creating an array of SimulationInput objects, ‘simIn’. If I try to run a single simulation, for example using simOut(1) = sim(simIn(1)) to run the first case, why does simIn lose all other array elementes. It changes to a 1×1 SimulationInput object, whereas before the sim command it was a 1×28 object
for casenumber = 1:NumFile
if ~isempty(char(file{FileIdx(casenumber),1}))
if exist(strrep(char(file{FileIdx(casenumber),1}), ‘;’, ”), ‘file’)
%% Setup parallel Simulation
simIn(casenumber)=Simulink.SimulationInput(‘XWB_MSL_EEC’);
simIn(casenumber) = simIn(casenumber).setVariable(‘Experiment’,Experiment);
simIn(casenumber) = simIn(casenumber).setVariable(‘Enable_MSL_Validation_Logging’,Enable_MSL_Validation_Logging);
simIn(casenumber) = simIn(casenumber).setVariable(‘SimStartTime’,0);
simIn(casenumber) = simIn(casenumber).setVariable(‘TimeMode1’,TimeMode1);
simIn(casenumber) = simIn(casenumber).setVariable(‘TimeMode2’,TimeMode2);
simIn(casenumber) = simIn(casenumber).setVariable(‘parallel_casenumber’,casenumber);
simIn(casenumber) = simIn(casenumber).setVariable(‘ModelPath’,ModelPath);
simIn(casenumber) = simIn(casenumber).setVariable(‘toolGitStatus’,toolGitStatus);
simIn(casenumber) = simIn(casenumber).setVariable(‘configGitStatus’,configGitStatus);
simIn(casenumber) = simIn(casenumber).setVariable(‘toolConfigVersion’,toolConfigVersion);
simIn(casenumber) = simIn(casenumber).setVariable(‘configGitInfo’,configGitInfo);
simIn(casenumber) = simIn(casenumber).setVariable(‘switchBatchMode’,switchBatchMode);
simIn(casenumber) = simIn(casenumber).setVariable(‘resultsDir’,resultsDir);
simIn(casenumber) = simIn(casenumber).setVariable(‘switchExportDataToPhobos’,switchExportDataToPhobos);
if ~isempty(Suffix)
simIn(casenumber) = simIn(casenumber).setVariable(‘CurveName’,sprintf(‘%s_%s’,file{FileIdx(casenumber),1},Suffix));
else
simIn(casenumber) = simIn(casenumber).setVariable(‘CurveName’,file{FileIdx(casenumber),1});
end
% Use a temporary variable for the SimIn element to avoid runaway memory usage when using a preSimFcn with parsim
tmpSimIn = simIn(casenumber);
preSimFcnInputs = {file{FileIdx(casenumber)}, tmpSimIn};
simIn(casenumber)=simIn(casenumber).setPreSimFcn(@(x) parsimMSLPreSimFcn(preSimFcnInputs));
simIn(casenumber) = simIn(casenumber).setPostSimFcn(@(y) parsimMSLPostSimFcn(y, tmpSimIn));
else
error([‘Could not find Case "’,strrep(char(file{FileIdx(casenumber),1}), ‘;’, ”),’"!’])
end
end
end I am creating an array of SimulationInput objects, ‘simIn’. If I try to run a single simulation, for example using simOut(1) = sim(simIn(1)) to run the first case, why does simIn lose all other array elementes. It changes to a 1×1 SimulationInput object, whereas before the sim command it was a 1×28 object
for casenumber = 1:NumFile
if ~isempty(char(file{FileIdx(casenumber),1}))
if exist(strrep(char(file{FileIdx(casenumber),1}), ‘;’, ”), ‘file’)
%% Setup parallel Simulation
simIn(casenumber)=Simulink.SimulationInput(‘XWB_MSL_EEC’);
simIn(casenumber) = simIn(casenumber).setVariable(‘Experiment’,Experiment);
simIn(casenumber) = simIn(casenumber).setVariable(‘Enable_MSL_Validation_Logging’,Enable_MSL_Validation_Logging);
simIn(casenumber) = simIn(casenumber).setVariable(‘SimStartTime’,0);
simIn(casenumber) = simIn(casenumber).setVariable(‘TimeMode1’,TimeMode1);
simIn(casenumber) = simIn(casenumber).setVariable(‘TimeMode2’,TimeMode2);
simIn(casenumber) = simIn(casenumber).setVariable(‘parallel_casenumber’,casenumber);
simIn(casenumber) = simIn(casenumber).setVariable(‘ModelPath’,ModelPath);
simIn(casenumber) = simIn(casenumber).setVariable(‘toolGitStatus’,toolGitStatus);
simIn(casenumber) = simIn(casenumber).setVariable(‘configGitStatus’,configGitStatus);
simIn(casenumber) = simIn(casenumber).setVariable(‘toolConfigVersion’,toolConfigVersion);
simIn(casenumber) = simIn(casenumber).setVariable(‘configGitInfo’,configGitInfo);
simIn(casenumber) = simIn(casenumber).setVariable(‘switchBatchMode’,switchBatchMode);
simIn(casenumber) = simIn(casenumber).setVariable(‘resultsDir’,resultsDir);
simIn(casenumber) = simIn(casenumber).setVariable(‘switchExportDataToPhobos’,switchExportDataToPhobos);
if ~isempty(Suffix)
simIn(casenumber) = simIn(casenumber).setVariable(‘CurveName’,sprintf(‘%s_%s’,file{FileIdx(casenumber),1},Suffix));
else
simIn(casenumber) = simIn(casenumber).setVariable(‘CurveName’,file{FileIdx(casenumber),1});
end
% Use a temporary variable for the SimIn element to avoid runaway memory usage when using a preSimFcn with parsim
tmpSimIn = simIn(casenumber);
preSimFcnInputs = {file{FileIdx(casenumber)}, tmpSimIn};
simIn(casenumber)=simIn(casenumber).setPreSimFcn(@(x) parsimMSLPreSimFcn(preSimFcnInputs));
simIn(casenumber) = simIn(casenumber).setPostSimFcn(@(y) parsimMSLPostSimFcn(y, tmpSimIn));
else
error([‘Could not find Case "’,strrep(char(file{FileIdx(casenumber),1}), ‘;’, ”),’"!’])
end
end
end simulink MATLAB Answers — New Questions
Project export error while generating code using Simulink Coder Twincat target
I am experimenting creating a Simulink model for TwinCAT 3 but when generating the Simulink code it keeps showing the following error:
The call to TwinCatGrt_make_rtw_hook, during the after_make hook generated the following error: Project export failed The build process will terminate as a result.
Caused by:
Project export failed
I looked on the internet and seems there are only guides for fixing preparing projects but none for fixing project export. Does anyone know how to fix this error?I am experimenting creating a Simulink model for TwinCAT 3 but when generating the Simulink code it keeps showing the following error:
The call to TwinCatGrt_make_rtw_hook, during the after_make hook generated the following error: Project export failed The build process will terminate as a result.
Caused by:
Project export failed
I looked on the internet and seems there are only guides for fixing preparing projects but none for fixing project export. Does anyone know how to fix this error? I am experimenting creating a Simulink model for TwinCAT 3 but when generating the Simulink code it keeps showing the following error:
The call to TwinCatGrt_make_rtw_hook, during the after_make hook generated the following error: Project export failed The build process will terminate as a result.
Caused by:
Project export failed
I looked on the internet and seems there are only guides for fixing preparing projects but none for fixing project export. Does anyone know how to fix this error? simulink, twincat3, tccom MATLAB Answers — New Questions
How to extract 50Hz fundamental frequency components or DC components with less delay in Simulink?
I want to extract the 50Hz fundamental frequency component or DC component of the voltage at the shunt point in a double closed loop control of an inverter. As far as I know, a low pass filter or a notch filter can be used. But the lower the cutoff frequency, the greater the signal delay between input and output. Is there a good way to solve the delay problem?I want to extract the 50Hz fundamental frequency component or DC component of the voltage at the shunt point in a double closed loop control of an inverter. As far as I know, a low pass filter or a notch filter can be used. But the lower the cutoff frequency, the greater the signal delay between input and output. Is there a good way to solve the delay problem? I want to extract the 50Hz fundamental frequency component or DC component of the voltage at the shunt point in a double closed loop control of an inverter. As far as I know, a low pass filter or a notch filter can be used. But the lower the cutoff frequency, the greater the signal delay between input and output. Is there a good way to solve the delay problem? closed-loop control, power_electronics_control, signal processing MATLAB Answers — New Questions
Connect USRP-2974 using Wireless Testbench
Hi, MATLAB Community,
I wonder if the NI USRP-2974 is compatatible with Wireless Testbench Toolbox.
Although NI says that USRP-2974 is X310 with an on-board computer, I failed to run WT examples. I noticed that Wireless Testbench supports NI USRP-295x (X310 with specific daughterboards, I tested with another USRP-2952) but it seems 2974 is not supported.
An error message says Unable to find a compatible radio, ‘USRP X310’
Thanks in advanceHi, MATLAB Community,
I wonder if the NI USRP-2974 is compatatible with Wireless Testbench Toolbox.
Although NI says that USRP-2974 is X310 with an on-board computer, I failed to run WT examples. I noticed that Wireless Testbench supports NI USRP-295x (X310 with specific daughterboards, I tested with another USRP-2952) but it seems 2974 is not supported.
An error message says Unable to find a compatible radio, ‘USRP X310’
Thanks in advance Hi, MATLAB Community,
I wonder if the NI USRP-2974 is compatatible with Wireless Testbench Toolbox.
Although NI says that USRP-2974 is X310 with an on-board computer, I failed to run WT examples. I noticed that Wireless Testbench supports NI USRP-295x (X310 with specific daughterboards, I tested with another USRP-2952) but it seems 2974 is not supported.
An error message says Unable to find a compatible radio, ‘USRP X310’
Thanks in advance ni usrp MATLAB Answers — New Questions
Where Can I Download the PID Controller Tuning for a Buck Converter Example?
Hello,
I’m interested in learning how to tune the gains of a PID controller for a buck converter using Simscape Electrical™. I came across a video that demonstrates this process and explains the new frequency response-based PID tuning method introduced in R2017b.
Here is the link to the video: PID Controller Tuning for a Buck Converter
I would like to download the example file or model used in the video. Could anyone provide guidance on where I can find this example? Is it available for download directly from MATLAB Central, or should I look elsewhere?
Thank you for your help!Hello,
I’m interested in learning how to tune the gains of a PID controller for a buck converter using Simscape Electrical™. I came across a video that demonstrates this process and explains the new frequency response-based PID tuning method introduced in R2017b.
Here is the link to the video: PID Controller Tuning for a Buck Converter
I would like to download the example file or model used in the video. Could anyone provide guidance on where I can find this example? Is it available for download directly from MATLAB Central, or should I look elsewhere?
Thank you for your help! Hello,
I’m interested in learning how to tune the gains of a PID controller for a buck converter using Simscape Electrical™. I came across a video that demonstrates this process and explains the new frequency response-based PID tuning method introduced in R2017b.
Here is the link to the video: PID Controller Tuning for a Buck Converter
I would like to download the example file or model used in the video. Could anyone provide guidance on where I can find this example? Is it available for download directly from MATLAB Central, or should I look elsewhere?
Thank you for your help! power_electronics_control MATLAB Answers — New Questions
image processing
ive managed to successfully use variables and measure the perimeter of 2 images i have scanned from my flat bed scanner
refer :
http://www.mathworks.com/matlabcentral/answers/5133-image-processing-calculate-perimeter
however now my question is to combine this as a program in which i can scan the images and compare. image uploading has already been completed in .net . now from the database i need to access these images and calculate their perimeters individually . how do i do this. any other questions do let me know.
a recap : need to write an individual program to read the scanned images into the code and calculate their perimeters respectilvely
thanksive managed to successfully use variables and measure the perimeter of 2 images i have scanned from my flat bed scanner
refer :
http://www.mathworks.com/matlabcentral/answers/5133-image-processing-calculate-perimeter
however now my question is to combine this as a program in which i can scan the images and compare. image uploading has already been completed in .net . now from the database i need to access these images and calculate their perimeters individually . how do i do this. any other questions do let me know.
a recap : need to write an individual program to read the scanned images into the code and calculate their perimeters respectilvely
thanks ive managed to successfully use variables and measure the perimeter of 2 images i have scanned from my flat bed scanner
refer :
http://www.mathworks.com/matlabcentral/answers/5133-image-processing-calculate-perimeter
however now my question is to combine this as a program in which i can scan the images and compare. image uploading has already been completed in .net . now from the database i need to access these images and calculate their perimeters individually . how do i do this. any other questions do let me know.
a recap : need to write an individual program to read the scanned images into the code and calculate their perimeters respectilvely
thanks image processing, .net, programming, code generation MATLAB Answers — New Questions
How do I damp a membrane subject to a time-dependent force with PDE Toolbox
I have a membrane wave equation simulation using PDE toolbox functions with time-independent but spatially constant or varying m and c. I can excite it with a a time dependent edge boundary or with a time and space dependent f. WIthout f, I can Rayleigh damp an initial state using the M and K matrix for in the documentation (I cannot set d= constant, consarnit, nor is it at all clear how to make the damping expressed in terms of node space dependent.) Anyway, when I during on damping with a nonvanishing f I receive the following error: after the followign code. Any advice/help resolving this would be appreciated as I can’t find in the documentation any example or advice.
if damping==1
fem = assembleFEMatrices(model);
alpha_damp = 1/tau;
beta_damp = 0.01;
dampmat = alpha_damp*fem.M + beta_damp*fem.K;
CA=specifyCoefficients(model,"m",m,"d",dampmat,"c",c,"a",a,"f",f);
end
Error using pde.internal.FESolverUtilities/assembleFEMatricesInternal (line 71)
For a time-dependent model, the last argument must be a structure array with the time data as its ‘time’ field.
Error in assembleFEMatrices (line 124)
FEMatricesOut = assembleFEMatricesInternal(pdem,BCEnforcementOption,matrix,state);I have a membrane wave equation simulation using PDE toolbox functions with time-independent but spatially constant or varying m and c. I can excite it with a a time dependent edge boundary or with a time and space dependent f. WIthout f, I can Rayleigh damp an initial state using the M and K matrix for in the documentation (I cannot set d= constant, consarnit, nor is it at all clear how to make the damping expressed in terms of node space dependent.) Anyway, when I during on damping with a nonvanishing f I receive the following error: after the followign code. Any advice/help resolving this would be appreciated as I can’t find in the documentation any example or advice.
if damping==1
fem = assembleFEMatrices(model);
alpha_damp = 1/tau;
beta_damp = 0.01;
dampmat = alpha_damp*fem.M + beta_damp*fem.K;
CA=specifyCoefficients(model,"m",m,"d",dampmat,"c",c,"a",a,"f",f);
end
Error using pde.internal.FESolverUtilities/assembleFEMatricesInternal (line 71)
For a time-dependent model, the last argument must be a structure array with the time data as its ‘time’ field.
Error in assembleFEMatrices (line 124)
FEMatricesOut = assembleFEMatricesInternal(pdem,BCEnforcementOption,matrix,state); I have a membrane wave equation simulation using PDE toolbox functions with time-independent but spatially constant or varying m and c. I can excite it with a a time dependent edge boundary or with a time and space dependent f. WIthout f, I can Rayleigh damp an initial state using the M and K matrix for in the documentation (I cannot set d= constant, consarnit, nor is it at all clear how to make the damping expressed in terms of node space dependent.) Anyway, when I during on damping with a nonvanishing f I receive the following error: after the followign code. Any advice/help resolving this would be appreciated as I can’t find in the documentation any example or advice.
if damping==1
fem = assembleFEMatrices(model);
alpha_damp = 1/tau;
beta_damp = 0.01;
dampmat = alpha_damp*fem.M + beta_damp*fem.K;
CA=specifyCoefficients(model,"m",m,"d",dampmat,"c",c,"a",a,"f",f);
end
Error using pde.internal.FESolverUtilities/assembleFEMatricesInternal (line 71)
For a time-dependent model, the last argument must be a structure array with the time data as its ‘time’ field.
Error in assembleFEMatrices (line 124)
FEMatricesOut = assembleFEMatricesInternal(pdem,BCEnforcementOption,matrix,state); dpe toolbox, driven damped oscillation MATLAB Answers — New Questions
How to regrid 2 surface data to match each other
Hi,
Soo I have been going on for a bit with this issue. I have a set of wind data for the Australian region that I want to process. This data includes longitude, latitude, and wind speeds in both the x-direction and y-direction. Specifically, the x-direction data is represented by ulon, ulat, and uwind, while the y-direction data is represented by vlat, vlon, and vwind.
I want to calculate the resultant wind speed using the Pythagorean theorem. To do this, the dimensions of the u and v data need to be aligned, which is not the case currently.
How can I write a script to regrid the data so that the dimensions of the u variables match those of the v variables. And for a single lon/lat pair there should be a uwind and vwind.
The results should be stored as rlat, rlon, and rwind, where rlat and rlon are the regridded latitude and longitude, and rwind is the resultant wind speed.
thanks in advance.Hi,
Soo I have been going on for a bit with this issue. I have a set of wind data for the Australian region that I want to process. This data includes longitude, latitude, and wind speeds in both the x-direction and y-direction. Specifically, the x-direction data is represented by ulon, ulat, and uwind, while the y-direction data is represented by vlat, vlon, and vwind.
I want to calculate the resultant wind speed using the Pythagorean theorem. To do this, the dimensions of the u and v data need to be aligned, which is not the case currently.
How can I write a script to regrid the data so that the dimensions of the u variables match those of the v variables. And for a single lon/lat pair there should be a uwind and vwind.
The results should be stored as rlat, rlon, and rwind, where rlat and rlon are the regridded latitude and longitude, and rwind is the resultant wind speed.
thanks in advance. Hi,
Soo I have been going on for a bit with this issue. I have a set of wind data for the Australian region that I want to process. This data includes longitude, latitude, and wind speeds in both the x-direction and y-direction. Specifically, the x-direction data is represented by ulon, ulat, and uwind, while the y-direction data is represented by vlat, vlon, and vwind.
I want to calculate the resultant wind speed using the Pythagorean theorem. To do this, the dimensions of the u and v data need to be aligned, which is not the case currently.
How can I write a script to regrid the data so that the dimensions of the u variables match those of the v variables. And for a single lon/lat pair there should be a uwind and vwind.
The results should be stored as rlat, rlon, and rwind, where rlat and rlon are the regridded latitude and longitude, and rwind is the resultant wind speed.
thanks in advance. regrid data MATLAB Answers — New Questions
Ask for help, my training-progress can ‘t show, can anyone help solve it ?
options = trainingOptions(‘adam’, … % Adam 梯度下降算法
‘MaxEpochs’, 500, … % 最大训练次数 500
‘InitialLearnRate’, 1e-3, … % 初始学习率为 0.001
‘L2Regularization’, 1e-4, … % L2正则化参数
‘LearnRateSchedule’, ‘piecewise’, … % 学习率下降
‘LearnRateDropFactor’, 0.1, … % 学习率下降因子 0.1
‘LearnRateDropPeriod’, 400, … % 经过450次训练后 学习率为 0.001 * 0.1
‘Shuffle’, ‘every-epoch’, … % 每次训练打乱数据集
‘ValidationPatience’, Inf, … % 关闭验证
‘Plots’, ‘training-progress’, … % 画出曲线
‘Verbose’, false);options = trainingOptions(‘adam’, … % Adam 梯度下降算法
‘MaxEpochs’, 500, … % 最大训练次数 500
‘InitialLearnRate’, 1e-3, … % 初始学习率为 0.001
‘L2Regularization’, 1e-4, … % L2正则化参数
‘LearnRateSchedule’, ‘piecewise’, … % 学习率下降
‘LearnRateDropFactor’, 0.1, … % 学习率下降因子 0.1
‘LearnRateDropPeriod’, 400, … % 经过450次训练后 学习率为 0.001 * 0.1
‘Shuffle’, ‘every-epoch’, … % 每次训练打乱数据集
‘ValidationPatience’, Inf, … % 关闭验证
‘Plots’, ‘training-progress’, … % 画出曲线
‘Verbose’, false); options = trainingOptions(‘adam’, … % Adam 梯度下降算法
‘MaxEpochs’, 500, … % 最大训练次数 500
‘InitialLearnRate’, 1e-3, … % 初始学习率为 0.001
‘L2Regularization’, 1e-4, … % L2正则化参数
‘LearnRateSchedule’, ‘piecewise’, … % 学习率下降
‘LearnRateDropFactor’, 0.1, … % 学习率下降因子 0.1
‘LearnRateDropPeriod’, 400, … % 经过450次训练后 学习率为 0.001 * 0.1
‘Shuffle’, ‘every-epoch’, … % 每次训练打乱数据集
‘ValidationPatience’, Inf, … % 关闭验证
‘Plots’, ‘training-progress’, … % 画出曲线
‘Verbose’, false); training-progress, deep learning, machine learning MATLAB Answers — New Questions
Simulink HDL model of Envelope detector
I’m new here, I have a simple envelope detector model designed on simulink following these instructions: https://www.mathworks.com/help/dsp/ug/envelope-detection.html?searchHighlight=envelope&s_tid=srchtitle_support_results_5_envelope. I tried but the input signal’s envelope still shows unwanted word parts at the beginning and end of the envelope (I marked it in red in the image below). Does anyone know where my design problem lies? I spent 2 days with it and still no progress. We hope to receive your help. Thanks a lot
The simulink model and file m contains the filter coefficients is attached below. I hope someone can help me solve this problem, it’s very important to me. Sorry for disturbingI’m new here, I have a simple envelope detector model designed on simulink following these instructions: https://www.mathworks.com/help/dsp/ug/envelope-detection.html?searchHighlight=envelope&s_tid=srchtitle_support_results_5_envelope. I tried but the input signal’s envelope still shows unwanted word parts at the beginning and end of the envelope (I marked it in red in the image below). Does anyone know where my design problem lies? I spent 2 days with it and still no progress. We hope to receive your help. Thanks a lot
The simulink model and file m contains the filter coefficients is attached below. I hope someone can help me solve this problem, it’s very important to me. Sorry for disturbing I’m new here, I have a simple envelope detector model designed on simulink following these instructions: https://www.mathworks.com/help/dsp/ug/envelope-detection.html?searchHighlight=envelope&s_tid=srchtitle_support_results_5_envelope. I tried but the input signal’s envelope still shows unwanted word parts at the beginning and end of the envelope (I marked it in red in the image below). Does anyone know where my design problem lies? I spent 2 days with it and still no progress. We hope to receive your help. Thanks a lot
The simulink model and file m contains the filter coefficients is attached below. I hope someone can help me solve this problem, it’s very important to me. Sorry for disturbing simulink, matlab, hdl, matlab code MATLAB Answers — New Questions
How Can I plot Streamlines for the following code
Rva=[1 0.01];
for i=1:2
M= Rva (i);
lines = {‘:b’,’:g’};
lmd=1;
y=0.5;
gam=1;
N=0.0;
A=0;
B=1;
c1=(A+(B.*gam))./(1+gam);
c2=(B-A)./(1+gam);
T=c1+(c2.*y);
k1=(-N.*((A.^2)-(2.*A.*B)+(B.^2)))./((1+gam).^2);
k2=(-((2.*N.*(A.*B-(A.^2)-(A.*B.*gam)+(B.^2).*gam)+(B-A-(A.*gam)+(B.*gam)))))./((1+gam).^2);
k3=(-(N.*((A.^2)+(2.*A.*B.*gam)+(B.^2).*(gam.^2))+(A+(A.*gam)+(B.*gam)+(B.*(gam.^2)))))./((1+gam).^2);
x1=(1./(lmd.*M.*(cosh(M))+sinh(M)));
x2=((1-cosh(M)).*((2.*k1)+((M.^2).*k3))./(M.^4))+(k1+(k2.*(1+lmd.*(cosh(M)))))./(M.^2);
c4=x1.*x2;
c3=(lmd.*M.*c4)+((2.*k1+(M.^2).*k3)./(M.^4))-(lmd.*k2./(M.^2));
u=c3.*(cosh(M.*y))+c4.*(sinh(M.*y))-((k1.*(y.^2)+(k2.*y)+((2.*k1+(M.^2).*k3)./(M.^2))))./(M.^2);
t0=M.*c4-(k2./(M.^2));
t1=M.*(c3.*sinh(M)+c4.*cosh(M))-((2.*k1+k2)./(M.^2));
t=M.*(c3.*sinh(M.*y)+c4.*cosh(M.*y))-((2.*k1.*y+k2)./(M.^2));
Q=(1./M).*(c3.*sinh(M)+c4.*(cosh(M)-1))-((((M.^2)+6).*k1)./(3.*(M.^4)))-((k2+2.*k3)./(2.*(M.^2)));
k4=-(k1./(M.^2));
k5=-(k2./(M.^2));
k6=-((2.*k1+(M.^2).*k3)./(M.^4));
x3=((4.*c1.*k4)+(6.*c1.*k5)+(12.*c1.*k6)+(3.*c2.*k4)+(4.*c2.*k5)+(6.*c2.*k6))./(12);
Tb1=((c1.*c3).*(sinh(M))./M)+((c1.*c4).*(cosh(M)-1)./(M));
Tb2=((c2.*c3).*(M.*sinh(M)-(cosh(M))+1)./(M.^2));
Tb3=(((c2.*c4).*(M.*(cosh(M))-(sinh(M)))./(M.^2))+x3);
Tb=(1./Q).*(Tb1+Tb2+Tb3);
Nu0=-c2./Tb;
Nu1=c2./Tb;
S=(T+(N.*T.*T));
figure(2)
hold on;
plot(y,u, lines {i},’linewidth’,2)
xlabel(‘Y’);
ylabel(‘U’);
box on;
hold off;
fprintf (‘M=%ft u=%ft Q=%ft Tb=%ft cf0=%ft cf1=%ft Nu0=%ft Nu1=%f n ‘,M,u,Q,Tb,(t0),(t1),(Nu0),(Nu1));
endRva=[1 0.01];
for i=1:2
M= Rva (i);
lines = {‘:b’,’:g’};
lmd=1;
y=0.5;
gam=1;
N=0.0;
A=0;
B=1;
c1=(A+(B.*gam))./(1+gam);
c2=(B-A)./(1+gam);
T=c1+(c2.*y);
k1=(-N.*((A.^2)-(2.*A.*B)+(B.^2)))./((1+gam).^2);
k2=(-((2.*N.*(A.*B-(A.^2)-(A.*B.*gam)+(B.^2).*gam)+(B-A-(A.*gam)+(B.*gam)))))./((1+gam).^2);
k3=(-(N.*((A.^2)+(2.*A.*B.*gam)+(B.^2).*(gam.^2))+(A+(A.*gam)+(B.*gam)+(B.*(gam.^2)))))./((1+gam).^2);
x1=(1./(lmd.*M.*(cosh(M))+sinh(M)));
x2=((1-cosh(M)).*((2.*k1)+((M.^2).*k3))./(M.^4))+(k1+(k2.*(1+lmd.*(cosh(M)))))./(M.^2);
c4=x1.*x2;
c3=(lmd.*M.*c4)+((2.*k1+(M.^2).*k3)./(M.^4))-(lmd.*k2./(M.^2));
u=c3.*(cosh(M.*y))+c4.*(sinh(M.*y))-((k1.*(y.^2)+(k2.*y)+((2.*k1+(M.^2).*k3)./(M.^2))))./(M.^2);
t0=M.*c4-(k2./(M.^2));
t1=M.*(c3.*sinh(M)+c4.*cosh(M))-((2.*k1+k2)./(M.^2));
t=M.*(c3.*sinh(M.*y)+c4.*cosh(M.*y))-((2.*k1.*y+k2)./(M.^2));
Q=(1./M).*(c3.*sinh(M)+c4.*(cosh(M)-1))-((((M.^2)+6).*k1)./(3.*(M.^4)))-((k2+2.*k3)./(2.*(M.^2)));
k4=-(k1./(M.^2));
k5=-(k2./(M.^2));
k6=-((2.*k1+(M.^2).*k3)./(M.^4));
x3=((4.*c1.*k4)+(6.*c1.*k5)+(12.*c1.*k6)+(3.*c2.*k4)+(4.*c2.*k5)+(6.*c2.*k6))./(12);
Tb1=((c1.*c3).*(sinh(M))./M)+((c1.*c4).*(cosh(M)-1)./(M));
Tb2=((c2.*c3).*(M.*sinh(M)-(cosh(M))+1)./(M.^2));
Tb3=(((c2.*c4).*(M.*(cosh(M))-(sinh(M)))./(M.^2))+x3);
Tb=(1./Q).*(Tb1+Tb2+Tb3);
Nu0=-c2./Tb;
Nu1=c2./Tb;
S=(T+(N.*T.*T));
figure(2)
hold on;
plot(y,u, lines {i},’linewidth’,2)
xlabel(‘Y’);
ylabel(‘U’);
box on;
hold off;
fprintf (‘M=%ft u=%ft Q=%ft Tb=%ft cf0=%ft cf1=%ft Nu0=%ft Nu1=%f n ‘,M,u,Q,Tb,(t0),(t1),(Nu0),(Nu1));
end Rva=[1 0.01];
for i=1:2
M= Rva (i);
lines = {‘:b’,’:g’};
lmd=1;
y=0.5;
gam=1;
N=0.0;
A=0;
B=1;
c1=(A+(B.*gam))./(1+gam);
c2=(B-A)./(1+gam);
T=c1+(c2.*y);
k1=(-N.*((A.^2)-(2.*A.*B)+(B.^2)))./((1+gam).^2);
k2=(-((2.*N.*(A.*B-(A.^2)-(A.*B.*gam)+(B.^2).*gam)+(B-A-(A.*gam)+(B.*gam)))))./((1+gam).^2);
k3=(-(N.*((A.^2)+(2.*A.*B.*gam)+(B.^2).*(gam.^2))+(A+(A.*gam)+(B.*gam)+(B.*(gam.^2)))))./((1+gam).^2);
x1=(1./(lmd.*M.*(cosh(M))+sinh(M)));
x2=((1-cosh(M)).*((2.*k1)+((M.^2).*k3))./(M.^4))+(k1+(k2.*(1+lmd.*(cosh(M)))))./(M.^2);
c4=x1.*x2;
c3=(lmd.*M.*c4)+((2.*k1+(M.^2).*k3)./(M.^4))-(lmd.*k2./(M.^2));
u=c3.*(cosh(M.*y))+c4.*(sinh(M.*y))-((k1.*(y.^2)+(k2.*y)+((2.*k1+(M.^2).*k3)./(M.^2))))./(M.^2);
t0=M.*c4-(k2./(M.^2));
t1=M.*(c3.*sinh(M)+c4.*cosh(M))-((2.*k1+k2)./(M.^2));
t=M.*(c3.*sinh(M.*y)+c4.*cosh(M.*y))-((2.*k1.*y+k2)./(M.^2));
Q=(1./M).*(c3.*sinh(M)+c4.*(cosh(M)-1))-((((M.^2)+6).*k1)./(3.*(M.^4)))-((k2+2.*k3)./(2.*(M.^2)));
k4=-(k1./(M.^2));
k5=-(k2./(M.^2));
k6=-((2.*k1+(M.^2).*k3)./(M.^4));
x3=((4.*c1.*k4)+(6.*c1.*k5)+(12.*c1.*k6)+(3.*c2.*k4)+(4.*c2.*k5)+(6.*c2.*k6))./(12);
Tb1=((c1.*c3).*(sinh(M))./M)+((c1.*c4).*(cosh(M)-1)./(M));
Tb2=((c2.*c3).*(M.*sinh(M)-(cosh(M))+1)./(M.^2));
Tb3=(((c2.*c4).*(M.*(cosh(M))-(sinh(M)))./(M.^2))+x3);
Tb=(1./Q).*(Tb1+Tb2+Tb3);
Nu0=-c2./Tb;
Nu1=c2./Tb;
S=(T+(N.*T.*T));
figure(2)
hold on;
plot(y,u, lines {i},’linewidth’,2)
xlabel(‘Y’);
ylabel(‘U’);
box on;
hold off;
fprintf (‘M=%ft u=%ft Q=%ft Tb=%ft cf0=%ft cf1=%ft Nu0=%ft Nu1=%f n ‘,M,u,Q,Tb,(t0),(t1),(Nu0),(Nu1));
end differential equation, streamlines MATLAB Answers — New Questions
Motor drive efficiency and power
Hello Everyone,
I have modelled a 3-phase motor drive, and now I would like to calculate its input and output power for the purpose of efficiency calculation. I am using a power sensor at the DC side in which I am averaging the power at every 0.001 sec, and using a three-phase power sensor at the inverter’s output. The issue which I am facing is that the inverter’s output power is somehow higher than input power, approximately 10 times higher. Could you please provide your insight on how do I rectify this issue, or what could the problem causing this? For three-phase power sensor, the settings are set at balanced load.
Moreover, I am also using a mechanical power sensor at the motor end to calculate mechanical power, and in order to calculate overall efficiency of the drive, i would normally divide the output power by input power. I have saved the scope data and transfered it into excel, where when I performed division between output and input, i get different efficiency values for different points which is expected, but at some points, the efficiency is more than 100% apparently. Could you kindly provide assistance on how should I approach this issue to find effciency? should I average the vlaues first?
The scope screenshot is hereby attached.
Note: A drivecycle is used as a reference that is why there is no output until 20Sec.Hello Everyone,
I have modelled a 3-phase motor drive, and now I would like to calculate its input and output power for the purpose of efficiency calculation. I am using a power sensor at the DC side in which I am averaging the power at every 0.001 sec, and using a three-phase power sensor at the inverter’s output. The issue which I am facing is that the inverter’s output power is somehow higher than input power, approximately 10 times higher. Could you please provide your insight on how do I rectify this issue, or what could the problem causing this? For three-phase power sensor, the settings are set at balanced load.
Moreover, I am also using a mechanical power sensor at the motor end to calculate mechanical power, and in order to calculate overall efficiency of the drive, i would normally divide the output power by input power. I have saved the scope data and transfered it into excel, where when I performed division between output and input, i get different efficiency values for different points which is expected, but at some points, the efficiency is more than 100% apparently. Could you kindly provide assistance on how should I approach this issue to find effciency? should I average the vlaues first?
The scope screenshot is hereby attached.
Note: A drivecycle is used as a reference that is why there is no output until 20Sec. Hello Everyone,
I have modelled a 3-phase motor drive, and now I would like to calculate its input and output power for the purpose of efficiency calculation. I am using a power sensor at the DC side in which I am averaging the power at every 0.001 sec, and using a three-phase power sensor at the inverter’s output. The issue which I am facing is that the inverter’s output power is somehow higher than input power, approximately 10 times higher. Could you please provide your insight on how do I rectify this issue, or what could the problem causing this? For three-phase power sensor, the settings are set at balanced load.
Moreover, I am also using a mechanical power sensor at the motor end to calculate mechanical power, and in order to calculate overall efficiency of the drive, i would normally divide the output power by input power. I have saved the scope data and transfered it into excel, where when I performed division between output and input, i get different efficiency values for different points which is expected, but at some points, the efficiency is more than 100% apparently. Could you kindly provide assistance on how should I approach this issue to find effciency? should I average the vlaues first?
The scope screenshot is hereby attached.
Note: A drivecycle is used as a reference that is why there is no output until 20Sec. motordrive, powersensor, efficiency MATLAB Answers — New Questions
Cannot create UdpPort for specified LocalHost and LocalPort
I want to receive Ethernet data through udpport,It was up and running yesterday。
u=udpport("LocalHost","192.168.33.30","LocalPort",4098,"OutputDatagramSize",65507);
Now when I run it, I get an error:
ERROR: Unable to bind to LOCALHOST and LOCALPORT. Verify that the LOCALPORT is not in use, and that LOCALHOST and LOCALPORT are valid for IPADDRESSVERSION "IPV4".
I change different localport and localport,and I even restarted the computer, but still reported the error,I checked the port through cmd and there was no process。I hope to get an answer。I want to receive Ethernet data through udpport,It was up and running yesterday。
u=udpport("LocalHost","192.168.33.30","LocalPort",4098,"OutputDatagramSize",65507);
Now when I run it, I get an error:
ERROR: Unable to bind to LOCALHOST and LOCALPORT. Verify that the LOCALPORT is not in use, and that LOCALHOST and LOCALPORT are valid for IPADDRESSVERSION "IPV4".
I change different localport and localport,and I even restarted the computer, but still reported the error,I checked the port through cmd and there was no process。I hope to get an answer。 I want to receive Ethernet data through udpport,It was up and running yesterday。
u=udpport("LocalHost","192.168.33.30","LocalPort",4098,"OutputDatagramSize",65507);
Now when I run it, I get an error:
ERROR: Unable to bind to LOCALHOST and LOCALPORT. Verify that the LOCALPORT is not in use, and that LOCALHOST and LOCALPORT are valid for IPADDRESSVERSION "IPV4".
I change different localport and localport,and I even restarted the computer, but still reported the error,I checked the port through cmd and there was no process。I hope to get an answer。 udpport, udp, matlab, ethernet MATLAB Answers — New Questions
Integer programming optimization solving non linear objective function with linear equality and inequality constraints using Optimization Toolbox.
How to use optimization toolbox to find integer solutions for the decision variables from a non linear objective problem with linear constraints (both equality and inequality)?
eg. we can achieve so using genetic algorithm using mixed integer programming method.
Or any another way to go?How to use optimization toolbox to find integer solutions for the decision variables from a non linear objective problem with linear constraints (both equality and inequality)?
eg. we can achieve so using genetic algorithm using mixed integer programming method.
Or any another way to go? How to use optimization toolbox to find integer solutions for the decision variables from a non linear objective problem with linear constraints (both equality and inequality)?
eg. we can achieve so using genetic algorithm using mixed integer programming method.
Or any another way to go? integer programming optimization, constrained optimization MATLAB Answers — New Questions