"Abdalla Mohamed" <mangawy_21@hotmail.com> wrote in message
news:gj8uqu$e5s$1@fred.mathworks.com...
> I am having a problem evaluating this equation using lambertW.
> My code is :
>
> Iph=3.8713;
> I0=0.00000807307;
>
> f='I= IphI0*(exp((V+(I*0.47))/2.5776)1)(V+I*0.47)/1365';
> V = solve(f,'V');
>
> % this gives V as a function of I as follows:
> V= 1365.0*I0 + 1365.0*Iph  1365.47*i  2.5776*lambertw(0,
> (5295623836126629422718808193668527*I0*exp((182340161390440720049658597144631*i)/1000000000000000000000000000000000)*exp((5295623836126629422718808193668527*I0)/10000000000000000000000000000000
> +
> (5295623836126629422718808193668527*Iph)/10000000000000000000000000000000
> 
> (8277261308969584109248913718187438892735490378646803227808814401*i)/15625000000000000000000000000000000000000000000000000000000000))/10000000000000000000000000000000)
>
>
> my problem is that i can't plug in I values to get V values where I=0: 0.1
> : 3.87
> any suggestion will be greatly appreciated. Thanks in advance
>
>
If you have a symbolic expression which contains a symbol that you want to
take on some set of values, then use subs.
For example,
syms x y
x=3+2*y
new_values=0:.1:1
arrayfun( @(z) subs(x,'y',z), new_values)
So, in your case, use
arrayfun(@(x) subs(V,'I',x),[0: 0.1 : 3.87])
Nasser
