Path: news.mathworks.com!not-for-mail
From: "rasika " <n.rasika@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Solving eqn in matlab
Date: Wed, 9 Nov 2011 00:38:13 +0000 (UTC)
Organization: Missouri University of Science &#38; Technology
Lines: 48
Message-ID: <j9ci1l$ks1$1@newscl01ah.mathworks.com>
References: <j9ac4r$6b3$1@newscl01ah.mathworks.com> <4EB9281A.9070102@mathworks.com>
Reply-To: "rasika " <n.rasika@gmail.com>
NNTP-Posting-Host: www-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1320799093 21377 172.30.248.37 (9 Nov 2011 00:38:13 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 9 Nov 2011 00:38:13 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2868390
Xref: news.mathworks.com comp.soft-sys.matlab:748739

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,.


Christopher Creutzig <Christopher.Creutzig@mathworks.com> wrote in message <4EB9281A.9070102@mathworks.com>...
> On 08.11.11 05:45, rasika wrote:
> > C*(50-R)*Ccell - 2.5lnCcell= ln((Is/I)/((1-Is)/I)) - ln B - A*(50-R)
> > Here A, B and  C are constants.. and I have to evaluate Ccell from various values of I, and for a column vector values of R.. but this is the simplest form it can get solved to..
> > How to get it solved in Matlab?
> > If I use the solve function it gives me this o/p
> > syms Cell;
> >>> solve('C*(50-R)*Cell - 2.5*log(Cell)=log((Is/I)/(1-(Is/I))) - log(B)-A*(50-R)')
> 
> When you pass a string to solve, it will completely ignore all values
> you have assigned to your MATLAB variables, including Cell, Is, I, etc.
> Additionally, I means sqrt(-1) in this context.
> 
> Which of the names above represent known values? Do you have values for
> A, B, C, R, Is, I, etc., or just assume them to be arbitrary constants?
> 
> To make a long story short: Just don't use strings in the solve command.
> And it's probably a good habit not to let the system guess which
> variable to solve for, either – that works fine if you only have one
> variable or you keep in mind the selection rules, but I find it easier
> to just be more explicit:
> 
> >> syms A B C Cell R Is I
> >> solve(C*(50-R)*Cell - 2.5*log(Cell) - ...
>        (log((Is/I)/(1-(Is/I))) - log(B)-A*(50-R)), Cell)
> 
> ans =
> 
> (5*wrightOmega(log(B^(2/5)) + log(1/(-Is/(I*(Is/I - 1)))^(2/5)) -
> log(5/(2*C*(R - 50))) - (2*A*(R - 50))/5))/(2*C*(R - 50))
> 
> 
> Christopher