Science topic

MATLAB Simulation - Science topic

Explore the latest questions and answers in MATLAB Simulation, and find MATLAB Simulation experts.
Questions related to MATLAB Simulation
  • asked a question related to MATLAB Simulation
Question
3 answers
I am using decode and forward scheme for dual hop wireless communication system. first hop is operating in THz frequency range (alpha mu fading with pointing error) and the second hop is operating in RF frequency range (Rayleigh fading). The end to end SNR of the mixed THz-RF wireless system can be expressed as gamma(e) = min(gamma(1), gamma(2)), where gamma(1) and gamma(2) are the SNR of first and second hop respectively.
I have derived the PDF and CDF of the gamma(e) and plotted the analytical results for outage probability and average BER .
I just want a simulation MATLAB code for this mixed THz-RF wireless communication system with decode and forward scheme.
Relevant answer
Answer
To write a MATLAB simulation code for a mixed THz-RF wireless communication system, you will need to:
  1. Define the parameters of the system, such as the carrier frequencies, bandwidths, and modulation schemes of the THz and RF links.
  2. Generate the transmit signals for the THz and RF links.
  3. Model the propagation channels for the THz and RF links.
  4. Calculate the received signals at the receiver.
  5. Demodulate the received signals to recover the data.
Here is an example of a MATLAB code for a mixed THz-RF wireless communication system:
Matlab
function simulate_mixed_thz_rf_system() % Define the parameters of the system thz_carrier_frequency = 100 GHz; thz_bandwidth = 1 GHz; rf_carrier_frequency = 2.4 GHz; rf_bandwidth = 200 MHz; % Generate the transmit signals for the THz and RF links thz_transmit_signal = tone(1, thz_bandwidth); rf_transmit_signal = qpsk_modulate(rand(1, rf_bandwidth)); % Model the propagation channels for the THz and RF links thz_channel = AWGNChannel(thz_bandwidth); rf_channel = RicianChannel(rf_bandwidth, 10 dB); % Calculate the received signals at the receiver thz_received_signal = thz_channel * thz_transmit_signal; rf_received_signal = rf_channel * rf_transmit_signal; % Demodulate the received signals to recover the data thz_data = demodulate_tone(thz_received_signal); rf_data = demodulate_qpsk(rf_received_signal); end
content_copyUse code with caution. Learn more
This code defines a mixed THz-RF wireless communication system with a THz carrier frequency of 100 GHz, a THz bandwidth of 1 GHz, an RF carrier frequency of 2.4 GHz, and an RF bandwidth of 200 MHz. The transmit signals for the THz and RF links are generated using the tone and qpsk_modulate functions, respectively. The propagation channels for the THz and RF links are modeled using the AWGNChannel and RicianChannel functions, respectively. The received signals at the receiver are calculated using the convolution operation. The data is then demodulated from the received signals using the demodulate_tone and demodulate_qpsk functions.
This is just a simple example of a MATLAB code for a mixed THz-RF wireless communication system. The specific implementation of the code will vary depending on the specific parameters of the system.
  • asked a question related to MATLAB Simulation
