CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Solving a nonlinear equation? (https://www.cfd-online.com/Forums/main/7168-solving-nonlinear-equation.html)

Pr February 16, 2004 09:22

Solving a nonlinear equation?
 
I need to solve such a problem cos(wa)cos(wb)-sin(wa)sin(wb)[1+ne^(iw\tau)]=0 where a,b,n and \tau are given values.The following equations is to be solved for w whereas i=\sqrt(-1). Please provide some suggestions are some reference to solve it

Pr February 18, 2004 04:38

Re: Solving a nonlinear equation?
 
Just the number of visits or increasing but nobody tried to answer it. Is it too difficult or too simple to answer it. Come on somebody atleast give me some references. Pr

ag February 18, 2004 09:11

Re: Solving a nonlinear equation?
 
Do you want an exact solution or an approximate solution? Numerically I would use a Newton-based iterative method, which can be found in any decent testbook covering numerical methods.

Linfeng February 18, 2004 09:13

Re: Solving a nonlinear equation?
 
Try Maple or Mathematica, if you are not writing a code :)

Linfeng

Pr February 18, 2004 10:33

Re: Solving a nonlinear equation?
 
yes thanks for the answers atleast. But there is a problem that it involves imaginary number(i).Then how do you solve such a problem. I know the numerical methods and know how to use a matlab when I have real numbers but this equation involves imaginary number that is why I am asking. Pr

m malik February 18, 2004 10:54

Re: Solving a nonlinear equation?
 
Do you have some sample numbers a, b, n, and tau, and the solution w?

Pr February 18, 2004 11:03

Re: Solving a nonlinear equation?
 
Yes I have but the methods should be applied in general to any value. Pr

Tom February 18, 2004 11:22

Re: Solving a nonlinear equation?
 
Since you're function is analytic (in the complex plane sense) you can use Newton-Raphson exactly as you would for a real number - in fortran change REAL w to COMPLEX w.

Alternatively split into real and imaginary parts and apply Newton iteration to the system.

Tom.

ZZ February 19, 2004 03:21

Re: Solving a nonlinear equation?
 
Use an equality: exp(I*w*tau)=cos(w*tau) + I*sin(w*tau), where I=sqrt(-1), and then you have two real equations.

Pr February 19, 2004 04:16

Re: Solving a nonlinear equation?
 
Hi ZZ do you mean by this cos(wa)cos(wb)-sin(wa)sin(wb)[1+ne^(iw\tau)]=0 cos(wa)cos(wb)-sin(wa)sin(wb)[1+n(cos(w\tau)+isin(w\tau)]=0 it is in this form

A*B-C*D[1+x+iy]=0

A*B-C*D*x-C*D*y*i=0

A*B-C*D*x=0----(1) C*D*y=0----(2) Pr

Tom February 19, 2004 04:54

Re: Solving a nonlinear equation?
 
Since w will in general be complex you can't do it that way. If w is real you can obtain two equations this way - the first equation will give you an infinite set of possible values of w while the second is a constraint upon your constants which needs to be satisfied in order that you have a solution - for arbitrary choices of your constant there will not be a real solution for w.

yousef February 22, 2004 05:50

flow separation
 
i ask if i have a poasitive pressure graident that must i have flow separation and thanks pleasese contact me at my email yelhasdi@yahoo.com

CFD Learner February 22, 2004 09:17

Re: Solving a nonlinear equation?
 
r u sure MATLAB could not handle imaginary problems?????


All times are GMT -4. The time now is 05:41.