Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
Dec 16, 2020
Messages
1
Location
IR

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]
 
It sounds trivial, if you are allowed to set it up before you start running the simulation.


=====================================
(2B)+(2B)' ?
 
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)' ?
 
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

Back
Top