Solving an equation multiple times using a for loop

2 vues (au cours des 30 derniers jours)
Mohammadamin Malek Pour
Mohammadamin Malek Pour le 30 Avr 2019
Commenté : Bob Thompson le 30 Avr 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 commentaire
Bob Thompson
Bob Thompson le 30 Avr 2019
Is the vpasolve coming up with a set of answers? That would be my first thought to check.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by