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:
help for solve an equation

Subject: help for solve an equation

From: Atemporal

Date: 21 Nov, 2008 11:46:01

Message: 1 of 6

Hello,

I want to solve the equation x=y/(e^y-1) for y, but

solve('x-y/(e^y-1)','y')

ans =

0

How can I obtain the non-zero solution of y? thanks a lot.

Subject: help for solve an equation

From: Joerg Buchholz

Date: 21 Nov, 2008 16:58:02

Message: 2 of 6

In R2008b, you get the circular result (considering the definition of Lambert's W function):

solve('x-y/(e^y-1)','y')
 
ans =
 
- x - lambertw(0, -(x*log(e))/exp(x*log(e)))/log(e)

Assuming exp(y) instead of e^y, Matlab (muPad) fails:

solve('x-y/(exp(y)-1)','y')
Warning: Explicit solution could not be found.
> In solve at 170
 
ans =
 
[ empty sym ]

For specific x the root can be found:

solve('2-y/(exp(y)-1)','y')
 
ans =
 
- lambertw(0, -2*exp(-2)) - 2
 
double(ans)

ans =

   -1.5936

Atemporal <Atemporal.smth@gmail.com> wrote in message <98b53f60-b7e1-469c-b6f6-99d4a8ae7206@40g2000prx.googlegroups.com>...
> Hello,
>
> I want to solve the equation x=y/(e^y-1) for y, but
>
> solve('x-y/(e^y-1)','y')
>
> ans =
>
> 0
>
> How can I obtain the non-zero solution of y? thanks a lot.

Subject: help for solve an equation

From: Atemporal

Date: 22 Nov, 2008 01:50:44

Message: 3 of 6

Thanks for you reply. I know the solution of the problem,
I just want to know, is there a way to force matlab to find non-zero
solutions for such problem?
Why it act so stupid? I tried an online equation solver, and it find
the right answer! and it is free!


On Nov 22, 12:58=A0am, "Joerg Buchholz" <buchh...@hs-bremen.de> wrote:
> In R2008b, you get the circular result (considering the definition of Lam=
bert's W function):
>
> solve('x-y/(e^y-1)','y')
>
> ans =3D
>
> - x - lambertw(0, -(x*log(e))/exp(x*log(e)))/log(e)
>
> Assuming exp(y) instead of e^y, Matlab (muPad) fails:
>
> solve('x-y/(exp(y)-1)','y')
> Warning: Explicit solution could not be found.
>
> > In solve at 170
>
> ans =3D
>
> [ empty sym ]
>
> For specific x the root can be found:
>
> solve('2-y/(exp(y)-1)','y')
>
> ans =3D
>
> - lambertw(0, -2*exp(-2)) - 2
>
> double(ans)
>
> ans =3D
>
> =A0 =A0-1.5936
>
>
>
> Atemporal <Atemporal.s...@gmail.com> wrote in message <98b53f60-b7e1-469c=
-b6f6-99d4a8ae7...@40g2000prx.googlegroups.com>...
> > Hello,
>
> > I want to solve the equation x=3Dy/(e^y-1) for y, but
>
> > solve('x-y/(e^y-1)','y')
>
> > ans =3D
>
> > 0
>
> > How can I obtain the non-zero solution of y? thanks a lot.- Hide quoted=
 text -
>
> - Show quoted text -

Subject: help for solve an equation

From: John D'Errico

Date: 22 Nov, 2008 11:42:01

Message: 4 of 6

Atemporal <Atemporal.smth@gmail.com> wrote in message <c45cfd95-9d4e-402f-a8a4-e7cd0a3a6716@o4g2000pra.googlegroups.com>...
> Thanks for you reply. I know the solution of the problem,
> I just want to know, is there a way to force matlab to find non-zero
> solutions for such problem?
> Why it act so stupid? I tried an online equation solver, and it find
> the right answer! and it is free!
>

I think the problem is there are some values of x for
which there are no solutions. Negative x for example.
So MATLAB will not return a simple formula which
works for all x.

I believe that you can tell the solver that x is real.
If you can also specify positivity, then this might
help. I do not know if this last piece of information
is passable to the solver.

John

Subject: help for solve an equation

From: Joerg Buchholz

Date: 22 Nov, 2008 12:31:02

Message: 5 of 6

R2007b:

>> syms x y positive
>> solve(x-y/(exp(y)-1), y)
 
ans =
 
    -lambertw(-x/exp(x))-x
 -lambertw(-1,-x/exp(x))-x
 
R2008b:

>> syms x y positive
>> solve(x-y/(exp(y)-1), y)
Warning: Explicit solution could not be found.
> In solve at 170
 
ans =
 
[ empty sym ]

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <gg8r69$k94$1@fred.mathworks.com>...
> Atemporal <Atemporal.smth@gmail.com> wrote in message <c45cfd95-9d4e-402f-a8a4-e7cd0a3a6716@o4g2000pra.googlegroups.com>...
> > Thanks for you reply. I know the solution of the problem,
> > I just want to know, is there a way to force matlab to find non-zero
> > solutions for such problem?
> > Why it act so stupid? I tried an online equation solver, and it find
> > the right answer! and it is free!
> >
>
> I think the problem is there are some values of x for
> which there are no solutions. Negative x for example.
> So MATLAB will not return a simple formula which
> works for all x.
>
> I believe that you can tell the solver that x is real.
> If you can also specify positivity, then this might
> help. I do not know if this last piece of information
> is passable to the solver.
>
> John

Subject: help for solve an equation

From: readeraz

Date: 24 Nov, 2008 13:04:19

Message: 6 of 6

Odd enough, when I try to solve the equation, I got the following
information, what up? How to sove this problem?
this is:
..
Configuration:
  MATLAB Version:
  ...
  Virtual Machine: Java 1.4.2_04 with Sun Microsystems Inc. Java
HotSpot(TM) Client VM
    (mixed mode)
  Default Charset: ibm-1386_P100-2002

Register State:
  EAX =3D 37eb2a00 EBX =3D 00000001
  ECX =3D 00000000 EDX =3D 35b841b0
  ESI =3D 37eb2a00 EDI =3D 00000000
  EBP =3D 00cdbb3c ESP =3D 00cdb5d4
  EIP =3D 36c31139 FLG =3D 00210246

Stack Trace:
  [0] maplec.dll:0x36c31139(2, 0x00cdc788, 1, 0x00cdc818)
  [1] libmex.dll:_mexRunMexFile(2, 0x00cdc788, 1, 0x00cdc818) + 103
bytes
  [2] libmex.dll:public: virtual void __thiscall Mfh_mex::dispatch_file
(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00cdc788,
1, 0x00cdc818) + 157 bytes
  [3] m_dispatcher.dll:public: virtual void __thiscall
Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct
mxArray_tag * *)(2, 0x00cdc788, 1, 0x00cdc818) + 273 bytes
  ...
 This error was detected while a MEX-file was running. If the MEX-
file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for
information
on debugging MEX-files.
...
Error in =3D=3D> maple at 104
[result,status] =3D maplemex(statement);
Error in =3D=3D> solve at 62
maple('_EnvExplicit :=3D true;');


--------------


On Nov 22, 8:31=A0pm, "Joerg Buchholz" <buchh...@hs-bremen.de> wrote:
> R2007b:
>
> >> syms x y positive
> >> solve(x-y/(exp(y)-1), y)
>
> ans =3D
>
> =A0 =A0 -lambertw(-x/exp(x))-x
> =A0-lambertw(-1,-x/exp(x))-x
>
> R2008b:
>
> >> syms x y positive
> >> solve(x-y/(exp(y)-1), y)
>
> Warning: Explicit solution could not be found.
>
> > In solve at 170
>
> ans =3D
>
> [ empty sym ]
>

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