Question
2 answers
Hello, I'm am working on a liquid crystal antenna for my thesis work. I was trying to use this liquid crystal (LC) mixture GT7-29001 from Merck KGaA, Dramstadt, Germany.
From a research paper, I found the following information - GT7-29001 is an LC optimized for high-frequency band applications, and two dielectric constants were ε⊥ = 2.45 (tan δ⊥ = 0.0116) and ε∥ = 3.53(tan δ∥ = 0.0064) at 19 GHz, respectively, according to the datasheet provided by the Merck KGaA.
Please tell me if anyone can help me to -
  • Get the datasheet provided by the Merck KGaA (I tried searching for it in internet but couldn't find it).
  • To simulate this mixture as a substrate in any simulation software (HFSS, CST, ADS, MATLAB).
Relevant answer
Answer
Hello,
If the simulation software is CST, then in material selection for substrate, select new material and then fill the properties of GT7-29001 like permittivity, conductivity, loss tangent etc.
For properties of material, one paper is attached.
Thanks,
  • asked a question related to MATLAB Simulation
Question
3 answers
Hi everyone,
I am trying to simulate an M-QAM MIMO system, and I want to decode the received signal using QR decomposition and sphere decoding.
However, I am struggling to understand how to implement the simple tree sphere decoding algorithm.
Here's my understanding so far:
Given a receive signal as follows:
1. Y = HX + N;
where X is a K x 1 vector consisting of K MQAM data symbols, H is a K x K fading matrix, N is a
K x 1 AWGN vector, and Y is the K x 1 received vector.
We perform QR detection as follows:
2. H = QR;
where Q is a K x K Unitary matrix, and R is a upper-triangular matrix with entry R(i, j),
with i and j being the row and column indices respectively.
Then we equalise the receive signal in 1. as:
3. Z = (Q^H)*Y = RX + (Q^H)*N , where Q^H is the Hermitian transpose of Q.
I now want to perform Sphere decoding based on 3. This is where I am struggling.
My best attempt at coding this algorithm in Matlab is shown below (Assuming K = 8, and assuming an arbitrary radius d):
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ## Inputs:
% # R, upper triangular matrix
% # Z,vector receive signal
% # d, radius of sphere
%
% ## Output
% # X_hat, vector of estimated symbols
n = 8; % n => K
d_vector = zeros(1, n);
d_vector(n) = d;
Upp_bound = zeros(1, n);
Low_bound = zeros(1, n);
minR = d_vector(n);
intersum = zeros(1, n);
intersum(n) = Z(n);
Upp_bound(n) = (d_vector(n) + Z(n))/R(n, n);
Low_bound(n) = (-d_vector(n) + Z(n))/R(n, n);
X_hat = zeros(1, n);
% ## begin algorithm
if Low_bound(n) > Upp_bound(n)
return null;
else
X_hat(n) = Low_bound(n);
end
k = n;
while X_hat(n) <= Upp_bound(n)
if X_hat(k) > Upp_bound(k)
k = k + 1;
X_hat(k) = X_hat(k) + 1;
else
if k > 1
k = k - 1;
d_vector(k) = sqrt(d_vector(k)^2 - (intersum(k + 1) - R(k + 1, k + 1)*X_hat(k + 1))^2);
intersum(k) = Z(k) - R(k, (k + 1):n)*X_hat((k + 1):n);
Upp_bound(k) = (d_vector(k) + intersum(k))/R(k, k);
Low_bound(k) = (-d_vector(k) + intersum(k))/R(k, k);
if Low_bound(k) > Upp_bound(k)
k = k + 1;
X_hat(k) = X_hat(k + 1);
else
X_hat(k) = Low_bound(k);
end
else
while X_hat(k) <= Upp_bound(k)
if minR > norm(Z - R*X_hat, 'fro')^2
X_est_vector = X_hat; %found X_hat
minR = norm(Z - R*X_hat, 'fro')^2;
end
X_hat(k) = X_hat(k) + 1;
end
k = k + 1;
X_hat(k) = X_hat(k) + 1;
end
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Please could you tell me where I might be going wrong.
Thank you.
Relevant answer
Answer
Here are the steps on how to perform sphere decoding on an MQAM MIMO system:
  1. Generate the transmitted signal. This can be done by generating complex symbols for each transmit antenna and mapping them to the corresponding MQAM constellation points.
  2. Add noise to the received signal. This can be done by generating a noise vector with the same dimensions as the received signal and adding it to the received signal.
  3. Perform QR decomposition on the received signal. This will reduce the received signal to a lower-dimensional space.
  4. Initialize the sphere radius. The sphere radius is a parameter that determines the size of the search space. A larger sphere radius will result in a higher probability of finding the correct solution, but it will also increase the computational complexity of the algorithm.
  5. Start the sphere decoding algorithm. The sphere decoding algorithm will start by finding the closest lattice point to the received signal within the sphere radius. This point will be the initial candidate solution.
  6. Expand the sphere radius. The sphere radius will be expanded until a point is found that is a valid MQAM symbol. This point will be the final solution of the sphere decoding algorithm.
  • asked a question related to MATLAB Simulation
Question
6 answers
I constructed a linear mixed-effects model in Matlab with several categorical fixed factors, each having several levels. Fitlme calculates confidence intervals and p values for n-1 levels of each fixed factor compared to a selected reference. How can I get these values for other combinations of factor levels? (e.g., level 1 vs. level 2, level 1 vs. level 3, level 2 vs. level 3).
Thanks,
Chen
Relevant answer
Answer
First, to change the reference level You can specify the order of items in categorical array
categorical(A,[1, 2, 3],{'red', 'green', 'blue'}) or
categorical(A,[3, 2, 1],{'blue', 'green', 'red'})
Second, You can specify the correct hypothesis matrix for coefTest function for comparison between every pair of categories.
  • asked a question related to MATLAB Simulation
Question
4 answers
Most of the codes in the examples in the literature are presented for discrete variables. While the main challenge in solving Bayesian networks is the use of continuous variables. Marco's chain will be used in probability inference in the solution process. Also, this network includes predicting procedures and updating processes using observations
Relevant answer
Answer
Here is an answer produced by ChatGPT...
Maybe it helps you:
ChatGPT answer:
There are several libraries in both MATLAB and Python that can be used to solve Continuous Bayesian Networks (CBNs). One such library is the pyMC3 package in Python, which is a probabilistic programming library that supports continuous variables.
Here is an example of how to use pyMC3 to create a simple CBN and perform model updating based on observations:
Python code:
import pymc3 as pm
import numpy as np
# Define the CBN using a graphical model
with pm.Model() as model:
# Define prior distributions for the variables
mean = pm.Normal('mean', mu=0, sigma=1)
std = pm.HalfNormal('std', sigma=1)
x = pm.Normal('x', mu=mean, sigma=std)
# Define the likelihood based on observations
obs = pm.Normal('obs', mu=x, sigma=0.1, observed=np.array([1, 2, 3]))
# Perform model inference
trace = pm.sample(1000)
In this example, we create a CBN with one continuous variable, x, which is assumed to be normally distributed with mean mean and standard deviation std. We then define the likelihood function using the observed data obs. Finally, we use the sample function to perform Markov Chain Monte Carlo (MCMC) inference and obtain posterior samples for the variables.
Similarly, in MATLAB, you can use the BayesNet toolbox to construct and solve CBNs. Here is an example code to create a CBN and perform model updating based on observations:
Matlab Code:
% Define the CBN using a graphical model
dag = zeros(2);
dag(1,2) = 1;
node_sizes = [1 1];
bnet = mk_bnet(dag, node_sizes);
% Define the prior distributions for the variables
bnet.CPD{1} = gaussian_CPD(bnet, 1, 'mean', 0, 'cov', 1);
bnet.CPD{2} = gaussian_CPD(bnet, 2, 'mean', 0, 'cov', 1);
% Generate some data from the prior distributions
data = cell(1, 2);
data{1} = randn(1000, 1);
data{2} = randn(1000, 1);
% Perform model inference
engine = jtree_inf_engine(bnet);
[engine, loglik] = enter_evidence(engine, data);
marginals = marginal_nodes(engine, 2);
% Update the model based on observations
data{2} = [1; 2; 3];
[engine, loglik] = enter_evidence(engine, data);
marginals = marginal_nodes(engine, 2);
In this example, we create a CBN with two variables, where the second variable is a function of the first variable. We define the prior distributions for the variables using the gaussian_CPD function. We then generate some data from the prior distributions and use the jtree_inf_engine function to perform inference and obtain the marginal distribution of the second variable. Finally, we update the model based on some observations and perform inference again to obtain the updated marginal distribution of the second variable.
Note that these are just simple examples and CBNs can be much more complex with many variables and dependencies. The choice of library and specific implementation may depend on the complexity of the model and the specific requirements of the problem at hand.
Regenerate response.
  • asked a question related to MATLAB Simulation
Question
2 answers
What is the difference between a conventional rectifier and an ultrafast rectifier in MATLAB/Simulink?
Relevant answer
Answer
Usually, these are active rectifiers. they are used for control power factor correction and harmonic improvement purpose.
  • asked a question related to MATLAB Simulation
Question
12 answers
Is there any code / package / script to automatically generate single-line diagrams from PYPOWER/MATPOWER casefile or IEEE CDF formats?
Relevant answer
  • asked a question related to MATLAB Simulation
Question
5 answers
was trying plot the pole zero plot of a transfer function.And used the code
H=pzplot(t1) for the same and got the output like Figure 1
But I wanted an answer like Figure 2 ,with names and different colours for poles and zeros
What should I do?
These are the Filter coefficients
b = [1,0.618,1] %numerator coefficients
a = [1,0,0] % denominator coefficients
b = b/sum(b) % normalization
figure
t1 = tf(b,a,(1/fs))
Thank You
Relevant answer
Answer
To label the poles and zeros with names and different colors in the pole-zero plot, you need to add the following code after creating the transfer function t1:
hold on;
p = pole(t1); % extract the poles of the transfer function
z = zero(t1); % extract the zeros of the transfer function pzplot(t1); % plot the pole-zero diagram
title('Pole-Zero Plot of Transfer Function');
xlabel('Real');
ylabel('Imaginary');
% Plot poles with red x
for i = 1:length(p) plot(real(p(i)),imag(p(i)),'rx','MarkerSize',12,'LineWidth',2); end
% Plot zeros with blue o
for i = 1:length(z) plot(real(z(i)),imag(z(i)),'bo','MarkerSize',12,'LineWidth',2); end
legend('Poles','Zeros','Location','best');
hold off;
  • asked a question related to MATLAB Simulation
Question
4 answers
Dear members of the wireless research community, please guide me.
In the image of an equation given below, N is the antennas at BS and K is the UTs; eta is the ratio of length of pilot to data symbols; mu is the ratio of pilot symbol energy to data symbol energy; alpha is the fading second moment; rho denotes the channel's imperfect estimation; and the mean SNIR for the ZF detector is given as gamma. What pertinent information can we glean from the equation? Secondly, how can we draw some useful asymptotes from this equation? because standard BER commands are typically used in Matlab simulations, and these equations are not simulated for BER. Secondly, if in the equation we change the parameter (N-K+1) to N (which is the case for MRC), what insights do we get from that?
Relevant answer
Answer
Muhammad Usman Hadi, I appreciate the response you gave. Yes, I'm aware of it. Actually, I'm interested in the equation (attached as an image). For example, what information do we gain if we change the parameter (N-K+1) in the equation (for ZF) to N (for MRC)? Second, how can we draw the asymptote from the equation when standard BER vs. SNIR commands are typically used in MATLAB simulations even for BER calculations with imperfect channel state information and equations (such as the one in the image for an imperfect channel) are not simulated for BER?
  • asked a question related to MATLAB Simulation
Question
2 answers
I was wondering if anyone has experince in tranining a neural network in simulink. I tried a couple of methods, they work in offline, however do not work well with the simulink. Any advice is much appreciated. Thank you
Relevant answer
Answer
It is recommended to check the quality of data
  • asked a question related to MATLAB Simulation
Question
2 answers
I am trying to use hydrogen produced from the Alkaline electrolyzer in production of Green Ammonia. I have researched online and found most of the ammonia synthesis are done in Aspen plus or HYSYS or dwsim or similar like that.
I am trying to make Ammonia synthesis model in MATLAB but I am having problem in here. Originally I am not the chemical engineering student, so I don't know much of dynamic mass and energy balance. Is there a good resource which I can use for modelling Ammonia synthesis in MATLAB?
Alkaline electrolyzer model is made on MATLAB simulink, so I am trying to make Ammonia synthesis model on MATLAB too.
Please help me in here if you know something.
Relevant answer
Answer
I'm also not from the chemical engineering. However, I know some fundamental principles (i.e., Conservation of Mass, Darcy's law, Fick's laws, Fourier's law) related to the chemical processes because I searched and read a lot. There is no shortcut unless you have a personalized one-on-one teacher. Start by extracting the knowledge from this article:
You are advised to derive the mathematical model first before implementing it in MATLAB/Simulink.
  • asked a question related to MATLAB Simulation
