メインコンテンツ

結果:


Enez Furkan Cihan
Enez Furkan Cihan
最後のアクティビティ: 2019 年 7 月 20 日

I'm working on a simulink design, using MATLAB function. By the benefit of the MATLAB function, I got 1x10 array of which values are like [1 0 0 1 0 0 1 0 0 0], I want these values to be sent to the MOSFET's gate sequentially. I thought it would have been done with 'For loop' to send it sequentially but I found out that's not possible since it's just sensed the latest column's value so that I just saw 0 in my scope. Any idea how to do it properly? Below you can see the simulink design.

gina_et_berg
gina_et_berg
最後のアクティビティ: 2019 年 7 月 16 日

Hello: your help is greatly appreciated, I am trying to solve the following pde numerically with ode45 (if possible). There are three equations in total. I keep getting an error. know parameters: v, D(j), KL(j), cs(j) The IC and BC are provided in the m.file. pde:

    % code
% Initial, final values of independent variable
tspan = [0 7];
P=1, F2=2, F3=3;
c_initial_1= zeros(N+1,1);
c_initial_2= zeros(N+1,1);
c_initial_3= zeros(N+1,1)
if t == 0
c_initial_2(1,2) = cs(2)
c_initial_3(1,3) = cs(3)
c_initial_1(1,1) = cinj
end
  [t, c, kF2, kF3, kP, n2, m2, n3, m3, q, r] = ode45(@ode, tspan, c_initial_1,c_initial_2, c_initial_3);
