help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Solving Complex Simultaneous Equations


From: Olaf Till
Subject: Re: Solving Complex Simultaneous Equations
Date: Wed, 19 Jun 2013 16:25:38 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Wed, Jun 19, 2013 at 06:36:26AM -0700, Sergei Steshenko wrote:
> 
> 
> --- On Tue, 6/18/13, JoshE87 <address@hidden> wrote:
> 
> > From: JoshE87 <address@hidden>
> > Subject: Solving Complex Simultaneous Equations
> > To: address@hidden
> > Date: Tuesday, June 18, 2013, 8:43 AM
> > Hi.  I'm very new to Octave and
> > programming in general.  I'm working at a
> > company so I can't share EXACTLY the formulas I'm working
> > on, but I will try
> > to make simple(r) analogues that carry the same weight and
> > issues that I'm
> > facing. 
> > 
> > Formula 1
> > x^2=sum(5*((2-y*ui)/(1+x*ui)))
> > 
> > Formula 2
> > y=1/z*sum((ui)/(1+x*ui))
> > 
> > Formula 3
> > z=1+ sum(ui/(1+x*ui))
> > 
> > first guess of x
> > x=(a*(sum(ui*5))^0.5)/2
> > 
> > How would I go about solving for x?
> > I'd imagine that I have to solve iteratively, specify how
> > many times I want
> > it to try and make sure it knows what a good starting point
> > is.  A good
> > number of times to loop the equation would be 1,000 or
> > 10,000.  
> > 
> > The problem is that I do not know the language to use in
> > order to
> > successfully input this information.  While you're
> > explaining it, please
> > speak to me as if I am totally ignorant of all programming
> > knowledge.  As of
> > 1 week ago I was.  
> > 
> > Can anyone help?  I haven't found any methods close to
> > what I am trying to
> > do in any tutorials.  
> > 
> > Thanks so much in advance.  If you need any more
> > information please let me
> > know. 
> 
> "I haven't found any methods close to what I am trying to do in any 
> tutorials" - look up Levenberg-Marquard: 
> https://en.wikipedia.org/wiki/Levenberg%E2%80%93Marquardt_algorithm .
> 
> Octave-specific documentation: in 
> http://octave.sourceforge.net/optim/function/leasqr.html in 
> http://octave.sourceforge.net/optim/index.html package.
> 
> Regards,
>   Sergei.

While general optimization might work, I'd rather say this is a case
for fsolve (for documentation, type "help fsolve"). You have to
rearrange your equations so that the left hand sides are zero and
write a function returning a vector with the left hand sides, while
the functions argument is a vector with [x, y, z] (see fsolve
documentation). Enjoy learning the Octave language! IMO the
documentation is fairly good for this.

Do you really mean "complex", or just "complicated"? For complex
variables you likely have to split the arguments and returned values
of your function into the real and the imaginary parts, so you double
the number of variables (or of vector elements).

Olaf

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]