Question
8 answers
This DC Microgrid comprises of wind turbine, PV, FC and two batteries with supercapacitors as DC machines. There are two breakers in the simulation.
I have tried changing solvers or run simulation in Discrete mode. They did not work.
Relevant answer
Answer
My suggestions are:
Use average models for converters (easy if you are not interested to high frequency harmonics).
Convert continuous state models to discrete state to run at fixed time step (this requires a deep understanding of each module).
Decouple possible algebraic loops.
Simplify the models of cables and TL's.
With both provision should allow increasing the time step up to 10-50 useconds.
Eventually, is a phasor approach completely out of your scope?
  • asked a question related to MATLAB Simulation
Question
2 answers
Dear researchers,
Can anyone share the Visual Basic or Matlab Code of the membrane distillation process with me?
Thank you so much.
Regards
Relevant answer
Answer
Dear Foroogh Khodadadi:
You can benefit from these valuable Links about your topic:
I hope it will be helpful ...
Best wishes ...
  • asked a question related to MATLAB Simulation
Question
3 answers
Using Python, I would like to convert PSD (G2/Hz vs Frequency) diagrams to Acceleration vs Time diagrams. Would someone be able to provide some insight into this matter, because I would like to know first whether or not this can be accomplished and if so, how?
Relevant answer
Answer
DearRavi Patel:
At the first, and as you know we can say the following information:
Vibration Research software uses Welch’s method for power spectral density (PSD) estimation. This method applies the fast Fourier transform (FFT) algorithm to the estimation of power spectra.
In regards to his method, Peter D. Welch said, “[the] principal advantages of this method are a reduction in the number of computations and in required core storage, and convenient application in non-stationarity tests.”
The process begins with Gaussian-distributed time-domain input data—i.e., a time history file.
Relying on the above، you can benefit from this valuable article about your topic:
"Calculating PSD from a Time History File"
I hope it will be helpful ...
Best regards ...
  • asked a question related to MATLAB Simulation
Question
1 answer
Recently, I have been troubing in calculating the Lenticular lens Imaging. I want to find a method to calculate the object is imaged through the lenticular lens
  • asked a question related to MATLAB Simulation
Question
7 answers
The input is a circularly polarized light that is sent to a polarization conventer and I want to calculate the reflectance(or transmittance) of the fraction of the output that has a specific polarization.
Lumerical monitors only measures reflectance\transmittance of the total output field.
I want the transmittance of a specific polarization component of the output
Relevant answer
Answer
What is the actual answer to distinguish an RCP/LCP wave in the receiver power monitor in Ansys (previously lumerical) FDTD? Suppose LCP is transmitted it can be seen in the power monitor what factor is transmitted, the same for RCP; but if there is a conversion from LCP to RCP (or vice versa) how to distinguish?
  • asked a question related to MATLAB Simulation
Question
3 answers
I fabricated a supercapacitor which uses carbon as electrode material and found specific capacitance, cycle life, EIS studies, GCD curves, power and energy density.
Is it possible to simulate the same (fabricated electrode) using MATLAB Simulation.
Relevant answer
Answer
Develop mathematical model and simulate in MATLAB or develop structure and simulate in COMSOL with AC-DC modules.
  • asked a question related to MATLAB Simulation
Question
1 answer
i need to design a model with some specifications
To Design a Fuzzy Control FLC that uses the indirect field-oriented control IFOC approach to regulate the velocity of an IM motor please i need an urgent help and solution
Relevant answer
Answer
yes
  • asked a question related to MATLAB Simulation
Question
3 answers
For example, to classify the data in Python or such programs, we use 0001; 0010; 0100; and 1000 digits for four classes. Can we simply use 1; 2; 3 and 4 in MATLAB? This will help me diagnose if I have multiple classes.
Relevant answer
Answer
For machine learning classifiers, I suggest you keep the "binary" encoding of output data (in fact, you seem to use the "one-hot" encoding, since the corresponding binary numbers would be 001, 010, 011, 100).
In the one-hot encoding all class outputs are equally far away from the "origin", i.e. they are equivalent from the network's point of view. Assigning decimal numbers to classes, you force the network to predict "larger" values for some classes and "smaller" values for others, while the output scale does not carry any information in reality. I think this could lead to worse performance or slower convergence.
If decimal encoding helps some other stage of your workflow, you can of course transform the network outputs to decimal afterwards.
  • asked a question related to MATLAB Simulation
Question
3 answers
Hello, can anyone guide me on "How to Interface DAC with FPGA using Xilinx System Generator?"
Relevant answer
Answer
Aparna Sathya Murthy , I am using Basys3 FPGA Board and external DAC. I have the code for that DAC but how to connect DAC with FPGA? can you please share any detailed docs related to this?
Thank You
  • asked a question related to MATLAB Simulation
Question
2 answers
Anyone can share BLDC motor control MATLAB simulation file??
Relevant answer
  • asked a question related to MATLAB Simulation