function [dcdt] = ode(t, c, k2, k3, kP, n2, m2, n3, m3, q, r)
global N dx dxs
dcdt = zeros(N,N)
for i = 1:N
    for j = P:F3 % j== 1:3 1=persulfate, 2 Fraction 2, and 3 Fraction 3
        if j == 1
            epsilon = 1
        else 
            epsilon = 0
        end 
        dcdt(i, j) = (-v/(2*dx))*(c(i+1,j)-c(i-1,j))+(D(j)/dxs)*(c(i+1,j)...
            -2*c(i,j)-c(i-1,j))+(1-epsilon)*kL(j)*(cs(j)-c(i,j))- ...
            (1-epsilon)*k(j)*(c(i,j)^n(j)*(c(i,1)^m(j))- ...
            epsilon*kP*(c(i,j+epsilon)+c(i,j+2*epsilon))^q *c(i,1)^r
        dcdt(N+2,j) = dcdt(N-1,j)
        dcdt(0,j) = dcdt(2,j)
        if t == 0
            dcdt(1,P) = cinj 
        end
    end
end
end
end

dc(i,j)/dt=-v*(dc(i,j)/dx)+D(j)*d/dx(dc(i,j)/dx)+(1-epsilon)*kL(j)*(cs(j)-c(i,j))+(1-epsilon)*k(j)*c(i,j)^n(j) * c(i,1)^m(j) + epsilon*kp*[c(i,j+epsilon)+c(i,j+2*epsilon)]^r * c(i,1)^q

Jacky Wong
Jacky Wong
最後のアクティビティ: 2019 年 7 月 19 日

Good day everyone,

I'm trying to simulate a single phase transformator by using Simulink. I've got the current values: R1 = 3 Ohm R2 = 0.03 Ohm X1 = 6.5 Ohm X2 = 0.07 Ohm Rc = 100k Ohm Xm = 15k Ohm f = 60 Hz Uprim = 2400V Usec = 240V S = 29kVA cos Phi = 0.8

And I've made the current calculations: L1 = X1/2*pi*f = 17,24 mH L2 = X2/2*pi*f = 185.68 uH Lm = Xm/2*pi*f = 39.79 H S = Urms*Irms => Irms = 120.83 A P = Urms*Irms*cos Phi = 23200 W Q = Urms*Irms*sin Phi = 17400 VAr Q>0 so Q = ohms-inductive => QL = 17400, QC = 0

I've made the current circuit and simulated it, but somehow my secondairy output voltage is only at 225Vrms. Can someone explain to me why that's the case? Did do something wrong in my calculations or in my simulation?

Mohammad Tauquir Iqbal
Mohammad Tauquir Iqbal
最後のアクティビティ: 2019 年 7 月 27 日

i am confused about how to run as a closed loop. how to do closed-loop control of phase shift using matlab. i am using c2000 embedded by Matlab.

DINGUI Kacou Franck-Daniel
DINGUI Kacou Franck-Daniel
最後のアクティビティ: 2019 年 6 月 6 日

Bonjour A tous,

Je vous écris pour solliciter votre aide si possible. Je travaille en ce moment sur un projet qui consiste a un traitement d'image.

J'utilise une camera thermique associée a une logiciel. Avec ce logiciel, j'enregistre une film de 4 secondes. En gros j'ai une vidéo constituée de 100 images.

Une image comprend 90 pixels donc les valeurs de ces pixels sont reparties en sous forme matricielle (10x9). Ce qui fait que pour les 100 images, j'ai 100 matrices.

L’idée c'est d'avoir une image moyenne donc une moyenne des 100 matrices.

Le problème c'est que je fais le traitement avec ce logiciel. Pour la suite des travaux j'utilise matlab.

J'ai donc besoin de créer un programme sous matlab qui me permet de lire le fichier recueilli par ce logiciel de traitement d'image en me refaisant sortir de façon automatique une moyenne de ces 100 matrices.

Je vous joins en copie un exemple de ce fichier.

J'ai donc besoin de piste pour le programmer.

Je vous remercie d'avance.

Bien cordialement,

Hi, In my circuit, I have an element for which I don't have its equivalent circuit. What I have is a lookup table of its frequency response (magnitude and phase), which is complicated and cannot be represented by a lumped parameters equivalent circuit, and also some of its elements are frequency-dependent. Even if I do obtain somehow its transfer function Laplace representation (using e.g. "System identification" toolbox, and I want to add it to my circuit simulation (Simscape Electrical) as a block.

Does anyone have an idea how to do it? Thank you!

We've been hearing from more and more customers who are interested in using Xilinx's new Zynq UltraScale+ devices in power electronics control applications. The attraction appears to be the dual-core ARM Cortex-R5 processors, which are well suited to hard real time applications. Are you looking at Zynq UltraScale+ MPSoCs as a platform for power electronics control? If so, we'd love to hear from you as we look at support for these devices.

In the meantime, MathWorks offers a reference design example for FOC motor control on Zynq-7000 devices that many customers have used as a basis for developing Simulink models for C and HDL code generation.

Hi guys could u guys please help me explain what is happening on this 3 graphs. I am an electrical student and just to be honest i am not a smart student but I'm willing to learn. Please do help me.Ive got my simulation i managed to generate perfect sin wave but i just couldn't explain on the graphs i simulated.

Tony Lennon
Tony Lennon
最後のアクティビティ: 2019 年 6 月 20 日

With the need for higher sampling frequencies, power electronics control engineers are moving some of their controller implementations to FPGAs or FPGA-based SoCs. Besides the use of wide-band gap semiconductors (GaN and SiC), what other reasons are driving the need for higher controller sampling frequencies? Let us know your thoughts.

If you have not seen this yet, in Release 2018b we added several examples to Simulink Control Design that show how to use this product to tune the gains of field-oriented controllers.

The first two examples make use of Closed-Loop PID Autotuner block . We show how to use this block to tune multiple loops in the motor control system, one loop at a time.

One of the examples shows tuning the controller gains for a PMSM:

Tune Field-Oriented Controllers Using Closed-Loop PID Autotuner Block

The other example shows how to tune four loops for an asynchronous machine (inductance motor):

Tune Field-Oriented Controllers for an Asynchronous Machine Using Closed-Loop PID Autotuner Block

This approach works well when you have initial gains that provide stable response, and you want to fine tune the controller to improve performance.

What do you do when you start with a new design and need to design your controller from scratch? That is what the third example is showing. Here we design all 3 loops (id, iq, speed) for a PMSM by running an AC sweep to compute a frequency response, then identifying a state-space model using System Identification Toolbox, and finally tuning all 3 loops simultaneously to provide desired performance.

Check it out here:

Tune Field-Oriented Controllers Using SYSTUNE

What do you think about these examples?

Share your opinion.

Arkadiy

Dear MATLAB community,
How can I help my close friend who's bad at math and programming learn MATLAB?
He's a final year chemical engineering student who struggles even to plot two functions on the same graph in his computational fluid dynamics class (there was no prereq for matlab skills).
In his first year, I saw him get dragged through the introductory engineering classes which was his first encounter with MATLAB. Students were taught a few rudimentary programming skills and then were expected to make a code for a 'simple' tic-tac-toe game. It took him hours of blank looks and tutoring to even understand the simplest of boolean operators. He was never able to write a working function without the supervision of a friend or tutor. Needless to say, he was permanently scarred by the experience and swore to avoid using it forever.
After 3 years of avoiding MATLAB, he realised how not knowing it hurt him during his final year project. He had to solve a system of pdes to model the performance of a reactor and practically speaking, MATLAB was the most suitable software at hand. He ended up having to get a friend to help him code the equations in while also having to oversimplify his model.
The weird thing is that: most students from his chemical engineering faculty were not expected or encouraged to use MATLAB, almost all of their prior assignments required no use of MATLAB except that infamous first year course, and most of his peers also avoided using MATLAB and resorted to Excel. It is my understanding that Excel cannot match MATLAB's efficiency and clarity when solving calculus problems so it was not uncommon to see extremely long Excel spreadsheets.
Anyway, my friend is, with the help of a friend's past year MATLAB codes, trying to finish up his computational fluid dynamics assignment that's due soon. He finishes university in 2 weeks time.
Even though he knows that not every engineer has to use MATLAB in the workplace, he somehow wishes he was able to learn MATLAB at his glacial pace. I find it such a pity that he was never able to keep up with the pace of learning that was expected which begs the question: are students who are too slow at learning programming better of in a different field of study?
If you've managed to read to the end of this, thank you so much. I just don't know how to help my friend and I'm hoping some of you might be able to suggest how I can help him be better at it. I believe he has potential but needs special help when it comes to MATLAB.
All helpful and constructive suggestions considered,
Thank You All
Axel Nordin Fürdös
Axel Nordin Fürdös
最後のアクティビティ: 2020 年 12 月 26 日

Hi there! This is kind of an unusual question, but here it goes. I am a big time Matlab enthusiast and I met some of your representatives at Formula Student Germany back in August. There was a booth were your product was showcased but most importantly there was Matlab merchandise such as stickers, rub-on-tattoos and pens with the mathworks logo being handed out. This merchandise is increadibly popular with me and my nerdy friends. But sadly I didnt bring much with me from the event. Is it possible to get ahold some of it? Is it for sale? Are you willing to sponsor some geeky engineering students?

I am new in MATLAB programming. I want to learn matlab . I want to know about is any matlab or simulink contest available. Please answer me. Thanks
Summary:
Dynamically accessing variable names can negatively impact the readability of your code and can cause it to run slower by preventing MATLAB from optimizing it as well as it could if you used alternate techniques. The most common alternative is to use simple and efficient indexing.
Explanation:
Sometimes beginners (and some self-taught professors) think it would be a good idea to dynamically create or access variable names, the variables are often named something like these:
  • matrix1, matrix2, matrix3, matrix4, ...
  • test_20kmh, test_50kmh, test_80kmh, ...
  • nameA, nameB, nameC, nameD,...
Good reasons why dynamic variable names should be avoided:
There are much better alternatives to accessing dynamic variable names:
Note that avoiding eval (and assignin, etc.) is not some esoteric MATLAB restriction, it also applies to many other programming languages as well:
MATLAB Documentation:
If you are not interested in reading the answers below then at least read MATLAB's own documentation on this topic Alternatives to the eval Function, which states "A frequent use of the eval function is to create sets of variables such as A1, A2, ..., An, but this approach does not use the array processing power of MATLAB and is not recommended. The preferred method is to store related data in a single array." Data in a single array can be accessed very efficiently using indexing.
Note that all of these problems and disadvantages also apply to functions load (without an output variable), assignin, evalin, and evalc, and the MATLAB documentation explicitly recommends to "Avoid functions such as eval, evalc, evalin, and feval(fname)".
The official MATLAB blogs explain why eval should be avoided, the better alternatives to eval, and clearly recommend against magically creating variables. Using eval comes out at position number one on this list of Top 10 MATLAB Code Practices That Make Me Cry. Experienced MATLAB users recommend avoiding using eval for trivial code, and have written extensively on this topic.
Matt Tearle
Matt Tearle
最後のアクティビティ: 2023 年 3 月 6 日

Inspired by Chad Greene's " MATLAB jokes or puns " thread, and in celebration of 15 years of the MathWorks Community site, does anyone out there want to share their poetic creativity? Limericks, haiku, sonnets... Go!
And to start off, my (slightly off-topic) submission on Chad's thread:
There was an old math guy called Cleve
who, while teaching, a pipe-dream conceived:
of a language so clean
you can say what you mean!
From our suffering we've all been relieved.
The community is very helpful, yet I feel really powerless that I cannot find the appropriate way to code, nor find the problems with the codes I have written. I have read numerous books on MATLAB, mostly related with science and engineering applications. Any advice to improve would be greatly appreciated. Thanks.
Chad Greene
Chad Greene
最後のアクティビティ: 2023 年 9 月 12 日

Are there any good Matlab jokes? I don't mean why or any other Easter eggs, I mean good jokes involving Matlab. Actually, that bar may be a bit too high. Any jokes, good or bad, let's hear 'em.
Jan
Jan
最後のアクティビティ: 2013 年 8 月 9 日

Some of Matlab's toolbox functions are affected by magic strings or magic numbers, which are strings or numbers with a deeper meaning besides the normal value. Both are considered as bad programming patters, because they provoke confusions, when the magic keys appear with the normal meaning by accident. See http://en.wikipedia.org/wiki/Anti-pattern
Example 1:
clear('myVariable')
clear('variables')
While the 1st clears the variable myVariable, the later clears all variables. Here 'variables' has a meta-meaning. The problem appears, when 'variables' is an existing variable:
a = 1;
variables = 2;
clear('variables')
disp(a) % >> 1
Only variables is cleared, which cannot be understood directly when its definition is 1000 lines before.
Example 2:
uicontrol('String', 'default')
This creates a button with the empty string '' instead of the expected 'default', because this is the magic string to invoke the default value get(0, 'DefaultUIControlString'). The same concerns properties of other graphic objects also, e.g. the 'name' property of figure or the string of uimenu. There is a workaround which allows the user to display 'default': Simply use '\default'. Unfortunately this is doubled magic, because in consequence it is impossible to display the string '\default'. Obviously a bad idea.
Example 3:
Graphic handles are doubles (although gobject of the new R2013a seems, like this is subject to changes? [EDITED: Yes, it changed with HG2 in R2014a]). But then a handle can be confused with data:
a = axes; % e.g. 0.0048828125
plot(a, 2, '+')
But you cannot draw the point [0.0048828125, 2] by this way, because the 1st input is considered as handle of the parent. Here all possible values of handles are magic. Collisions are very unlikely, but there is no way to avoid them reliably - as long as handles have the type double.
Question:
Which functions are concerned by magic values? What are the pitfalls and workarounds?
Laila
Laila
最後のアクティビティ: 2024 年 2 月 27 日

How do I can delete my account?