write a matlab code and plot c vs t
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
i have to solve an equation given:
c=c0-exp(-k*t)/2
given
c0=1;
k=A*exp(-E/R/T)......(arrhenius equation) where T is temperature and t is time.
E=40,000
R=8.314
range of temperature can be taken from 25 to 400 (celsius)
range of time 2000 to 16000 hours
can anyone help me give me the code of this equation....please in a hurry.
[Merged from duplicate question]
here is the code that i wrote can anyone tell me what is wrong here:
1 comentario
SUBHOJIT BHOWMICK
el 14 de Ag. de 2018
e=40000; r=8.314; c0=1; b=10; [x,y]=meshgrid (2000:1000:16000,25:20:400); c=c0-(exp(-(a.*exp(-e./r.*y.^2).*x)/.2)); surf(x,y,c)
Respuestas (1)
Walter Roberson
el 20 de Nov. de 2015
Assign to the constants, c0, E, R, and A.
Then for any given combination of t and T, assign the correct formula to k. Now that you have the value for k, assign the correct formula for c.
There are a number of different ways to handle plotting for all the combinations of t and T. for loops; anonymous functions; arrayfun; bsxfun; meshgrid; ndgrid . Since this is homework, you will need to take the next step rather than us doing it for you.
5 comentarios
Walter Roberson
el 20 de Nov. de 2015
Your code has
y=zeros(length(T),10)
that makes y have 10 columns. Inside your for loop you assign to y(i,j) where you have
for j=1:length(T)
length(T) is 4, so the maximum j you use inside the loop is 4, so although you initialized zeros(4,10) you are going to only use up to column 4. Why did you assign 10 columns when you have 4 temperatures and 9 times ?
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!