主要内容

搜索


When solving problems over on Cody, I can almost always view all solutions to a problem after submitting a correct solution of my own. Very rarely, however, this is not the case, and I instead get the following message:
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
You may solve another problem from Community group to unlock all the solutions to this problem.
If this happens, then again, I can almost always rectify this by submitting a (correct) solution to a different problem (I take it that the Community group is the implicit group of all problems on Cody --- is it?). But sometimes that, too, fails.
So my question is, why? What are the criteria that determine when all solutions are, in fact, unlocked?
(There is a related question here, but I feel the posted answer does not answer the question.)
Simple question: I noticed there's a Modeling & Simulation Challenge Master badge over on Cody, but I can't find the corresponding group. So: where is it? Does it still exist at all?
Hi, having problems with this model. Tried changing all the capacitor values without any success. Any help/suggestions would be most welcome.
There are two kinds of text data type (=string data type) in MATLAB:
Text1='aText'; % first one
Text2="aText"; % first one
The second one did not exist in "old" MATLAB versions but the first one only.
My questions are: 1) What was motivation of MathWorks programmers to introduce the Text Data Type of the second format?
Yes, I know the difference: length(Text1)=5 whilst length(Text2)=1; Text1(2)='T' but Text2(2) does not exist. The array Text3=['one' ; 'fifth'] does not exist too.
2) However, any explanations and recommendations how to apply the second sort in contrast to the first one?
3) Is there any way how to convert one sort to another one?
Thanks for explanation in advance!
Error: The server timed out while running and assessing your solution in MATLAB CODY. How do I resolve this? My code is correct. I have run it on PC. But, when i submit in CODY the server throws an error.
Hello,
I am trying to do image to image regression neural network training. In place of digitTrain4DArrayData, I have used my own dataset of 500 input and 500 output grayscale images of size 100*100 pixels for training.
The code is as follows:
imds1 = datastore(fullfile(matlabdrive,"T10itTI"),"IncludeSubFolders",true,...
"FileExtensions",".png","type","image");
imds2 = datastore(fullfile(matlabdrive,"TFiSTI"),"IncludeSubFolders",true,...
"FileExtensions",".png","type","image");
dsnew = combine(imds1,imds2);
layers = [
imageInputLayer([100 100 1])
batchNormalizationLayer
reluLayer('Name','relu_1')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_2')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_3')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_4')
convolution2dLayer(1,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_5')
convolution2dLayer(3,1,'Stride',2)
batchNormalizationLayer
reluLayer('Name','relu_6')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_7')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_8')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_9')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_10')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_11')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_12')
convolution2dLayer(1,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_13')
transposedConv2dLayer(1,1,'Stride',2)
batchNormalizationLayer
reluLayer('Name','relu_14')
convolution2dLayer(1,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_15')
convolution2dLayer(1,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_16')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_17')
convolution2dLayer(1,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_18')
transposedConv2dLayer(3,1,'Stride',2)
fullyConnectedLayer(1)
regressionLayer
]
lgraph = layerGraph(layers);
options = trainingOptions("adam", ...
InitialLearnRate=8e-3, ...
SquaredGradientDecayFactor=0.99, ...
MaxEpochs=20, ...
MiniBatchSize=64, ...
Plots="training-progress")
net=trainNetwork(dsnew, lgraph, options);
On running the code, I get following error:
Error using trainNetwork Invalid training data. The output size ([1 1 1]) of the last layer does not match the response size ([1 1 1972224]).
When I use fullyConnectedLayer(1972224) in place of fullyConnectedLayer(1), I get following error:
Error using trainNetwork Layer 'fc': Invalid initializer. Requested 1972224x17161 (252.2GB) array exceeds maximum array size preference (5.0GB). This might cause MATLAB to become unresponsive.
Error in mt1tt1 (line 95) net=trainNetwork(dsnew, lgraph, options);
Caused by: Error using nnet.internal.cnn.assembler.InitializeMixin/initializeLearnableParameters Layer 'fc': Invalid initializer. Requested 1972224x17161 (252.2GB) array exceeds maximum array size preference (5.0GB). This might cause MATLAB to become unresponsive.
Can you suggest correction in code?
Thankyou
Hi Fellow Users,
I am Muthuserpi From A begginer of Optics studio Please anyone help me how to add two diffeaction reflective grating and How to tilt and decenter in matlab simulation
Thanks And Regards
S.Muthuserpi
Just in case, I have my license of MATLAB. I just have this question and I didn't find any information. I wouldn't like to create another account, for this reason I prefer to ask here.
Hello Community,
For E vehicle application to control the speed and torque of PMSM motor I am implementing FOC algorithm. We know that to arrive at Speed set point we have speed control loop which is outer loop, Further PI CONTROLLER of speed loop will give reference for Iq current which regulates the current using current loop. My question is 1.How to arrive at Torque set point?
2. Is speed control using FOC is enough or we should implement Torque control algorithm also?
3. should we have speed mode and Torque mode selection in case of constant speed requirement during cruise mode and high torque requirement during uphill situation respectively
4. To arrive at Torque set point what is the relation or transfer function to tune PI controller for Torque loop?
Please give your valuable inputs and answers, thanks in advance
Hello Academia,
I've been trying to get information regarding these configuraitons in a 3 phase transformer. The first is a dual secondary consisting of a wye output and delta output. Both feed separate 3 phase bridges, which outputs are connected in parallel.
The second is a Wye output, which each leg feeds 3 more series windings, which are located on the adjacent core (phase shifted) on the same transformer, with only one 3 phase bridge for the output
I see there is a zigzag simulink but can't seem to get that loaded...
My question is, are these essentially identical in operation, or is the dual secondary what I should be using? (due to better harmonic rejection)
Thanks,
Bryan
Hello,
I am designing a battery model and its control to undergo cyclic charge and discharge.
The battery model is created by using a simscape electrical battery block (Table-based).
The control is modeled using Stateflow. The statflow chart takes SOC values as inputs and provide current values as outputs. By default, the battery will be at rest and no current is drawn at that state (I=0A). And then based on the SOC % of the battery, it goes to charge (3A current) or discharge (-3A current) state. I have defined the controls as follows.
  • If the battery has SOC >= 50%, it has to discharge. If the battery has SOC < 50%, it has to charge.
  • While discharging, if the battery reaches 0% SOC, it goes to rest.
  • While charging, if the battery reaches 100% SOC, it goes to rest.
I have defined initial SOC as 50%.
When I run the simulation, the battery started to discharge as per the condition provided in the stateflow chart.
I = -3
But the battery has not come to rest state after reaching 0% S0C.
I am getting a warning that,
At time 1944.017100, one or more assertions are triggered. State of charge must be greater than or equal to zero. The assertion comes from: Block path: Example_cell_model/Battery (Table-Based)1Assert location: o (location information is protected)
I don't understand why the battery has not came back to rest state.
Do anyone has any idea for the cause of this problem and how to resolve it?
Thanks in advance.
I need to model temperature rise of a resistor due to joule heating with a variable supply or a variable resistor. Is there a simulink component that can be used for this or it has to be implemented with the physical equations fed into block diagrams?
Can someone help give an idea of how this can be modeled?
I'm trying to simulate EV drive system using FEM PMSM and IGBT block of simscape electrical.
The simulation results (magnitude of the current in time domain) is quite similar with the experimental results.
But in frequency domain analysis using FFT (fast fourier transform), amplitude of current harmonics(specially 5, 7 th of fundamental frequency) are way to different.
Is there any way that I could increase my simulation accuracy?
I am trying to simulate a single phase H-bridge inverter connected to a load in Simulink using Simscape Electrical (blue wire). The simulation does not work. I tested the same circuit (with black wire). And everything works fine. I looked hard, I can't see any reason. Does anyone know why or have any examples?
You can find the simulation files in the attachment.
My goal with this is to start with a basic inverter scheme before testing multilevel converters. I had started with that but I had problems from the beginning...
Thanks in advance

hello can some body help me regarding designing a project in simulink to estimate the state of health of a battery ?... including kalman filter .... at least i need the battery cell equivalent circuit in simulink and the idea of the estimation method

many thanks

I am trying to simulate a 3 phase induction motor on Simulink by using its dynamic model. This is the information in its datasheet:
It also has 4 poles and J = 0.0117 kgm², star connection. After calculate parameters, I get these values:
Lm = 0.176 H; Rr=Rs = 0.613Ω; Llr=Lls = 0.00669 H.
Also in the datasheet, they said that the output torque = 705 Nm at speed 35 rpm, but the model cannot reach that value. The simulation motor run backward if applied torque greater than 70 Nm ( at about 1200 rpm). But in reality, this motor can withstand 705 Nm, I have seen it run.
Can someone help me with this problem? Thank you
Hi,
I have two DGs and I want a secondary control between these two DGs using mpc toolbox. I don't know where I am going wrong with it. it is not working. when I am trying to change the load the frequency is still the same. Can anyone please help?
Thanks
Hullo Everyone. I have published a video on the MathWorks YouTube channel that explains active, reactive and apparent power. It is less than 9 minutes and so can be viewed over a coffee break. Here's the link https://www.youtube.com/watch?v=DCUwK6AfzcM
Hi,
I am using matlab fuction block to calculate duty ratio for a MOSFET . How do I incorporate time delay in the calculated duty cycle. Duty cycle of S3 should be delayed by d1 in the picture.Kindly help

I have a datasheet of an induction motor (as figure below). I want to simulate it on matlab/simulink, but I don't know it's parameters (Lls, Llr, Lm, Rr, Rs).

I tried to search about open circuit test and blocked rotor test to determine these parameters, but some of information doesn't appear on datasheet and I don't have the real motor to test on it (datasheet is only think I have).

Could someone help me with this?