topic Re: two functions that depend on vector variables are giving error results in PTC Mathcad
https://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164117#M64317
<HTML><HEAD></HEAD><BODY><P>Your function returns a complex value, which is not compatible with the infinite limit. </P></BODY></HTML>Sun, 26 May 2013 20:14:35 GMTRichardJ2013-05-26T20:14:35Ztwo functions that depend on vector variables are giving error results
https://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164113#M64313
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.thank you in advance,RogelioThu, 03 May 2018 17:15:07 GMThttps://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164113#M64313rdelascasas2018-05-03T17:15:07ZRe: two functions that depend on vector variables are giving error results
https://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164114#M64314
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P style="min-height: 8pt; padding: 0px;"> the functions f1s and g1s are giving erroneus results, </P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P></P><P>With "erroneus results" you probably mean that you did not expect nested matrices as result?</P><P></P><P>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.</P><P></P><P><IMG __jive_id="51288" class="jive-image-thumbnail jive-image" onclick="" alt="26.05.png" src="https://community.ptc.com/legacyfs/online/51288_26.05.png" width="450" /></P></BODY></HTML>Sun, 26 May 2013 16:45:28 GMThttps://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164114#M64314Werner_E2013-05-26T16:45:28ZRe: two functions that depend on vector variables are giving error results
https://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164115#M64315
<HTML><HEAD></HEAD><BODY><P>OK, and here is a simpler example.</P><P><IMG __jive_id="51296" class="jive-image" height="342" alt="26.05_2.png" src="https://community.ptc.com/legacyfs/online/51296_26.05_2.png" width="327" /></P><P></P><P>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.</P><P></P><P>In your file its the vector d consisting of ten eights which causes that mannerism in the definition of Delta.</P><P></P><P>One possible workaround is to make d a paremeter of your functions a sketched in the pic above.</P></BODY></HTML>Sun, 26 May 2013 17:11:40 GMThttps://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164115#M64315Werner_E2013-05-26T17:11:40ZRe: two functions that depend on vector variables are giving error results
https://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164116#M64316
<HTML><HEAD></HEAD><BODY><P>Thanks Werner,</P><P></P><P>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.</P><P>i tried to run the pi function below the f1s and g1s function and now it says "pattern match exception".</P><P>Do you know what that means?</P><P></P><P>thank you in advance,</P><P></P><P>Rogelio</P></BODY></HTML>Sun, 26 May 2013 18:54:14 GMThttps://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164116#M64316rdelascasas2013-05-26T18:54:14ZRe: two functions that depend on vector variables are giving error results
https://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164117#M64317
<HTML><HEAD></HEAD><BODY><P>Your function returns a complex value, which is not compatible with the infinite limit. </P></BODY></HTML>Sun, 26 May 2013 20:14:35 GMThttps://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164117#M64317RichardJ2013-05-26T20:14:35ZRe: two functions that depend on vector variables are giving error results
https://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164118#M64318
<HTML><HEAD></HEAD><BODY><P>it has worked for me in other cases of integrals with infinite limits, but i cannot find why it is not working now.</P><P>please, see attached file.</P><P>Is there any other way to do this kind of calculations?</P><P></P><P>thank you in advance,</P><P></P><P>rogelio</P></BODY></HTML>Sun, 26 May 2013 20:24:24 GMThttps://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164118#M64318rdelascasas2013-05-26T20:24:24ZRe: two functions that depend on vector variables are giving error results
https://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164119#M64319
<HTML><HEAD></HEAD><BODY><P>As you increase the limit the imaginary part converges very fast, so that's easy. The real part oscillates, but it's clear what it will converge to eventually. It seems you also have a non-convergence problem if the limit is too high (those exponential terms, I think). I don't know what level of accuracy you require.</P></BODY></HTML>Sun, 26 May 2013 20:45:28 GMThttps://community.ptc.com/t5/PTC-Mathcad/two-functions-that-depend-on-vector-variables-are-giving-error/m-p/164119#M64319RichardJ2013-05-26T20:45:28Z