Question
3 answers
I am trying to plot 4 races on one polar plot using "hold on" command. the function I am using is "polar2". when plotting 2nd or 3rd trace, seems to create new axis (may be). the trace is extending.
Is there any other way to plot 2-3 plots in the same polar plot without using "hold on" command in Matlab?
Relevant answer
Answer
Meenakshi Kohli When calling nexttile, give the span option to produce a plot that spans many rows or columns. Make a 2-by-2 arrangement, for example. Plot the plot into the first two tiles. Then, make a plot with one row and two columns.
hold off toggles the hold state to off, which clears all existing plots and resets all axis properties when new plots are added to the axes. The next plot added to the axes employs the initial color and line style determined by the axes' ColorOrder and LineStyleOrder parameters. This is the standard behavior.
Using tiledlayout or subplot, you may display numerous plots in various regions of the same window. The tiledlayout function was added in R2019b and gives you additional flexibility over your labels.
  • asked a question related to MATLAB Simulation
Question
1 answer
I want to run an ODE system by varying a suitable parameter, suppose \alpha. Now I have divided the job into the corresponding worker and created a data file so that for each parameter \alpha, I need to copy a certain measure of the system into the data file. When I googled it and went through some documentation, I realized that using a single file only creates a route to a corrupt file. It is not a way to do that, and I need to create multiple files. I need to ask whether there is any way to create files with some exact name (must be in parallel programing) and scan data from all the files to create another data file that contains all the data.
  • asked a question related to MATLAB Simulation
Question
3 answers
I want to do MATLAB simulation for the MIAB welding process. In the process the arc play a very important role. So I want to understand the arc simulation in MATLAB. Kindly help me with that.
  • asked a question related to MATLAB Simulation
Question
13 answers
I have a simulation code for a Horizontal Washing Machine.
The code solves the equations of motions of the system by Matlab ode45 and plots the vibration response of the system at the transient state of performance.
In this code, the frequency (omega) is an exponential function of time, as it's stated below (and its diagram is attached to 'the question'):
-------------------------------------------------------------------------------------------------------------------------------------------------------
omega= (1-exp((-0.5)*t))*omega_0+(1-exp((-0.5)*heaviside(t-t1).*(t-t1)))*(omega_1-omega_0);
-------------------------------------------------------------------------------------------------------------------------------------------------------
ode command:
-----------------------------------------------------------------------------
[T,Y]=ode45(@snowa1,tspan1,initial_vector1);
plot(T,Y(:,1)-mean(Y(:,1)))
-----------------------------------------------------------------------------
The resulting displacement response is attached to the question.
It is desired to :
First, increase the frequency to omega_0 by exponential1
Then, increase it to omega_1 by exponential2
But 'the problem' is that:
the displacement response shows an unexpected increase in frequency at the beginning of the second exponential increase (it becomes 20 Hz, which is much larger than the maximum frequency in the simulation- 10 Hz).
Do you know what could be the reason for this response?
Any help would be gratefully appreciated.
Relevant answer
Answer
I understand that the 4DOF system for the washer can be quite lengthy. However, I'm unsure if your question is a control problem. If it is, and the 4DOF mathematical model can be expressed in such form:
x' = f(x) + g(xFc(ω)
where
  1. f(x) = [f1(x), f2(x), f3(x), f4(x)]T and g(x) are the nonlinear terms in column vector forms that you derived from the Lagrangian method,
  2. Fc(ω) is the control force that represents a function of ω in vector form, and
  3. ω (omega) is the control input,
then I think it is possible to design the spin speed profile for the control input, ω, so that the desired responses of x can be achieved. If you want to design the profile, you need to at least understand the mathematical equation for Fc(ω). Do you want to regulate the spin speed at 300 rpm, 600 rpm, or 1200 rpm? Because I see only the signal oscillates within the dimensionless amplitudes ± 4×10–3.
I have plotted the signal according to your suggestion, and compared it with Mahdi's original signal. Note that if t1 > 5/τ, then exp(–τ·θ(t – t1)·t) ≈ 0 after t1, because exp(–0.5·t) has decayed to almost zero.
  • asked a question related to MATLAB Simulation
Question
3 answers
please I am working on state estimation of power systems using the weighted least square and i have zero clue on how to go about it using MATLAB. I am using an IEEE 14 bus system. please i need help. Anyone has the complete research and project please kindly reach out.
Relevant answer
Answer
I agree with Xingyu Zhou.
  • asked a question related to MATLAB Simulation
Question
4 answers
Can the IMCOUNTOR image diagram in MATLAB be used to run on holograms as well?
The image below is an example of an activated sludge cell under a light microscope and the second figure is an example of another cell.
Relevant answer
Answer
You can create a contour plot of the data in a grayscale image using imcontour . This function is similar to the contour function in MATLAB®, but it automatically sets up the axes so their orientation and aspect ratio match the image. To label the levels of the contours, use the clabel function.
Regards,
Shafagat
  • asked a question related to MATLAB Simulation
Question
5 answers
Hi,
(I have asked this questions previously, but I believe it was too general. I have tried to be more specific here)
I am trying to establish an islanded microgrid with 2 inverters running in parallel to supply a single load. I want to use droop control so I can then adjust the power sharing between them.
I am struggling to get 2 inverters to synchronise. I can get them to supply the same voltage, but the currents work against each other in the load.
What I have tried:
1. Grid forming and Grid feeding. When I add the Grid feeding inverter, I can not control the voltage that it injects the current at. If I give it it a Reactive power reference, it will inject current into the grid at that power level, it doesn't regulate the voltage. Therefore, it pushes the voltage of the load up I get instability in the system.
2. Grid supporting Voltage x 2. I have tried to put 2 Grid supporting Voltage sources in parallel. The problem here, is that if each inverter supplies a different power, this then adjusts the frequency that is injects its power into the grid and the miss match between the two frequencies of the inverters causes instability.
3. Grid supporting Voltage and Grid supporting Current. This has the same issue as point number 1. As there is no way to pin the voltage to anything, it is simply a current source that cant control the voltage it injects at. This causes instability in the microgrid I created.
Am I doing something wrong ?
The following paper has exactly what I am trying to achieve, but I get different results:
Does anyone have a Simulink model of 2 parallel inverters supplying a load in islanded mode?
Attached is the model of the Grid Supporting Voltage inverters in parallel that I have been working on. You can see that the currents of each inverter are working against each other.
Thank you
Relevant answer
Answer
Synchronization is to agree in time. So, in order to synchronize multiple sources such as the power inverters you have to choose the strongest one as the reference synchronization source. This source is better to be referenced to a crystal controlled oscillator for high stability.
Then every other inverter is to be synchronized by the reference taken from the microgrid as I proposed in the first part of my answer.
This means the local oscillator of the inverter must be synchronized to the reference by means of phase locked loop.
In summary my proposal is to take the strongest power fed to the grid is to be taken as a reference for all other source fed to the grid.
To synchronize any inverter to the grid please refer to the papers in the links:
Best wishes
  • asked a question related to MATLAB Simulation
