Path: news.mathworks.com!not-for-mail From: Christopher Creutzig <Christopher.Creutzig@mathworks.com> Newsgroups: comp.soft-sys.matlab Subject: Re: Solving eqn in matlab Date: Wed, 09 Nov 2011 13:45:03 +0100 Organization: The MathWorks, Inc. Lines: 42 Message-ID: <4EBA75CF.8010806@mathworks.com> References: <j9ac4r$6b3$1@newscl01ah.mathworks.com> <4EB9281A.9070102@mathworks.com> <j9ci1l$ks1$1@newscl01ah.mathworks.com> NNTP-Posting-Host: pad-ccreutzi-maci.dhcp.mathworks.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: newscl01ah.mathworks.com 1320842704 22294 172.16.195.205 (9 Nov 2011 12:45:04 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Wed, 9 Nov 2011 12:45:04 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: <j9ci1l$ks1$1@newscl01ah.mathworks.com> Xref: news.mathworks.com comp.soft-sys.matlab:748796 On 09.11.11 01:38, rasika wrote: > Hello Christopher, > A,B,C and IS are constants, > A=0.079; > B=6*10^-9; > C=3.5*10^-10; > Is=260; > I will have a column vector of R and I as input. > When i declared all of them under syms i did get the answer like yours > exp((2*log(B))/5 - (2*log(-Is/(I*(Is/I - 1))))/5 - (2*A*(R - 50))/5)/exp(wrightOmega(log(B^(2/5)) + log(1/(-Is/(I*(Is/I - 1)))^(2/5)) + log((2*C*(R - 50))/5) - (2*A*(R - 50))/5)) > but it is not a numerical answer. I will change 'I' to 'intensity' or some other variable, because it makes sense why I had got an i in the answer last time now, its taking it as a complex number. > How to pass it then if not as a string? > I tried declaring f=(function to be solved) > and solve(f,Cell) didnt work,. A variable should either be declared as sym or have a numerical value, not both, and I don't understand your description of the varable āIā. I don't know what you tried (please always provide complete input ready for copy&paste), but this works for me: A=0.079; B=6*10^-9; C=3.5*10^-10; Is=260; syms con R I solve(C*(50-R)*con - 2.5*log(con) - ... (log((Is/I)/(1-(Is/I))) - log(B)-A*(50-R)), con) ans = (12089258196146291747061760*wrightOmega(log(1/(-260/(I*(260/I - 1)))^(2/5)) - log(12089258196146291747061760/(1692496147460481*R - 84624807373024050)) - (79*R)/2500 - 2635574472465043/439804651110400))/(1692496147460481*R - 84624807373024050) Since I did not give values for I and R, the answer obviously depends on them. Christopher