Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

How to use the result of each time-step as input to next time-step?

Please login with a confirmed email address before reporting spam

Basically this is how I would do it in hand calculation:

T_out_0 = 22 [degC] %% Guessed initial value.

%% at t=1:

COP(1) = 5[1/K] * T_out_0

T_out(1) = T_avg_Domain(1) - COP(1)/7[1/K]

%% at t=2:

COP(2) = 5[1/K] * T_out(1)

T_out(2) = T_avg_Domain(2) - COP(2)/7[1/K]

and so on ..

My problem is how to calculate COP from the previous T_out? When I define this in Variables node (As shown below), I got this warning: "circular variable dependencies".

COP : 5[1/K] * T_out

T_out : T_avg_Domain - COP/7[1/K]


1 Reply Last Post May 22, 2019, 8:33 a.m. EDT
Michael Rembe Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 5 years ago May 22, 2019, 8:33 a.m. EDT

Hi, you have to define an aditional variable Tav_old (add physics -> Global ODEs and DAEs). Add the equation 0=Tav_old-T_avg_Domain (variable: Tav_old, equation: Tav_old-T_avg_Domain. Then you add a "Previous Solution" subnode below the time dependent solver and solve for Tav_old. By this way you get Tav_old of the old solution.

Best regards Michael Rembe

-------------------
Michael Rembe
Rembe Consulting PartG mbB
www.rembe-consulting.de


Hi, you have to define an aditional variable Tav_old (add physics -> Global ODEs and DAEs). Add the equation 0=Tav_old-T_avg_Domain (variable: Tav_old, equation: Tav_old-T_avg_Domain. Then you add a "Previous Solution" subnode below the time dependent solver and solve for Tav_old. By this way you get Tav_old of the old solution. Best regards Michael Rembe

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.