Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

matlab simulink

Status
Not open for further replies.

Enghamed64

Student
Dec 16, 2020
1

topic: simulink / simscape /electrical
solver mode: discrete
sample tiome:Ts= 0.0001 sec
stop time:T=2 sec
Suppose we are now in the first second of the simulation, How can I access previous measurment data while running the simulation? Simultaneously with the simulation, I want to do mathematical calculations on current and previous measurment data, How do I do this?
I want calculate X that i is the measurment signal such as Voltge:
X= i(t)*i(t-Ts)+ i(t-Ts)*i(t-2Ts) simultaneously with simulink runnig and t increasing, t= running time & 0<t<T[/color]
 
Replies continue below

Recommended for you

It sounds trivial, if you are allowed to set it up before you start running the simulation.


=====================================
(2B)+(2B)' ?
 
If you mean you want to save a signal then look at a To File block. Then to reimport it use a From File block, to compare it with your current test.



Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
Typically, all the state information is stored at each time step in a vector or matrix, which is how you get plots at the end of the simulation showing time history of signals.

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! faq731-376 forum1529 Entire Forum list
 
> How can I access previous measurment data while running the simulation? Simultaneously with the simulation, I want to do mathematical calculations on current and previous measurment data, How do I do this?

It sounds like it would be handy if they had a block that is capable of creating delayed values.

=====================================
(2B)+(2B)' ?
 
Gosh, wouldn't that be handy. Suppose you could write data values To File, and read them back From File. It's amazing they never thought of that.



Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
You can try converting Simscape electrical signals to signals that can be processed by MATLAB Simulink and use any available building blocks (DELAY / MEMORY, etc.). In the figure below, you can see a conditional diagram for an example, where the mapping of columns with a given number of delays into the "simoutV1" block is set (you can choose according to the step) of the signal from "simoutV"
 
 https://files.engineering.com/getfile.aspx?folder=f0e97d54-51a6-4385-ac92-450ffc8923ee&file=Scheme1.JPG
Status
Not open for further replies.

Part and Inventory Search

Sponsor