Skip to main content
16-Pearl
January 10, 2018
Solved

Indexing functions

  • January 10, 2018
  • 1 reply
  • 2772 views

Is there any way to index functions so that I can call different functions through an indexed variable (i)?  Something like this - although this only works as shown. When I try to turn x into a function (e.g. x as a function of t)) Mathcad balks and won't even let me define it (doesn't understand the syntax or refuses to let me define :=) 

 2018-01-10_14-24-10.jpg 

4.0 attached.  Thanks!

Best answer by DJF

Thanks Luc,

Does exactly what I asked for - so A+ for that.  My actual sheet requires a bit of modification along these lines - really just having to do with how I want my functions arranged.  

2018-01-10_19-14-39.jpg

 

I guess I'll find out, but when I call x(t)_0 is it going to solve  R1 and R2?  That would really bog it down on a big sheet.

 

 

I also toyed with concat to create a function name like "x1", "x2" that I could call, but once something is a string I can't seem to do anything with it.  But that would be slick if it worked.

Thanks,

1 reply

23-Emerald IV
January 10, 2018

Something like this?

LM_20180110_Function.png

Success!
Luc

DJF16-PearlAuthorAnswer
16-Pearl
January 11, 2018

Thanks Luc,

Does exactly what I asked for - so A+ for that.  My actual sheet requires a bit of modification along these lines - really just having to do with how I want my functions arranged.  

2018-01-10_19-14-39.jpg

 

I guess I'll find out, but when I call x(t)_0 is it going to solve  R1 and R2?  That would really bog it down on a big sheet.

 

 

I also toyed with concat to create a function name like "x1", "x2" that I could call, but once something is a string I can't seem to do anything with it.  But that would be slick if it worked.

Thanks,

DJF16-PearlAuthor
16-Pearl
January 11, 2018

Ok, Luc's idea worked.  (Success!)  It solved almost instantly so I think it was solving only what it needed to.  Anyway, here's a final formulation (piecewise cam profile with 20 unique regions.  The RegionX calculations house the equations for R, V, A, J, S for that region).  Yet another handy trick to know.  

 

2018-01-10_20-31-50.jpg