Question
4 answers
Hi,
I am currently working on my PhD in Control Engineering. I have run into a brick wall and it has consumed months of my time. I understand the following:
There are 4 types of configurations for a power converter:
Grid Forming
Grid Supporting Current
Grid Supporting Voltage
Grid Feeding
I am using the following paper to try and establish a microgrid of parallel converter:
1. When I establish a Grid Forming power converter, I set the w and v of the grid. I am then using a second Grid Supporting Current power converter, but the voltage of the grid become unstable. I have read in other threads that Grid Forming power converters cannot run in parallel with any other converters. I assume this is why this started.
2. I then try to establish 2 Grid Supporting Current power converters to run in parallel with each other. However, there doesn't really seem to be a way that I can synchronise them. I can get them to run when the power on the droop controller is the same, therefore the w are both the same and they synchronise. I tried to switch one of them for a Grid Feeding power converter, again this did the same as in part 1, it adjusted the voltage and it became unstable.
3. All of the models I have come across take the inner current loop voltage readers before the Capacitor but after the Inductor, as in the paper mentioned above. However, Simulink gives me an error about zero crossings, when I override it the AC output has major distortion in it.
How can I create a Simulink model with two parallel converters to run together ?
My goal is to create two or more parallel converters providing a single load so that I can create a controller that provides stability under actuator attacks.
The other papers I have based this off are:
You can see from these articles that the current reading is taken before the capacitor bank.
Relevant answer
Answer
Dear Sandford:
You can benefit from this valuable Link about your topic:
I hope it will be helpful...
Best regards....
  • asked a question related to MATLAB Simulation
Question
6 answers
Does anyone know if I can connect the attached DAQ (CASSY type) to MATLAB real time simulink for controlling purposes?
Relevant answer
Answer
It depends on your sample frequency, which is limited for performance of DAQ. another issue should be concerned is the number analog of a processing control system. the quality of data will be bad or real-time data might be good if you collect as much data in process as possible.
  • asked a question related to MATLAB Simulation
Question
1 answer
How can I have water-LiBr mixture properties in MATLAB library?
Relevant answer
Answer
One possibility would be to link Matlab with Refprop. More information can be found in the following sources:
GitHub - jowr/librefprop.so: Create a shared library from the Fortran sources provided by Refprop from NIST. This project provides an alternative to the refprop.dll that comes with the software. Please use the official instructions if possible
  • asked a question related to MATLAB Simulation
Question
4 answers
I would like to compare my algorithm (the improved LPA) with Louvain, infomap and CNM (fast greedy) algorithms (available in Mat lab toolbox community) that has been implemented on LFR dataset.
I confronted with a problem when I cannot use the outputs of the algorithms for NMI criteria.
I will gratitude everyone could guide me about the matter!
Relevant answer
Answer
please provide me the complete solution of your problem . i am also stuck solving the same problem.
  • asked a question related to MATLAB Simulation
Question
1 answer
I am currently working on a project that requires the prediction of the oblique shear angle for an oblique cutting. The numerical iteration should continue until the chip flow angle converges within 10^-14
Relevant answer
Answer
I need too. If you got the answer, could you please to share to me?
  • asked a question related to MATLAB Simulation
Question
5 answers
I'm working on Greenhouse Climate control Using the Fuzzy Logic Controller, so I'm searching for the mathematic model of Greenhouse structure, and the heater, cooler, and humifier transfer functions .
Relevant answer
Answer
I hope that the following 5 papers are interesting
1-SE—Structures and Environment: A Strategy for Greenhouse Climate Control, Part I: Model Development
M. Trigui, S. Barrington, L. Gauthier
Journal:
Journal of Agricultural Engineering Research
Year:
2001
2-Review of Structural and Functional Characteristics of Greenhouses in European Union Countries: Part I, Design Requirements
B. von Elsner, D. Briassoulis, D. Waaijenberg, A. Mistriotis, Chr. von Zabeltitz, J. Gratraud, G. Russo, R. Suay-Cortes
Journal:
Journal of Agricultural Engineering Research
Year:
2000
3-Assessment of the greenhouse climate with a new packed-bed solar air heater at night, in Tunisia
Bouadila, Salwa, Lazaar, Mariem, Skouri, Safa, Kooli, Sami, Farhat, Abdelhamid
Journal:
Renewable and Sustainable Energy Reviews
Year:
2014
4-Mass-Heater Supplemented Greenhouse Dryer for Post-Harvest Preservation in Developing Countries
P. Akinjiola, Olutoye, Balachandran, Uthamalingam (Balu)
Journal:
Journal of Sustainable Development
Year:
2012
5-Greenhouse heating by solar air heaters on the roof
Joudi, Khalid A., Farhan, Ammar A.
Journal:
Renewable Energy
Year:
2014
  • asked a question related to MATLAB Simulation
Question
3 answers
Hi
I intend to define a frequency domain objective function to design an optimal controller for Load-Frequency Control (LFC) of a power system. My purpose is to optimize this objective function (finding the proper location of zeros and poles) using meta-heuristic methods.
I will be happy if you share your valuable relevant and informative experiences, references and articles in this field including how to define and how to code.
Thanks
  • asked a question related to MATLAB Simulation
Question
1 answer
A multi-effect desalination–thermal vapor compression (MED–TVC) system consuming the waste heat from the gas power plant of the Sarcheshmeh Copper Complex is designed and optimized by a new approach that integrates two environments: a MATLAB simulator and macros for economic analysis. A heat recovery steam generator (HRSG) is used to supply the required heat for steam generation while harvesting the waste heat. The HRSG and MED–TVC systems are simulated using MATLAB, and their economic analysis is conducted using DEEP software. The gain output ratio (GOR) and the total annual cost of desalination are considered as the objective functions in a multi-objective optimization to achieve the highest GOR and the lowest total annual cost simultaneously. The multi-objective optimization is performed using nondominated sorting genetic algorithm-II (NSGA II). It is found that the heating steam temperature is more affected by the GOR than the other decision variables.
  • asked a question related to MATLAB Simulation
