The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: iterations adjustments UPDATED
Replies: 3   Last Post: Nov 24, 2012 9:30 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 3
Registered: 11/23/12
Re: iterations adjustments UPDATED
Posted: Nov 24, 2012 9:13 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

dpb <> wrote in message <k8ot2s$sqj$>...
> On 11/23/2012 3:32 PM, ARTEMIS CIVIL wrote:
> > Hello, I really have to deal with the problem below. I am a beginner in
> > matlab and my deadline is quite pressing. Thank you in advance!
> > Well, I have to guess an initial value "n" in order to find the ultimate
> > value
> > "Pu". When the extracting Pu deviates from a specific defined value (Pe)
> > more
> > than 0.1% then I need the code to make use of the last value of "Pu" to
> > find the correct n until the parameter "Pu"reach the Pe. Otherwise the
> > parameter n is kept.
> > such as:
> > input: n
> > results: Pu
> > target: pe
> > dp=pu-pe
> > if dp<0.1% keep n
> > or else n=n+dn and again from the begining until the Pe is reached!
> > Thanks!!

> Better to not keep making new threads, also...
> You've gone to the other extreme now w/ perhaps too little, but
> Enclose the computation in a WHILE loop, initializing the error to a
> large value--
> dp=inf; % initialize difference to big number
> err=0.1; % set an error criterion
> n=n0-dn; % initialize n
> while dp>err
> ...
> n=n+dn;
> % compute here
> dp=pu-pe;
> end
> This will stop the loop when the error criterion is met w/ the value of
> n that satisfied it by having the n+dn term before the computation.
> --

thanks a lot for the help! (sorry for the threads...I am a new follower of this site!)
I would like to ask you one more question:
Previously, I had the code and a parameter "n" as an input in order to find the parameter Pu: output! Now, from experiments I know the real value of the parameter Pu, is it possible to find from the code the parameter n ( as an output) if I give the Pu as an input? could I "invert" the code?? Thanks in advance!

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.