matlab - Latest Commentshttp://matlab-cheme-cmu.disqus.com/enTue, 23 Jan 2018 20:50:05 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/09/02/stopping-the-integration-of-an-ode-at-some-condition/#comment-3723170742<p>True, that should work. Thank you. If value is a vector, apparently if one of the events is triggered (ie if one of the components become 0), the integration is terminated.</p><p>Another problem i faced was that, because numerical integration is carried out, the 'time' when concentration exactly becomes 0, was skipped depending on time step.. so the event was not triggered and i ended up getting negative values for concentration. (This was finally resolved by checking for a sign change instead of checking if the value is zero... just sharing.. ^-^ )</p>batmanTue, 23 Jan 2018 20:50:05 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/09/02/stopping-the-integration-of-an-ode-at-some-condition/#comment-3722999163<p>If you want all components of the vector to be zero, why not just take the norm of your vector (which is a scalar), and define *that* to be 'value'?</p>Daniel WalshTue, 23 Jan 2018 18:37:48 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/11/17/modeling-a-transient-plug-flow-reactor/#comment-3613820710<p>can u send me if u received it?</p>Shaan AhamedMon, 13 Nov 2017 10:11:13 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/08/27/introduction-to-statistical-data-analysis/#comment-3515716703<p>You're right. I double checked and tinv() returns one sided values with no option to return two sided values. This makes no sense and the fact that they don't even mention it in their documentation is pretty poor form. So, you're right, if you want the most common interpretation of 95% CI you have to do the calculations to convert 95% two-sided into 97.5% one-sided for the right value.</p>Emiliano JordanWed, 13 Sep 2017 12:49:44 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/08/27/introduction-to-statistical-data-analysis/#comment-3513711168<p>I don't have access to Matlab any more, so i am not totally sure. I think what I did is correct though, because it should be a symmetric distribution, i.e. 0.025 on each side of the distribution, which adds up to a 95% confidence interval.</p>JohnKitchinTue, 12 Sep 2017 09:09:58 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/08/27/introduction-to-statistical-data-analysis/#comment-3513238599<p>I'm curious the documentation for tinv() makes it look like that line should just be</p><p>T_m = tinv(.95, n-1);</p><p>Aren't you actually calculating the .975 CI since that's what you're passing to the function?</p>Emiliano JordanMon, 11 Sep 2017 23:27:01 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/09/29/fitting-a-numerical-ode-solution-to-data/#comment-3440244003<p>I don't have any ideas. I am not a matlab user since 2013!</p>JohnKitchinFri, 28 Jul 2017 11:46:31 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/09/28/delay-differential-equations/#comment-3365536966<p>and what about fractional differential delay equations ????</p>mohamedFri, 16 Jun 2017 14:07:28 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/10/21/linear-programming-example-with-inequality-constraints/#comment-3337091287<p>Hello, it means an empty array. If you searched enough you'll find that Matlab is built with programming principles.</p><p>Have a nice day !</p>Dan Ortega MarteFri, 02 Jun 2017 10:59:58 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/10/21/linear-programming-example-with-inequality-constraints/#comment-3280867246<p>what does [] [] mean and do we use it pls?</p>charlesSat, 29 Apr 2017 16:14:41 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/09/02/stopping-the-integration-of-an-ode-at-some-condition/#comment-3210663239<p>thanks, that's really helpful!</p>Christopher CrawfordSat, 18 Mar 2017 13:20:17 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2012/08/27/peak-finding-in-raman-spectroscopy/#comment-3210099248<p>I am facing problem in using command "textread".</p>Muhammad Aqeel AslamSat, 18 Mar 2017 02:25:19 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/11/21/interacting-with-the-steam-entropy-temperature-chart/#comment-3207763370<p>I am glad it is helpful to you!</p>JohnKitchinThu, 16 Mar 2017 16:02:18 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/11/21/interacting-with-the-steam-entropy-temperature-chart/#comment-3207550121<p>Thanks allot for this code. It came of great use when writing a report on a geothermal power cycle.</p>Friðrik HoverThu, 16 Mar 2017 13:56:41 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/11/21/interacting-with-the-steam-entropy-temperature-chart/#comment-3207544133<p>The fact is when you download for example XSteam.m directly it gives you a much smaller .m file than if you download it from the Download Submission button (or download zip as it's named now). You also get a pdf manual for the program in the zip folder.<br>BTW. Thank you John Kitchin for this code, I love it.</p>Friðrik HoverThu, 16 Mar 2017 13:53:12 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/09/02/stopping-the-integration-of-an-ode-at-some-condition/#comment-3096879855<p>Can 'value' be a vector..??</p>batmanFri, 13 Jan 2017 00:27:23 -0000Re: Matlab in Chemical Engineering at CMU http://matlab.cheme.cmu.edu/2011/12/25/finding-equilibrium-composition-by-direct-minimization-of-gibbs-free-energy-on-mole-numbers/#comment-3040319036<p>I had trouble running matlab with your function code, i had to change nj in x! Anyway,just one question: the Gjo are calculated at 1000K?</p>DareToKnowWed, 07 Dec 2016 07:51:08 -0000Re: Matlab in Chemical Engineering at CMU http://matlab.cheme.cmu.edu/2011/12/25/finding-equilibrium-composition-by-direct-minimization-of-gibbs-free-energy-on-mole-numbers/#comment-3011426361<p>I don't have anything like that.</p>JohnKitchinSun, 20 Nov 2016 09:48:01 -0000Re: Matlab in Chemical Engineering at CMU http://matlab.cheme.cmu.edu/2011/12/25/finding-equilibrium-composition-by-direct-minimization-of-gibbs-free-energy-on-mole-numbers/#comment-3011009953<p>Hi John!</p><p>I really am glad I came across your page. I'm curious, do you have a basic skeleton for a minimization of Gibbs Free Energy with a binary phase diagram by any chance? I'm a novice at this and I'm interested in getting started looking at phase diagrams with MATLAB. Your help would be greatly appreciated!</p>MJESun, 20 Nov 2016 01:31:53 -0000Re: Matlab in Chemical Engineering at CMU http://matlab.cheme.cmu.edu/2011/12/25/finding-equilibrium-composition-by-direct-minimization-of-gibbs-free-energy-on-mole-numbers/#comment-3008358125<p>I am not sure what you mean by not running properly. The post is published directly from Matlab. Do you think the answer is incorrect?</p>JohnKitchinFri, 18 Nov 2016 09:12:47 -0000Re: Matlab in Chemical Engineering at CMU http://matlab.cheme.cmu.edu/2011/12/25/finding-equilibrium-composition-by-direct-minimization-of-gibbs-free-energy-on-mole-numbers/#comment-3008194186<p>Hi John! <br>Very useful program, thank you! One thing i'd like to point out, there's a mistake in the function (it has to be used x and not nj,otherwise the code can't run properly).<br>I would like to ask if there's a possibility of having the matlab code using S A algorithm (if exists a chance of using this kind of method)! I'm trying on my own but I'm facing multiple troubles due to my basic knowledge of Matlab.<br>Thanks in advance!</p>DareToKnowFri, 18 Nov 2016 06:38:06 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/09/29/fitting-a-numerical-ode-solution-to-data/#comment-2922895538<p>Hello,</p><p>i try to do parameterisation of the system of differential equations (nested function). I keep getting an Error message:<br> >> cost_menstrual<br>Not enough input arguments.</p><p>Can anyone help me, i'm new to matlab.</p><p>Error in cost_menstrual (line 14)<br> times, h0, vopt, params);<br>my 2 functions are as follow:</p><p>global times<br>global measurements</p><p>function ydot=ode_menstrual_parametric(t,y,p)<br>y0=[ 29.6472 6.8618 8.4669 6.1458 3.8327 11.5057 5.4786 19.2717 45.6416 100.7348 125.9500 135.8355 168.7130];</p><p>% Initializing parameter vector<br>p(1)=v_0LH;<br>p(2)=v_1LH;<br>p(3)=Km_LH;<br>p(4)=Ki_LHP;<br>p(5)=k_LH;<br>p(6)=c_LHP;<br>p(7)=c_LHE;<br>p(8)=d_E;<br>p(9)=d_P;<br>p(10)=v_FSH;<br>p(11)=Ki_FSHIh;<br>p(12)=k_FSH;<br>p(13)=c_FSHP;<br>p(14)=c_FSHE;<br>p(15)=d_Ih;<br>p(16)=alpha;<br>p(17)=beta;<br>p(18)=gamma;<br>p(19)=b;<br>p(20)=c_1;<br>p(21)=c_2;<br>p(22)=c_3;<br>p(23)=c_4;<br>p(24)=c_5;<br>p(25)=d_1;<br>p(26)=d_2;<br>p(27)=k_1;<br>p(28)=k_2;<br>p(29)=k_3;<br>p(30)=k_4;<br>p(31)=e_0;<br>p(32)=e_1;<br>p(33)=e_2;<br>p(34)=e_3;<br>p(35)=p_0;<br>p(36)=p_1;<br>p(37)=p_2;<br>p(38)=h_0;<br>p(39)=h_1;<br>p(40)=h_2;<br>p(41)=h_3;</p><p>ydot=[y(1); y(2); y(3); y(4); y(5); y(6); y(7); y(8); y(9); y(10); y(11); y(12); y(13)];<br>% Auxiliary equations<br>E_2=e_0+e_1*y(6)+e_2*y(7)+e_3*y(13);<br>P_4=p_0+p_1*y(12)+p_2*y(13);<br>Ih=h_0+h_1*y(7)+h_2*y(11)+h_3*y(12);</p><p>% System of Differential Equations:</p><p>dydt(1)=(v_0LH+v_1LH*(E2_lag/Km_LH)^a/(1+(E2_lag/Km_LH)^a))/(1+P4_lag/Ki_LHP)-k_LH*((1+c_LHP*P_4)/(1+c_LHE*E_2))*y(1);<br>dydt(2)=(1/vol)*k_LH*((1+c_LHP*P_4)/(1+c_LHE*E_2))*y(1)-a_LH*y(2);<br>dydt(3)=v_FSH/(1+Ih_lag/Ki_FSHIh)-k_FSH*((1+c_FSHP*P_4)/(1+c_FSHE*E_2^2))*y(3);<br>dydt(4)=(1/vol)*k_FSH*((1+c_FSHP*P_4)/(1+c_FSHE*E_2^2))*y(3)-a_FSH*y(4);<br>dydt(5)=b*y(4)+(c_1*y(4)-c_2*y(2)^alpha)*y(5);<br>dydt(6)=c_2*(y(2)^alpha)*y(5)+(c_3*(y(2)^beta)-c_4*y(2))*y(6);<br>dydt(7)=c_4*y(2)*y(6)-c_5*y(2)^gamma*y(7);<br>dydt(8)=c_5*y(2)^gamma*y(7)-d_1*y(8);<br>dydt(9)=d_1*y(8)-d_2*y(9);<br>dydt(10)=d_2*y(9)-k_1*y(10);<br>dydt(11)=k_1*y(10)-k_2*y(11);<br>dydt(12)=k_2*y(11)-k_3*y(12);<br>dydt(13)=k_3*y(12)-k_4*y(13);<br>ydot=[y(1);y(2);y(3);y(4);y(5);y(6);y(7);y(8);y(9);y(10);y(11);y(12);y(13)];</p><p>function cost=cost_menstrual(params)<br>global times;<br>global measurements;</p><p>h0=[ 29.6472 6.8618 8.4669 6.1458 3.8327 11.5057 5.4786 19.2717 45.6416 100.7348 125.9500 135.8355 168.7130];<br>vopt=odeset('InitialStep',0.04,'MaxStep',0.04);<br>%% Initial conditions <br>%y0=[ 29.6472 6.8618 8.4669 6.1458 3.8327 11.5057 5.4786 19.2717 45.6416 100.7348 125.9500 135.8355 168.7130];</p><p>%IC=[RP_LH_zero,LH_zero,RP_FSH_zero,FSH_zero,MsF_zero,SeF_zero,PrF_zero,Sc1_zero,Sc2_zero,Lut1_zero,Lut2_zero,Lut3_zero,Lut4_zero];</p><p>[t,h]=ode45(@ode_menstrual_parametric,...<br> times, h0, vopt, params);</p><p>%residual sum of squares<br>costs=sum((h-measurements).^2);<br>cost=sum(costs);</p>Malgorzata WieteskaWed, 28 Sep 2016 09:34:27 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2012/08/31/what_do_you_want-m/#comment-2840841959<p>First hit on google: matlab excel ;)</p><p><a href="http://www.mathworks.com/help/matlab/ref/xlsread.html" rel="nofollow noopener" title="http://www.mathworks.com/help/matlab/ref/xlsread.html">http://www.mathworks.com/he...</a></p>JohnKitchinTue, 16 Aug 2016 15:19:29 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2012/08/31/what_do_you_want-m/#comment-2840578658<p>Dear Sir,</p><p>I would like plot DLS data using MATLAB, my excell sheet comprises of 14 tables filled. I have been using Origin 8 to plot. Please suggest how to use MATLAB to import this file and also plot gaussian curve fit for these data points.</p><p>Thank you,</p>KrishnarkaTue, 16 Aug 2016 13:00:19 -0000Re:
Matlab in Chemical Engineering at CMU
http://matlab.cheme.cmu.edu/2011/12/12/water-gas-shift-equilibria-via-the-nist-webbook/#comment-2790209457<p>To calculate Gjo I used the same method as the first example you posted (H-TS). Unfortunately, however, the values are all different. I also simulated with AspenPlus and results are equal to yours. it's very strange, the matlab-script is correct but I don't understand how you find the G° data. Thank you very much for your answer and for your help :)</p>Andrea CardisMon, 18 Jul 2016 17:49:20 -0000