Question
1 answer
Hi everyone.
I have recently discovered an interest in digital communications, and stumbled upon a modulation technique called Media-Based Modulation (MBM) using RF mirrors. I have done some research on this, and would like to implement this in a SIMO wireless communication channel I designed in MATLAB. I am, however, struggling to get the correct result. I wish to generate the BER vs SNR curve, and investigate the error performance when compared to a regular SIMO system.
Here is my implementation so far:
----------------------------------------------------------------------------------------------------------------------------------------
%% simulate for number of receivers
figure,
Nr=2; % SIMO 1x2 System
%% Number of RF Mirrors
Mrf = 2; % 2 RF mirrors
Nm = 2^Mrf; % total number of Mirror Activation Patterns (MAPs)
%% Parameters
N=10^3; % Number of symbols to transmit
M=16; % QAM Modulation Order
%m = log2(M) + Mrf; %input bits from source?
k=log2(M);
snr=0:3:30; % signal to noise ratio
bit_errors = zeros(length(snr), 1); % <- Initialise BER vector
loop=10000; % Loop variable
%% Simulate over range of SNR
for i=1:length(snr) % Compute BER over SNR range
cur_bit_errors = zeros(loop, 1); % <- Initialise bit error vector
%% Monte Carlo loop
for l=1:loop % Simulation loop
% Input Signal
data=randi([0 M-1], Nm, N);
% Modulate Transmitted Signal
x=qammod(data, M, 'Gray');
% SIMO Freq.flat rayleigh fading channel with Media-Based
% Modulation - Nr x Nm channel fading matrix
% Theory says the MBM-transmit Unit chooses a fading vector h of
% size Nr x 1 from H based on the MAP selected.
H = (randn(Nr, Nm) + 1i*randn(Nr, Nm)) / sqrt(2);
% Multiply transmitted symbols with fading coefficients
% - Columns of h must to equal rows of x.
y1=H*x;
% add AWGN
y2=awgn(y1, snr(i));
% Effectively y=hx+n
% Maximum Receiver Ratio Combining
y3=H'*y2/norm(H)^2;
% ML Detection?
% According to Theory, must use exhaustive ML detection
%% Possible Code
%% for ii=1:M
%% for kk = 1:Nm
%% [dd xcap] = min(norm((y - h(kk)*x(ii)), 'fro')^2);
%% end
%% end
%% cur_bit_errors(l) = biterr(data, xcap);
% Demodulate Transmitted Signal
y4=qamdemod(y3, M, 'Gray');
cur_bit_errors(l)=biterr(data, y4); % Calculate Bit errors
end
bit_errors(i) = mean(cur_bit_errors)/(N*k); % <- Calculate mean BER
end
semilogy(snr, bit_errors, 'color', [rand rand rand]); % plot with logarithmic y-axis
axis([0 30 1e-5 1]); % Set axis dimensions
hold on;
grid on; % show a grid
xlabel('SNR [dB]'); ylabel('BER'); % label x- and y-axis
title('16QAM SIMO BER vs SNR');
legend('rx=2 SIMO-MBM');
------------------------------------------------------------------------------------------------------------------------------------------------------
The curve I am getting is a flat-line, which is obviously not correct. I was told by someone that the only change needed was that my rayleigh fading channel vector h needed to be a channel matrix of size Nr x Nm. However, this change produced a flat-line curve.
I have made some comments in my code to remember certain concepts learnt in MBM theory.
For example, the source supposedly provides an input vector of m = log2(M) + Mrf bits, where Mrf bits are used to select the Mirror Activation Pattern (MAP) index 'k' for the RF mirror selector, and log2(M) bits are used to select a Gray-coded MQAM symbol, 'x' subscript q, for example.
Secondly, the channel fading vector becomes a Nr x Nm channel fading matrix, where Nr is the number of receivers in the channel, and Nm=2^Mrf is the total number of MAPs available. According to theory, the MQAM symbol x is transmitted over a fading channel selected from the MBM-Transmit Unit MAP with a channel fade given by the NR × 1 vector 'h' in the presence of AWGN. In my implementation, I simply multiplied the channel matrix by 'x' as shown and made sure that the column length in 'H' was equal to the row length in 'x', however, I am not sure if this is correct or not.
Thirdly, for detection, theory says that ML detection must be used, where
[xcap kcap] = min(norm((y - h*x, 'fro')^2); q ∈ [1 : M], k ∈ [1 : Nm]
which is the frobenius norm squared of 'y' subtract the channel fading vector 'h', subscript 'k' raised to 'm' selected by the kth MAP multiplied by 'x' subscript q. For my SIMO system, I used the 'qamdemod' function, and the code ran and generated the BER vs SNR curves, however this may not be the correct implementation in this case, so any takes on this is appreciated.
I would really appreciate any help anyone can offer me in trying to introduce MBM into this system. This topic really piqued my interest, and I am eager to learn as much as I can about it.
  • asked a question related to MATLAB Simulation
Question
3 answers
I tried to reproduce the interband conductivity of Graphene using the Kubo formula using Matlab. but the result didn't match with my sourcebook. what is wrong with my Matlab code? the results are very small related to the book. The formula, Matlab code, my results, and the book results are attached. fd is equal to 1/(exp((eps-muc)/KbT)+1) and sig0=pi*e^2/(2*h) , e is electron charge, h is Planck constant. muc is fermi energy level and here is equal to 0.6 ev. in the last image, the imaginary part of the interband conductivity is shown with dashed line.
I have used numerical integration and I think the problem is occurred from there.
  • asked a question related to MATLAB Simulation
Question
3 answers
I) How do I measure common mode voltage in matlab simulation?
II) After knowing the value of the common mode voltage, how do I see the behavior of this voltage together with the stray capacitance generating the leakage current?
III) For example, with this circuit (a), where would I have to measure to get these graphs of common mode voltage and leakage current (b)?
Figures: M. N. H. Khan, M. Forouzesh, Y. P. Siwakoti, L. Li, T. Kerekes and F. Blaabjerg, "Transformerless Inverter Topologies for Single-Phase Photovoltaic Systems: A Comparative Review," in IEEE Journal of Emerging and Selected Topics in Power Electronics, vol. 8, no. 1, pp. 805-835, March 2020, doi: 10.1109/JESTPE.2019.2908672.
Relevant answer
Answer
In simulation take the average of the pole voltages.
  • asked a question related to MATLAB Simulation
Question
9 answers
Hello everyone,
I am having stability problems implementing anisotropic material in my FDTD code and I cannot find where I am doing it wrong. I'm trying to implement the code for anisotropy in the XY direction and have sigma-xy and sigma-yx as my off-diagonal elements in the electrical conductivity matrix. also, I attach a picture of the updating equation for Ex both in half-space and matrix form to understand how it updates the Ex. In the code, I calculate the fields caused by anisotropy in an auxiliary matrix where the anisotropic material exists and add that to the main updating equation. I also attach the portion of the code used for updating the Ex to give me your opinions about my approach. Any help or hint would be greatly appreciated.
By the way, I have checked the equations and the code for any flaws multiple times, but nothing was typed incorrectly and everything was fine concerning the possible mistakes in writing.
Relevant answer
Answer
Dear Amin Pishevar, you are welcome and thank you for informing us.
Best Regards.
  • asked a question related to MATLAB Simulation
Question
3 answers
Hi
How can i correct this error?? I think it's about matrix dimensions for port e.
Error in default port dimensions function of S-function 'FeedbackLinearization/Controller'. This function does not fully set the dimensions of output port 2
I'm running a simulation based on feedback linearization control method that comes from a paper attached below.
the model is also attached.
Anyone help me, helps a poor student. (if it makes sense lol)
Relevant answer
Answer
Hi,
file name "sfun_ abcaaaaa.c" is not available in the folder mentioned.
  • asked a question related to MATLAB Simulation
Question
4 answers
how to calculate number of computations and parameters of our customized deep learnig algorithm designed with MATLAB
Relevant answer
Answer
  • asked a question related to MATLAB Simulation
