cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Regular Member

## two functions that depend on vector variables are giving error results

To all,

the functions f1s and g1s are giving erroneus results, but i cannot find my mistake.

Please, if you can also check the evaluation of the integral below that will help as well.

Rogelio

Tags (5)
6 REPLIES 6

## Re: two functions that depend on vector variables are giving error results

 the functions f1s and g1s are giving erroneus results,

With "erroneus results" you probably mean that you did not expect nested matrices as result?

It looks like the vectorization in f1 of your function Delta is the reason for that behaviour, but at the moment its unclear to me what exactly is going on here as at first look I loose track as of your multiple nesting of different functions. At least I was not able to reproduce the effect with more simple examples.

## Re: two functions that depend on vector variables are giving error results

OK, and here is a simpler example.

The vector d is hard coded at definition time in f(). The definition of f() is "take every element of d and add it to x" which would return a 3x1 vector. when f(a) simply adds the two vecors but if f() is called vectorized, Mathcad inserts every element of a singly in function f() and get back a 3x1 vector three times - so the result is a nested array.

In your file its the vector d consisting of ten eights which causes that mannerism in the definition of Delta.

One possible workaround is to make d a paremeter of your functions a sketched in the pic above.

## Re: two functions that depend on vector variables are giving error results

Thanks Werner,

i soon as i eliminated the vectorization in the f1s and g1s functions in the definition of the functions the problems seems to be solved.

i tried to run the pi function below the f1s and g1s function and now it says "pattern match exception".

Do you know what that means?

Rogelio

## Re: two functions that depend on vector variables are giving error results

Your function returns a complex value, which is not compatible with the infinite limit.

## Re: two functions that depend on vector variables are giving error results

it has worked for me in other cases of integrals with infinite limits, but i cannot find why it is not working now.