Simulink: Need to update variables used in simulink differential equation solver

2 次查看(过去 30 天)
Hi,
I need to solve a differential equation in Simulink that has time varying elements I need to update and record in an array in the MATLAB workspace. I'm trying to solve a system of lumped differential equations.
My equation solves for a pressure in a cardiovascular system: dpe1 = e1(t)*(I1(t)+pe1(t)*(1/(e1(t))^2*de1(t)))
The variables e1, I1, pe1, and de1 are all varying with time and need to be updated to solve the equation at specific instances in time during the simulation (i.e. dpe1 at time 0 needs e1(t=0), I1(t = 0), pe1(t = 0), and de1(t = 0). I1(t) will have it's own seperate function that I'll have to recreate in another section of my code.
I need help updating these variables in my differential equation and recording them in the workspace for future use. I'm relatively new at simulink and could use some help figuring out how to connect signals and data values in my simulations. I would greatly appreciate any help with this.
I'll attach an image of the simulation with the values I need to have updated circled. Please let me know if you need any additional information.

采纳的回答

Fangjun Jiang
Fangjun Jiang 2020-7-27
Do you have the formula of the function? For example, if pe1(t)=sin(t), you just use the "Fcn" block, specify it as "sin(u)" and feed the Clock signal.
so just contruct the fucntion using whatever block based on the function formula of time t.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Array and Matrix Mathematics 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by