Question
10 answers
Hi. I'm doing a classification problem using deep learning. so that need to train 512x512 images but when i trained my algorithm shows out of memory error. I want to know how much memory size needed to train 512x512 images in MATLAB.
Relevant answer
Answer
Dear Srinivas:
For classification and regression tasks, you can train various types of neural networks using the trainNetwork function.
i.e. you can train:
-- a convolutional neural network (ConvNet, CNN) for image data.
-- a recurrent neural network (RNN) such as a long short-term memory (LSTM) or a gated recurrent unit (GRU) network for sequence and time-series data
-- a multilayer perceptron (MLP) network for numeric feature data.
You can train on either a CPU or a GPU. For image classification and image regression, you can train a single network in parallel using multiple GPUs or a local or remote parallel pool. Training on a GPU or in parallel requires Parallel Computing Toolbox™. To use a GPU for deep learning, you must also have a supported GPU device. For information on supported devices, see GPU Support by Release (Parallel Computing Toolbox). To specify training options, including options for the execution environment, use the trainingOptions function.
When training a neural network, you can specify the predictors and responses as a single input or in two separate inputs.
Thus, the entirety of this process depends mainly on the properties of these two hardware (cpu or Gpu).
I hope it will be helpful..
With my best wishes ...
  • asked a question related to MATLAB Simulation
Question
11 answers
Hello,
I am working on my research and looking for an IoT simulator environment or software to provide the following capabilities or provide integration to other tools to provide capabilities.
I have already looked at NS-3 briefly and NetSim.
- IoT network system with simulation of different IoT architecture such as Star or Mesh
- AI including Reinforcement learning capabilities
- Monitoring and capturing network activities/packets
- Cyberattack scenario simulation
- Possible 5G capabilities
Appreciate your help,
Thanks,
Anthony
Relevant answer
Answer
Dear Anthony:
I agree with all the answers given and recommend it, but i would like to add the following:
Here's a list of the best IoT testing and Simuling tools:
1- IoTIFY:
aims to ease the life of IoT developers and testers by providing simulation as a service. Their platform lets you define a virtual device and specify the connection endpoint, and they will handle the running and scaling the simulation as you need.
Protocols: MQTT, HTTP REST or CoAP.
Pricing: Contact IoTIFY directly for a quote.
2- BevyWise IoT Simulator:
helps you test your cloud and on-premise MQTT Application for functional and load testing. You will be able to simulate tens of thousands in a commodity server. You will be able to develop and test all aspects of your IoT devices from servers to MQTT devices.
Protocols: MQTT, REST.
3- MATLAB Simulink:
help you design and prototype IoT applications such as predictive maintenance, operations optimization, supervisory control, and more.
Protocols: REST, MQTT, and OPC UA.
4- IBM Watson IoT Platform (IBM Bluemix):
it's a solution of various IBM Cloud services. The IoT platform lets you collect and analyze relevant product performance and usage data for your IoT enabled assets.  There are also add-ons that can be added to the platform such as Blockchain or Platform Analytics.
Protocols: MQTT and HTTP REST.
5- NeoLoad:
It's a great straight out of the box option for mobile load testing and IoT use cases. You can quickly and efficiently create tests that accurately represent your real users regarding network conditions, specific devices, and geographic locations. You will be able to record any native or otherwise mobile app direct recording from any device or emulator.
6- IoT Performance Testing Tools
LoadRunner:
supports a wide range of apps. It helps you drastically reduce the amount of time and skill required to simulate user transactions in load testing software. And with integrations with a lot of different IDEs and support for testing scripts it allows for continuous testing. LoadRunner also helps you identify performance bottlenecks by using seamless integrated real-time performance monitors.
I prefer this one ....
7- LOCUST:
is an open-source load testing tool that uses Python code. Locust supports running load tests distributed over multiple machines this allows for the simulation of millions of devices and users. It’s a tried and tested option and being open source and uses python makes it very accessible.
I hope it will be helpful...
With my best wishes...
  • asked a question related to MATLAB Simulation
  • asked a question related to MATLAB Simulation
Question
10 answers
I want to carry out particle in cell simulation for Electron Cyclotron Resonance (ECR) plasma for the in-house developed reactor at our laboratory. Kindly share any freely available PIC code with instruction guidelines so that I could do the simulation. I am using windows platform. I don't have any information on how to do the simulation. So if there is any tutorial, also share that. Can it be done by MATLAB coding also?
Looking forward for your guidance.
  • asked a question related to MATLAB Simulation
Question
6 answers
Hi, I've been an experimentalist throughout my career and I want to add to my knowledge and expertise in Materials Science by delving into computation, modeling and simulation. However, I'm very confused about where to begin as it appears that field of modeling and simulation is quite vast and expansive. If I had to choose a starting material type, I'd say composites and modeling of failure modes of composites. Can anyone guide me on where to begin? I'm a complete novice when it comes to anything computational. Where do I begin, if I'm starting from scratch.
Relevant answer
Answer
  • asked a question related to MATLAB Simulation
Question
4 answers
The edges of the triangular elements(Delaunay triangulation) are springs. And the equation of motion at each nodal point is that of a damped SHM under application of a certain shearing force. I have a potential energy function for the system that needs to be minimised to attain the final equilibrium shape under the constraints of conserved surface area and volume. Kindly refer to the 4th chapter in the attached book (modelling of single RBC).
Relevant answer
Answer
Goodmorning Monika Dash , ladies and gentlemen, It would NOT be enough to create tiny equilateral triangles to achieve the mesh. Above all, it is necessary to find the optimum surface capable of taking up the spherical shape with the conditions of curvature or geodesic angles. First establish the calculations of the geodesic lengths, then the optimal traingular surfaces according to the size of the circumference of the sphere. We agree that there must be proportionality.
I think this way will make it easier for you to have the constant spring technique in the traingle. The choice of the nature of the triangle, equilateral, isosceles and rectangle must be justified according to their flexibility effiiency.
Maybe you have fixed this problem and you can conveniently share the solution for others who may find themselves in the same situation as you.
Good question! Thanks and good luck.
  • asked a question related to MATLAB Simulation
Question
5 answers
Hello
My colleagues and I intend to implement a real-time controller. So that a simple real first-order system is controlled by a controller designed in MATLAB/Simulink environment (Rapid Control Prototyping). We would be grateful if you could help with the following:
Is this possible with the help of dSPACE devices? And in that case, with what tools? For example, is the DS1202 MicroLab suitable by itself?
In general, what configuration is proposed for such a system in real-time modeling? (In the academic field)
We would also be grateful if you could suggest an example (project, article, book, schematics, etc.) in this regard. Unfortunately, with so much searching, most of what I found was just PWM generating for power electronic converters.
We are also interested in any advice and experience you have had in this field.
Thanks & Regards.
Relevant answer
Answer
You can easily implement the controller on TMS320F28335 microcontroller. You can see my video for more advanced controller design:
  • asked a question related to MATLAB Simulation
