×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Solving equation problem
2

Solving equation problem

Solving equation problem

(OP)
Hi. I would like to calculate an equation with variables in range of values (in Given - Find block), but I have problem with that. Let me explain on example what I'm talking about. I write:

y=1..4            (range of values for variable y)
Given
x(y)=1            (initial guess)
x(y)=2*x(y)+1     (logical equation)
r(y)=Find(x(y))

When i type "r(y)=" Mathcad report a problem: "initial guess must consist of numbers and matrices". I don't know how exactly i should change the initial guess. Any idea ? Thanks for help.

RE: Solving equation problem

Initial guess has to be outside the given/find block.  Put it just above the given statement and it should work.

Steve

RE: Solving equation problem

(OP)
It doesn't matter where the initial guess is placed in, it can be above or in the Given - Find block, but I try that and it is still not working. But thanks for interesting :) Some new suggestions ?

RE: Solving equation problem

Ah..your right.   I have always be under the impression that guess values had to be outside the solve block..  Learned something new today.

Back to your problem though, could the issue be that your guess value is apparently a function x(y)=1.

RE: Solving equation problem

(OP)
Indeed, on mathematical point of view guess value of x shouldn't be a function of variable y, You're right. But when I write x=1, r(y) becomes red ("This variable is undefined"), so the problem is still unsolved. Steve, could You type this to mathcad and take a closer look ? Peter.

RE: Solving equation problem

How do you evalute a function like that where its output depends on using the function as the input?

RE: Solving equation problem

(OP)
Read my last post. It was mistake, I changed that, so now initial value of x isn't a function of y. Program still doesn't work.

RE: Solving equation problem

(OP)
Sorry, mistake in rewriting from mathcad. The program is:

y=1..4             (range of values for variable y)
Given
x=1                (initial guess)
y(x)=2*x(y)+1      (logical equation)
r(y)=Find(x(y))

How about that ?

RE: Solving equation problem

(OP)
Damn, another error. Correct form:

y=1..4             (range of values for variable y)
Given
x=1                (initial guess)
y=2*x(y)+1         (logical equation)
r(y)=Find(x(y))

Somebody know what is wrong with this ?

RE: Solving equation problem

>  Initial guess MUST be outside of the given-find block
>  You cannot place an undefined function on the right hand side of ANY definition or constraint
>  In your specific example x(y) should simply be x
>  However, our construct has a closed form solution of the apparent function inversion that you appear to be looking for, so a given-find is a rather tedious way of finding the answer, and will not give you the functional relationship, in any case:

x = (y-1)/2

This is the type of problem that you could the symbolic functionality of Mathcad, as opposed to the numerical functionality.

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

RE: Solving equation problem

(OP)
OK, but the program that I typed is only the simplest example with what I have a problem. I'm solving more complicated engineering problem, with one variable, multiple equations and multiple unknowns, moreover it requires sequential iteration technique. The variable range of values is also larger. I'm trying to write the simlpest analogical programe that works, and rely on this I'll make a changes in the proper one. Essence is the same. I hope You understand me. Sorry for any possible syntax errors, I'm not an englishman.

RE: Solving equation problem

That's probably not the form you want.   You appear to be using x as both a function and a scalar, from a Mathcad perspective.  Try

            
Given
y:=1        (initial guess - y)
x:=1        (initial guess - x)
y=2*x+1     (logical equation) (relation)
r(y)=Find(x)

then

y:=1..4     (range of values for variable y)
r(y)=

RE: Solving equation problem

The problem doesn't make sense as stated.  r(y) is known at four locations then the coefficients for a 3rd order polynomial can be found.  The general form of the function r(y) still needs to be known.

What does x have to do with this?

Peter Nachtwey
Delta Computer Systems
http://www.deltamotion.com

 

RE: Solving equation problem

I think excognito has it figured out.  You could eliminate the guess values altogether and get a symbolic solution by typing [Ctrl][.] after the Find(x) to get the symbolic result

r(y) = y/2 - 1/2

See Quicksheets Solving Equations, Symbolic Solutions of Equations.
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close