Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
solving equation using lambertW

Subject: solving equation using lambertW

From: Abdalla Mohamed

Date: 28 Dec, 2008 22:33:02

Message: 1 of 2

 I am having a problem evaluating this equation using lambertW.
My code is :

Iph=3.8713;
I0=0.00000807307;

f='I= Iph-I0*(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

Subject: solving equation using lambertW

From: Nasser Abbasi

Date: 29 Dec, 2008 00:31:19

Message: 2 of 2


"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= Iph-I0*(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

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us