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:
using fsolve

Subject: using fsolve

From: Reshma B

Date: 24 Jun, 2011 08:05:20

Message: 1 of 2

Is it possible to solve the below equation in fsolve? If so please help with it...
There are n nodes and only W terms are unknown. Iteration is to be continued till tolerance is less than 10^-4
qi*qu+qi*alpha*Wi = (alpha*qu*Wi/U)- (G/m^2) * (W(i-1)*qu-2*Wi*qu+W(i+1)*qu+alpha*Wi*W(i-1)-2*Wi^2*alpha+alpha*Wi*W(i+1));
After each iteration value of G varies as Gn=Go/(1+(Go*dw/dx)/tau)^2;

I am not familiar with using optimization techniques in matlab. Please guide me with this. I have solved it using Newton's method. But i need to validate the answer.

Thanks and Regards,
Achu

Subject: using fsolve

From: Roger Stafford

Date: 24 Jun, 2011 20:10:21

Message: 2 of 2

"Reshma B" wrote in message <iu1gfv$5vi$1@newscl01ah.mathworks.com>...
> Is it possible to solve the below equation in fsolve? If so please help with it...
> There are n nodes and only W terms are unknown. Iteration is to be continued till tolerance is less than 10^-4
> qi*qu+qi*alpha*Wi = (alpha*qu*Wi/U)- (G/m^2) * (W(i-1)*qu-2*Wi*qu+W(i+1)*qu+alpha*Wi*W(i-1)-2*Wi^2*alpha+alpha*Wi*W(i+1));
> After each iteration value of G varies as Gn=Go/(1+(Go*dw/dx)/tau)^2;
>
> I am not familiar with using optimization techniques in matlab. Please guide me with this. I have solved it using Newton's method. But i need to validate the answer.
>
> Thanks and Regards,
> Achu
- - - - - - - - -
  There are many things amiss here, Reshma. First, you cannot blend in Newton's method with 'fsolve'. The 'fsolve' routine has its own algorithm for solving equations. In particular you cannot instruct 'fsolve' to alter the 'G' quantity every iteration.

  Second, unless the number of equations is equal to the number of unknowns, you will not have much luck getting a finite number of solutions to the equations no matter what method you use. The use of W(i-1) and W(i+1) indicates that there would be two more unknowns than equations.

  The fact that you write 'dw/dx' in the iteration for Gn without a specific formula for it indicates that you may not truly understand your own problem.

  I would recommend a thorough study of the 'fsolve' documentation, as well as of the details of your problem itself, so that you would be able to present 'fsolve' a valid set of equations.

Roger Stafford

Tags for 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