Hello, can someone please help me understand this error?

I'm particularly confused about the part which says '... and the phase delay parameters of this block need to be integer multiples of the fixed step size.

 Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 25 Sep. 2023
Bearbeitet: Fangjun Jiang am 25 Sep. 2023
If the pulse width is 87.85%, then the gap of the pulses will be 12.15%. Then you have to be able to distinguish at least 0.05% of the period to be able to make the 87.85% pulse and the 12.15% gap.
0.05% of the period (5e-7) is 2.5e-10, the number in the error message.
In other words, the simulation program has to be able to increase the simulation time every 2.5e-10 to be able to make the pulse. Your simulation step size (0.2) is way more bigger than that. Changing the simulation step size to be 2.5e-10 will fix the problem.
Feeding the Pulse Generator to the control port of the Multiport Switch block doesn't make sense. The value of the control port should be 1, or 2, or 3, to pass the 1st, or the 2nd, or the 3rd input, just like the icon of the block indicates.
Constant value [0.3:0.4] or [0.4:1.2] or [1.2:2] don't make sense either.
[0.3:0.4]
ans = 0.3000
[0.4:1.2]
ans = 0.4000
[1.2:2]
ans = 1.2000

10 Kommentare

How can I determine the gap between the pulses?
I'm trying to create an input selector with three inputs. I thought I'd use constant blocks with specific input source ranges, such as [0.3:0.4] for TEG, [0.4:1.2] for PV, or [1.2:2] for PZT. Can you suggest ways to correct this?
Fangjun Jiang
Fangjun Jiang am 26 Sep. 2023
Bearbeitet: Fangjun Jiang am 26 Sep. 2023
I am not clear what you are trying to do. Is there only "one" input which ranges from 0.3 to 2? You can use a Lookup Table block to generate an output which value is 1 or 2 or 3, then use this output to control a Switch.
Danikha Shyken
Danikha Shyken am 26 Sep. 2023
Bearbeitet: Danikha Shyken am 26 Sep. 2023
No, we have three input sources. TEG source is from 0.3 to 0.4V, PV source is from 0.4 to 1.2V, and PZT source is from 1.2-2V; with a 1.8V battery. The available voltage sources among the three will be used to power up a buck-boost converter.
If the available source is TEG, the system will operate in boost mode; if the available source is PV, then the system will operate in boost mode, and the system will operate in buck mode if PZT is available. Battery is selected when all three sources aren't available.
Which is the control variable? How do you determine which source to use?
this is the entire simulink model
You have 4 inputs (4 manual switches) and one output ("mode"). The 4 inputs need to be prioritized because there could be more than one switches turned On at the same time. You can use 4 Switch blocks in series to implement the logic. The order of the Switch block will reflect the priority.
The logic can also be implemented using a simple "if-elseif" statement, which you can do in a MATLAB Function block.
This is what's inside the input selector.
Danikha Shyken
Danikha Shyken am 27 Sep. 2023
Bearbeitet: Danikha Shyken am 27 Sep. 2023
And yes, we already have the"if-elseif" statement in a MATLAB Function block.
Your logic is all mixed up. This is my final comment on this topic.
  1. Use a MATLAB Function block with "if-elseif" statement to process 4 manual switch inputs to create an interim output. The value of the interim output could be 1, 2, 3 or 4.
  2. Use this interim output to control that Multi-port Switch to pass through 4 possible voltage source. You got a single voltage output signal. The range of this signal is from 0.3 to 2.
  3. Use another MATLAB Function block to read the value of this single voltage signal to generate the output signal "mode". You seem to have this function already.
  4. There is other simpler way to do this. But at least, this approach should be able to generate the desirable output signal "mode".
I understand. Thank you so much for your time and insights; your assistance has been valuable.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by