Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to generate a pulse which steps from 0 to 1 after an initial predetermined time has elapsed. When the new predetermined time is available, the pulse should again step from 1 to 0. It should step from 0 to 1 after that time has elapsed. This model has to be implemented in Simulink.
Thanks.
I'm assuming that the times at which the on/off behaviours are to be performed are available before the model simulation begins. Let's say that it's 2 seconds of value 0 and then 3 seconds of value 1.
Use the Pulse Generator block in the Sources library of Simulink. The trick is starting with a zero. To do this, set the Amplitude to 1 second, the Period to 5s, the Pulse Width to 60% and the Phase Delay to 2s.
The output will look as below.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
We have 2 CPU which has this properties-
Clock Rate
CPI
Execution time
No of instructions
MIPS, will always be identical?
If 2 machines have the same Instruction Set Architecture, which of the upper mentioned property will be same?
4 will be true (same dynamic instruction count) unless the program has speed-dependent behaviour (e.g. keep looping checking the time until 0.1 seconds have elapsed, or other more interesting examples you could come up with).
No reason for 1 to be true, and it's very easy to find counter-examples if you go to any online computer store and look at different models of the same generation of x86-64 CPUs with different max clock speeds. And across different generations, there can be even larger differences in clock speed, e.g. a 25MHz 80386 vs. a 5GHz Zen 2 or Coffee Lake.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I am programing a solarcell tracker with the use of Wago PFC100 and Ecockpit software.
I have a principle problem regarding converting some counter values in a 16-bit WORD to a pulsetrain in form of BOOL.
The 16-bit word register counts up/down from 0 to 12621. I need to convert this to BOOL pulses.
when word counter goes from 0 to 1 I need a BOOL pulse 0->1->0, and on next count from 1 to 2 I need a new BOOL pulse of 0->1->0.
I also need pulses in the case that the word register counts down:
2 to 1 needs to also generate a BOOL pulse 0->1->0.
I am programing this with structured text (ST), and I don't know how I could get this part running.
There are a couple of ways to accomplish this.
If you are not expecting the counter to increment more than once per program scan, you can simply look at bit 0 of the counter. Every time it changes, pulse the output.
If it might count more than one per program scan, then on each program scan you need to look at the current counter value and compare it to the counter value on the last scan. The difference between the current value and the last value is how many times you need to pulse the output.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I simulated a system with Simulink. Now , I want to apply controller signal to system
after a time, for example after 20 seconds. It means that the sys. works 20s without
controller and after it the controller is applied.
Which block can do it?
Put the controller inside a Triggered Subsystem and set the trigger signal to go high after 20s, for example using a Clock block and a Compare to Constant block, set to >=20.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm working on school project for NN(neural network) stock prediction I have my yahoo price market data and I normalised my data to number between -1 to 1 my inputs are date and close however I'm not sure what my output should be (I don't know enough knowledge about stock and market) I was thinking of having date and open as my inout and close as my output. I'm planning on using MLP for my project , but is there anything else I need to do after normalisation. I'm not expert on NN I'm taking this course to rise my total grade we were given only one week to finish this HW so I'm not sure if I'll be able to learn using new software
my inputs are date and open after normalisation what should be the next step
what neural network development tool do you recommend (for mac and PC)
can I use excel NeuroXL add on.. does it work on mac
Thank you
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Given a fair coin (0/1), how do you simulate fair dice(0 to 5)
Obvious answer I know is toss 3 times, treat each toss as a bit to produce (2^3 = 0 to 7)
If result == 7, discard and repeat.
Well, theoretically worst case big-O of this is really bad (another question in itself, something to do with monte-carlo algos). Lets keep this soln on shelf.
So now my question is,
Is there/can there be n number of coin toss that can guarantee simulation of dice ?
Of course if exists would like to know minimum number of tosses. :)
In absence of a number that is both divisible by three and 2^n, I couldnt think of any way to solve this. :(