Question
4 answers
I have designed 17 level 3 phase CHB MLI. Giving THD less than 5% for R and RL load. But when I apply it to induction motor load, I can see a voltage spike (to max volt) near each zero crossing. ( For each phase voltage). Which increases THDv to 30%. What parameters of motor may contribute to this?
Relevant answer
Answer
Thanks all
  • asked a question related to MATLAB Simulation
Question
19 answers
I am involved in small project that involves houseload and renewbles like PV , energy storage system & electric vehicle connected to house ! The challenge is to optimize the the load and find the right time for the EV to charge using matlab simulation . what is the best optimization algorithms for such problems involving load and stuff ? Any reference papers SUGGESTING THE SAME would be appreciated .
Thanks !
Relevant answer
Answer
Generally, a well-developed meta-heuristic algorithm can be useful. You can start using numerical optimisation methods
Next test the performance of the below methods:
  • asked a question related to MATLAB Simulation
Question
6 answers
Hello. Can anybody help me about using iwgdx inorder to linking matlab and Gams. matlab give me the error : 'Undefined function for input argument of type 'char' '. I can use wgdx and rgdx but iwgdx and irgdx make error.
Relevant answer
Answer
Hi
You should add the Gams Path to your Matlab first.
Open Matlab >> Home tab >> Sep Path >> add folder
select your Gams path folder >>click Select folder >> Save.
done! for more info check this video
  • asked a question related to MATLAB Simulation
Question
5 answers
The problem is this: there is model of robot, created in Simscape. And knee of this robot is made of "pin-slot-joint", which allows one transnational and one rotational degree of freedom. In transnational motion, it is imposed the stiffness and damping factor, which gives influence also to rotational torque. My aim is to write optimization or control algorithm in such a way that this algorithm should provide such stiffness(in linear direction), which will reduce the rotational torque. By the way, rotational reference motion of knee is provided in advance(as input), and appropriate torque is computed inside of the joint by inverse dynamics. But to create such algorithm, I have no deep information about block dynamics, because block is provided by simscape, and the source code and other information is hidden. By having signals of input stiffness, input motion, and output torque, I need to optimize the torque.  I will be truly grateful if you suggest me something. (I tried to obtain equation, by using my knowledge in mechanics, but there are lots of details are needed such as the mass of the joint actuator, it's radius, the length of the spring and etc. AND I HAVE NO THIS INFORMATION.) If you suggest me something, I will be truly grateful.
Relevant answer
Answer
very interesting
  • asked a question related to MATLAB Simulation
Question
3 answers
I'v used some matlab functions (based on mfiles) in my simulink. In order to decrease simulink running time I want to replace these blocks with a new toolbox.
  • asked a question related to MATLAB Simulation
Question
4 answers
my project is power quality and harmonic analysis ubder balancee load conditions under 0-2 Khz.
i was asked to measure each harmonic up to 2 kHz at different power levels and THD. i made a multidrive system upto 20 drives using Dipde rectifier and nonlinear loads
Change the grid impedance (1%, 5% and 15% base impedance) and see the differences.
so what frequency should i take my source and grid impedance values?
What does upto 2khz mean??
Do i keep my source at 2 khz ?
Relevant answer
Answer
I concur with Abdallah Adawy
  • asked a question related to MATLAB Simulation
Question
7 answers
Base radius is the interface of the liquid and the solid surface. Contact angle is just the angle a droplet makes with the surface at the triple point.
Relevant answer
Answer
Hossein Safari I'm interested in it!
  • asked a question related to MATLAB Simulation
Question
2 answers
Hi , i am stuck in trying to change the orientation of the frames in simscape multibody. I am trying to specify motion to the joints in a constrained way for which i need the orientation of the frames of the follower and the base at the joints to be same. How should i proceed in achieving the task ?Any suggestions would be helpful .
Thank You.
Relevant answer
Answer
In my experience, doing that is difficult in general. If you only use rigid transforms (translations+rotations) all what you get is a different orientation/position of the object but not of the rotation axis. You have to be very careful using rigid transforms before/after a joint. They certainly affect motion. I have not found a single/simple rule to do it because all the joints-transforms blocks interact to each other. I recommend you to construct your system piece by piece verifying well behavior at each step. If you already constructed your system, you have to test step buy step. May be going backwards (remove/add transforms/joints) and observe what happens. I also created (simple) robotic hands (yours look better than mine : ) and I constructed a single finger first. Afterwards, I translated the other ones and at the end I rotated 90° the thumb. I have found out that rotations
with the structure BASE FRAME-FOLLOWER FRAME 1 AND 2 (double click on Joints blocks) is very useful. If you do not manage, use a prismatic union just to see where your axis are and the way your body moves, then you use a rotational joint and go on... I hope it helps (I could not find an answer for this in internet nor Matlab sites).
  • asked a question related to MATLAB Simulation
Question
11 answers
[Images are attached at bottom]
I am currently working on a buck converter controlled by two different control methods, Reinforcement learning applied to find PID values & a lead-lag compensator. The controllers are designed and perfectly fit the transfer function system but once applied to the circuit system things go astray.
As can be seen from the image below of the graphs (1) and (2) show to be outliers in comparison to there transfer function counterparts.
I do not know why the disparities are occurring since the transfer function system and circuit system are not far off one another. I can provide the proof of this if wanted. I can supply the Simulink file also if wished. Any help in the right direction is appreciated. I currently think integral windup may be taking place but I am not sure.
Thanks in advance
Relevant answer
Answer
It is difficult to answer, because I cannot see how the real buck converter is modelled. But several possible explanations are:
a) If the converter is non-synchronous (i.e. with a diode), than one problem could be that there could be a change in operation modes form DCM to CCM and vice versa during start up. The modelled transfer just describes CCM mode.
b) Another effect would be, that the transfer function modells are linearized small signal representations and therefore depend on the operating point. Therefore in the modelled transfer function the gain may be changing (as this depends on the steady state duty cycle).
c) If the circuit model has limiters (e.g. maximum duty cycle reached or a current limit is implemented) than the real model response will deviate from the ideal transfer function characteristic. E.g. if your duty cycle signal command signal d increases to valus d>1, than in the real buck converter the value will be limited to d=1 and this will show a delayed startup (as your pictures indicate). In contrast the "ideal" transfer function model without limits will not see any problem with unrealistic d>1 (or even d<0). Transfer function models without limiters can shown severe deviations from reality, especially during large signal transients.
Therefore, I think you should check:
a) that the value of the control variable d (duty cycle) will be in the range 0<d<1 (and eventually limit it to this range)
b) not test a startup transient, but a small signal step in steady state (e.g. small transient) to test your controllers.
  • asked a question related to MATLAB Simulation
Question
4 answers
HELLO GUYS, I am trying to simulate Matlab 2013a Simulink model with Psim 12.0.4 demo version on Windows 10 using Simcoupler module. When I run this model, I get the following error:
Errors: -->> Error Evaluating 'OpenFcn' callback of S-function block (mask) 'PSimModel/SimCoupler'. -->> Undefined function "PSimDialog' for input arguments of type 'char'.
Any solution for this problem? Thanks in advance.
Relevant answer
Answer
Problem solved Thanks @Marcel Nicola