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

while cycle with functions

while cycle with functions

while cycle with functions

Hi, i would like to do a while cycle with functions inside. i have tried but seems that mathcad dont like functions inside.
what i want to do is augment a matrix i times like this:


A(x)=|  f(x)  0   |    <- this is a matrix with a function
     |  0    f(x) |

i want my while cycle to augment N(x) matrix with A(x) to result in this:


N(x)=|  f(x)  0     f(x)   0 ... |    
     |  0    f(x)    0     f(x)..|
so the cycle i have made is:


A(x):= | f(x)    0  |
       |  0     f(x)|
N(x):= while i<3
         A(x) <- augment(A(x),N(x))

N(x)-> doenst calculate. it takes lot of time and nothin
Can you please help me in this problem?

RE: while cycle with functions

I would remove the recursive call.  That is why your computer hangs up.


A(x):= | f(x)    0  |
       |  0     f(x)|
N(x):= while i<3
                               vvv  Recursive call  
         A(x) <- augment(A(x),N(x))
I didn't think you could increment a global variable "i" from inside the subroutine.  Just local variables.

RE: while cycle with functions

but i need that call N(x) to augment the matrix.
that means that i want to enlarge matrix A(x) with N(x) from the left to the right.
If i remove N(x) i cant augment the matrix.

i can do it manually, with no while cycle and i can do it too with a while cycle without functions. if i use constants instead of functions that routine works.

about the increasing variable i, i have it inside the routine, that is a mistake.

Thanks anyway :)


RE: while cycle with functions

try this program

|i<-0 ->
|while i<3
| |i<-1+1
| |M<-augment(A(x),M)

RE: while cycle with functions

I think you will need to use the symbolic capability if you want to grow the functional form.

I'm sure it can be done. there are some examples such as Tom Gutman's Hessian, Ravel, etc. utilities on the http://collab.mathsoft.com/~Mathcad2000 forum.

The live symbolic can be called within a programme!


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


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