Explicit solution from non-linear implicit equation

1 visualización (últimos 30 días)
Todd Koenig
Todd Koenig el 26 de Feb. de 2020
Comentada: darova el 26 de Feb. de 2020
Hello All,
I am need of help with correct coding for what you see below. I need to iteravely solve for temperatre T(j+1) when there exists a non-linear porition T(j+1)^4. Note that I am trying to use the Crank-Nicolsen method to solve the unknown temperature, which is the equation seen below.
clear
clc
m = .05; %kg
c = 300; % J/kg-K
Area = .02; %m^2
epsilon = .35;
T_inf = 300; %K
T_ini = 300; %K
omega = .02094; %rad/s
sigma = 5.67e-8; %W/m
tau = Area/(m*c);
sim_time = 2000; %seocnds
time_step = 201;
delta_t = sim_time/(time_step - 1);
time = zeros(1,2000);
T = zeros(1,200);
T_temp = 0;
for j = 1:sim_time
time(j) = (j-1)*sim_time/(time_step-1);
end
q_dot_double_prime_s = 100 + 100*sin(omega * time);
T(1) = T_ini;
for j = 1:(time_step - 1)
equation = T(j+1) == T(j) + tau*(sigma*epsilon*(T(j)^4 + T_inf^4) + sigma*epsilon* (T(j+1)^4 + T_inf^4) + q_dot_double_prime_s(j) + q_dot_double_prime_s(j+1))*delta_t/2
sol=fsolve(equation,T(j+1))
end

Respuestas (0)

Categorías

Más información sobre Systems of Nonlinear Equations en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by