Solving an equation multiple times using a for loop

2 Ansichten (letzte 30 Tage)
Mohammadamin Malek Pour
Mohammadamin Malek Pour am 30 Apr. 2019
Kommentiert: Bob Thompson am 30 Apr. 2019
Hello,
I am trying to solve the following equation for time (t) using different air temperatures. Matlab says that the solution is 0*1 empty double column vector!
Thank you for your help.
clear all
clc
x=1
for T_a_amb=[270.928:0.01:272.594] %ambient air temperature
syms t
a = -4/(T_a_amb-277);
b = 5.948e-5;
c = 0.00771;
eqn = 1-(exp(b*t)*(1-erf(c*sqrt(t)))) - a== 0; %
solution = double(vpasolve(eqn,t,[0,1]))
solmate(x,1) = T_a_amb;
solmat(x,2) = solution;
x = x+1
end
  1 Kommentar
Bob Thompson
Bob Thompson am 30 Apr. 2019
Is the vpasolve coming up with a set of answers? That would be my first thought to check.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by