topic Re: Vector function in PTC Mathcad
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82440#M32504
<HTML><HEAD></HEAD><BODY><P>Mike,</P><P></P><P>All in all, I think you are lost. Those with unit problem is like this :</P><P>==> GrandPa, it's a 2 x3</P><P><== 2 what ? ...</P><P>==> Oh ! "meters" </P><P><== 3 what ?</P><P>==> ... "cm"</P><P><== How thick ?</P><P>==> very thin</P><P><== Yes, but thin like what ?</P><P>........................................</P><P></P><P>Your work sheet was all red 11, what color in 14 ?</P><P>It is a lot lot easier to exclude the unit system in the first place, whereas this procedure will accommodate all situations, rather than selecting the cases that work simple. To make it "layman", the unit system is limted to the "toy box", to be quick and practical. Take the cspline qs , no problem to add cm to the X vector and get the work sheet appear done well . NOT SO ! type S = and see the stupid 1/m² appended by the unit system ... S is essentially dimensionless. Next, try to spool the S to file <SPAN style="color: #ff0000;"><STRONG>"Must be dimensionless"</STRONG> </SPAN>so how can you spool to file a suite of the project .</P><P>In your red work sheet, what was the error message "Units don't match ... must be dimensionless" ? who cares because what is the unit of an index in that little for loop. In the second module "Algo in program", if you can't intoduce the unit system in the indexed loop, you can add it to the data table , fine but check the conversion is OK [I didn't] ... fine so far but can't spool to file. At this very same moment in the community, open the "Optical tweezer", c/w units. Works fine for display ... can't extract the data immediately because not in discrete form ... can't spool to file because of the unit in Z.</P><P>Worse is :::</P><P><SPAN style="font-size: 10pt;"></SPAN></P><P>"Now, do a numerical time integration of the force on the particle to get the velocity"</P><P>So, what do you get for the velocity ... Z(m) ... velocity is some length/some time.</P><P>Next. tabulate the independent variable ... no unit ... How come !</P><P>I'm no saying the project is wrong [I have no competence in that] but the resulting applied maths are no further exploitable than display, can't be saved in file . That puts us back to Maths are scalar and unitless, and back on the "Engineer design board" where all formulas are in the appropriate unit system as well as applicable codes. The unit system is usefull for the first time design of some physics, but as soon as proved correct, end of it, redo unitless as an exportable product.</P><P>Many collabs love to "band aid" projects with units.</P><P></P><P>jmG</P><P></P><P>____________________________</P><P></P><P>Two renewed problems with this community web:</P><P>1. past an unknown size of the compobox, the spell check is OFF.</P><P>2. past an unknown size of the compobox, the font formating is OFF.</P><P></P></BODY></HTML>Fri, 09 Jul 2010 13:37:36 GMTjeanGiraud2010-07-09T13:37:36ZVector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82417#M32481
HiI am trying to create a function which creates a vector and incorporates units, please see attached.The function currently works, but I want H_units to be calculated automatically if possible, with the user having to input the units.I have been playing with the parse numerical functionsThu, 03 May 2018 19:28:39 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82417#M32481MikeArmstrong2018-05-03T19:28:39ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82418#M32482
<HTML><HEAD></HEAD><BODY><P>Sorry, but I'm not sure I understand what you are trying to do. <IMG src="https://community.ptc.com/" />What do each of the arguments to vec_cw_unit represent? What should the calulation of H_units be based on?</P></BODY></HTML>Tue, 06 Jul 2010 10:55:43 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82418#M32482RichardJ2010-07-06T10:55:43ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82419#M32483
<HTML><HEAD></HEAD><BODY><P>Richard</P><P></P><P>Sorry my explanation us poor.</P><P></P><P>vec_cw_unit(L,H,H_units_,units) - </P><P></P><P>L = Low number of the vector (start)</P><P>H = High number in the vector (Stop)</P><P>H_units = Was added to remove the units from this input, as quite often I would define this above as in the worksheet, but the units have to be removed so the vector can be created.</P><P>units = this will define the vector in the chosen unit system.</P><P></P><P>I might be getting this wrong but I couldn't define the for loop inside the program without removing the units. </P></BODY></HTML>Tue, 06 Jul 2010 11:42:16 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82419#M32483MikeArmstrong2010-07-06T11:42:16ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82420#M32484
<HTML><HEAD></HEAD><BODY><P>Here are a few alternative ways of doing it.</P><P></P><P>Degrees are a bad choice for testing functions with units, because Mathcad does not consider them to be a unit.</P><P></P><P>You can't convert a string to a unit in MC12 or later, because of SUC. You are not allowed to have any function in which the returned units depend on the value of the arguments. Your str2unit2 function will only work in the trivial case of all the units being the same.</P></BODY></HTML>Tue, 06 Jul 2010 12:35:07 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82420#M32484RichardJ2010-07-06T12:35:07ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82421#M32485
<HTML><HEAD></HEAD><BODY><P>Your "program" is confusing. You're taking the difference of two variables, yet one variable is divided by some sort of unit, but not the other. This can only be the case if the other variable is unitless, in which case, Mathcad rightly would complain about your program, since you cannot plausibly take the difference between something that's dimensioned and something that's not.</P><P></P><P>The end goal appears to be to use something that's dimensioned as an index for something, but there may be other ways to deal with that. Perhaps you should describe what the actual calculation is supposed to be.</P><P></P><P>TTFN </P></BODY></HTML>Tue, 06 Jul 2010 19:44:19 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82421#M32485IRstuff2010-07-06T19:44:19ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82422#M32486
<HTML><HEAD></HEAD><BODY><P>"I am trying to create a function which creates a vector and incorporates units..."</P><P>__________________________________</P><P></P><P>No function creates a vector, the function that creates vector is the function itself,</P><P>in which function itself you plug the discretized argument ... multiply by the unit</P><P>of your choice = done .</P><P>Those things have circulated and circulate regularly.</P><P></P><P>jmG </P></BODY></HTML>Wed, 07 Jul 2010 04:57:02 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82422#M32486jeanGiraud2010-07-07T04:57:02ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82423#M32487
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P>Richard Jackson wrote:</P><P></P><P>Here are a few alternative ways of doing it.</P><P></P><P>Degrees are a bad choice for testing functions with units, because Mathcad does not consider them to be a unit.</P><P></P><P>You can't convert a string to a unit in MC12 or later, because of SUC. You are not allowed to have any function in which the returned units depend on the value of the arguments. Your str2unit2 function will only work in the trivial case of all the units being the same.</P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P>Cheers Richard,</P><P></P><P>Cheers for the examples. It seems my idea is a little pointless when the vector can simply be multiplied by the desired unit.</P><P></P><P>Regarding being told that MC12+ can't convert a string into a unit, because of SUC has just crushed my idea. Will have to carry on dividing by the individual variable's unit if that is inserted as one of the arguments used to create a vector.</P></BODY></HTML>Wed, 07 Jul 2010 06:38:06 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82423#M32487MikeArmstrong2010-07-07T06:38:06ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82424#M32488
<HTML><HEAD></HEAD><BODY><P>... this community site ends in lost worlds .</P><P>All that navigation/zigzaging is above my logic and patience.</P><P>Your answer is in "Usage" <SPAN style="color: #ff0000;"><STRONG>Algo in Program</STRONG> </SPAN></P><P></P><P>You just need the "units specialist" to complete.</P><P></P><P>jmG</P></BODY></HTML>Wed, 07 Jul 2010 06:59:18 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82424#M32488jeanGiraud2010-07-07T06:59:18ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82425#M32489
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P>jean Giraud wrote:</P><P></P><P>... this community site ends in lost worlds .</P><P>All that navigation/zigzaging is above my logic and patience.</P><P>Your answer is in "Usage" <SPAN style="color: #ff0000;"><STRONG>Algo in Program</STRONG> </SPAN></P><P></P><P>You just need the "units specialist" to complete.</P><P></P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P></P><P> Jean,</P><P></P><P>I'm not sure what you getting at. What does Algo in Program mean?</P><P></P><P>Mike</P></BODY></HTML>Wed, 07 Jul 2010 07:11:00 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82425#M32489MikeArmstrong2010-07-07T07:11:00ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82426#M32490
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P>jean Giraud wrote </P><P></P><P>in which function itself you plug the discretized argument ... multiply by the unit</P><P>of your choice = done .</P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P></P><P>I didn't know that M14 didn't have the ability to independently take units away from a variables and that strings cannot be changed into units.</P><P></P><P>I have stated above in my reply to Richard that my idea seems unachievable and your suggestion seems more valid.</P><P></P><P>Mike</P></BODY></HTML>Wed, 07 Jul 2010 07:25:12 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82426#M32490MikeArmstrong2010-07-07T07:25:12ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82427#M32491
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P>MIke Armstrong wrote:</P><P></P><P>Regarding being told that MC12+ can't convert a string into a unit, because of SUC has just crushed my idea. Will have to carry on dividing by the individual variable's unit if that is inserted as one of the arguments used to create a vector.</P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P>Well, I really overstated that limitation. You can convert a string to a unit. You can even create a function that returns different units depending on the input string. What you cannot do is create a function that returns different units that have different dimensions. I see you pulled that function from Stuart's worksheet:</P><P></P><P><A _jive_internal="true" href="/servlet/JiveServlet/download/135734-16035/collab - parse numeric string with units 01.mcd">http://communities.ptc.com/servlet/JiveServlet/download/135734-16035/collab%20-%20parse%20numeric%20string%20with%20units%2001.mcd</A></P><P></P><P>which is in this thread:</P><P></P><P><A _jive_internal="true" href="https://community.ptc.com/message/135734#135734">http://communities.ptc.com/message/135734#135734</A></P><P></P><P>You will notice that the dimensions of the units are never mixed.</P><P></P><P>There is also the possibility to circumnavigate SUC and assign a variable with units based on a text string using a scripted component. See Stuart's second worksheet in the thread above or the original component from Tom in this thread:</P><P></P><P><A _jive_internal="true" href="https://community.ptc.com/message/58289#58289">http://communities.ptc.com/message/58289#58289</A></P><P></P><P>The big restriction on the use of this technique is that you must modify an existing math region. You can't create a new one. It is also not backward comptible with any version prior to 12.</P><P></P><P>So whether it is possible to do what you want depends on exactly what you are trying to do. If you can provide a more detailed description of the end goal maybe I can point the way to a solution (or maybe not).</P></BODY></HTML>Wed, 07 Jul 2010 13:18:51 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82427#M32491RichardJ2010-07-07T13:18:51ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82428#M32492
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P>Richard Jackson wrote:</P><P><A _jive_internal="true" href="https://community.ptc.com/message/58289#58289">Defining Variable</A></P><P style="min-height: 8pt; padding: 0px;"></P><P>The big restriction on the use of this technique is that you must modify an existing math region. You can't create a new one. It is also not backward comptible with any version prior to 12.</P><P style="min-height: 8pt; padding: 0px;"></P><P>So whether it is possible to do what you want depends on exactly what you are trying to do. If you can provide a more detailed description of the end goal maybe I can point the way to a solution (or maybe not).</P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P>I have had many problems with this in the past.</P><P></P><UL><LI>As an Engineer many of my calculations have different units, so with M14 not allowing mixed unit arrays each of the variables have to be divided by it's unit in order to create a results table. Usually I pass the results to Excel, but again I have to divide each of the variables by its unit.<BR /></LI><LI>The other problem is when creating a vector and using a pre defined varible as one of the argument which has units, as in my first post the user has to divide that by the corresponding unit or manually put the number in.<BR /></LI></UL><P></P><P>Please see attached for an explanation on both.</P></BODY></HTML>Wed, 07 Jul 2010 14:31:41 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82428#M32492MikeArmstrong2010-07-07T14:31:41ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82429#M32493
<HTML><HEAD></HEAD><BODY><P>Well, your first example will not work because you have passed the function a value of N that has units. Then you subtract 1 from it, and you can't add or subtract quantities with different units. But if N is supposed to be a number (and in fact it has to be an integer, because it's the upper limit of a loop variable that is used to index a vector) then why are you putting units on it in the first place?</P><P></P><P>For your second example, no, there is no automatic workaround. A quantity in Mathcad is stored as a numeric value, expressed in SI units, with a dimension. The original units used to define the variables are not stored. So if I write</P><P></P><P>A:=1*ft</P><P>B:=1*lb</P><P>C:=A*B</P><P></P><P>Then C has the numeric value 0.138 and the dimensions L*M. You can automatically get the unitless value 0.138 by dividing C by UnitsOf(C) (which are given as m*kg), but there is no way to automatically divide by ft*lb to get 1. If you want to do that you must do it explicitly.</P></BODY></HTML>Wed, 07 Jul 2010 19:40:58 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82429#M32493RichardJ2010-07-07T19:40:58ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82430#M32494
<HTML><HEAD></HEAD><BODY><P> You have too long an explanation of your misery about units. Use the basic unitless engineering formula(s), as given in their original unit system, then append your client unit system. Doing so, i.e: not carrying units in calculations, the entire work is traceable in both versions ... unitless then converted. An augmented data table can't obviously support mixed units per columns, but a nested data table should. Add these little demo to the function I have passed for you "Algo in Program"</P><P></P><P>jmG</P></BODY></HTML>Thu, 08 Jul 2010 05:38:16 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82430#M32494jeanGiraud2010-07-08T05:38:16ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82431#M32495
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P>Richard Jackson wrote:</P><P></P><P>Well, your first example will not work because you have passed the function a value of N that has units. Then you subtract 1 from it, and you can't add or subtract quantities with different units. But if N is supposed to be a number (and in fact it has to be an integer, because it's the upper limit of a loop variable that is used to index a vector) then why are you putting units on it in the first place</P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P></P><P>It was an example of trying to create a vector with the same number of elements as L.pipe, without having to type the numerical value and divide by the units of L.pipe - I knew it wouldn't work I was just trying to explain my method in my madness.</P><P></P><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P>Richard Jackson wrote:</P><P></P><P>For your second example, no, there is no automatic workaround. A quantity in Mathcad is stored as a numeric value, expressed in SI units, with a dimension. The original units used to define the variables are not stored. So if I write</P><P></P><P>A:=1*ft</P><P>B:=1*lb</P><P>C:=A*B</P><P></P><P>Then C has the numeric value 0.138 and the dimensions L*M. You can automatically get the unitless value 0.138 by dividing C by UnitsOf(C) (which are given as m*kg), but there is no way to automatically divide by ft*lb to get 1. If you want to do that you must do it explicitly.</P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P></P><P>I understand now, I'm just a little disappointed that there isn't a workaround, or Mathcad won't hold the units.</P><P></P><P>Just one of those things.</P><P></P><P>Cheers for the help.</P><P></P><P>Mike</P></BODY></HTML>Thu, 08 Jul 2010 06:48:01 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82431#M32495MikeArmstrong2010-07-08T06:48:01ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82432#M32496
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P>jean Giraud wrote:</P><P></P><P>You have too long an explanation of your misery about units. Use the basic unitless engineering formula(s), as given in their original unit system, then append your client unit system. Doing so, i.e: not carrying units in calculations, the entire work is traceable in both versions ... unitless then converted. An augmented data table can't obviously support mixed units per columns, but a nested data table should. Add these little demo to the function I have passed for you "Algo in Program"</P><P></P><P>jmG </P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P><BR />I am trying to get my head round what your worksheet "Algo in Program" is achieving.</P><P></P><P>The reason for the use of Mathcad is becuase of its ability to handle units. If I wanted to work through calculations unitless I could use a Excel or similiar software.</P></BODY></HTML>Thu, 08 Jul 2010 07:19:39 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82432#M32496MikeArmstrong2010-07-08T07:19:39ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82433#M32497
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P>MIke Armstrong wrote:</P><P></P><P>It was an example of trying to create a vector with the same number of elements as L.pipe, without having to type the numerical value and divide by the units of L.pipe - I knew it wouldn't work I was just trying to explain my method in my madness.</P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P>But what is the number of elements that corresponds to the length of the pipe? It depends on the units of measurement. If the unit you are interested in using happens to be the base SI unit, in this case m, then you can divide by UnitsOf(Lpipe) and round the result to get an integer. If it's any other unit then you have to tell Mathcad what unit you want. Even if the units used to define the variable were stored it would not always be possible for Mathcad to know what you want. Suppose you define the pipe length in m and the diameter in cm and then calculate the volume. What unit to use if you want the same number of elements as the volume of the pipe?</P></BODY></HTML>Thu, 08 Jul 2010 14:36:12 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82433#M32497RichardJ2010-07-08T14:36:12ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82434#M32498
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD><P>Richard Jackson wrote:</P><P></P><P>But what is the number of elements that corresponds to the length of the pipe? It depends on the units of measurement. If the unit you are interested in using happens to be the base SI unit, in this case m, then you can divide by UnitsOf(Lpipe) and round the result to get an integer. If it's any other unit then you have to tell Mathcad what unit you want. Even if the units used to define the variable were stored it would not always be possible for Mathcad to know what you want. Suppose you define the pipe length in m and the diameter in cm and then calculate the volume. What unit to use if you want the same number of elements as the volume of the pipe?</P></TD></TR></TBODY></TABLE></BLOCKQUOTE><P></P><P>It seems like this thread is dead. My idea doesn't seem to be applicable or valid. Just bugs me when I get an idea and it can't be done.</P><P></P><P>Cheers for all the help, much appreciated.</P><P></P><P>Mike</P></BODY></HTML>Thu, 08 Jul 2010 15:20:00 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82434#M32498MikeArmstrong2010-07-08T15:20:00ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82435#M32499
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD>Just bugs me when I get an idea and it can't be done.</TD></TR></TBODY></TABLE></BLOCKQUOTE><P></P><P>I don't think you are alone in that respect</P><P></P><P><IMG alt="big_grin.gif" class="jive-image" src="https://community.ptc.com/legacyfs/online/1772_big_grin.gif" /></P></BODY></HTML>Thu, 08 Jul 2010 15:31:45 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82435#M32499RichardJ2010-07-08T15:31:45ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82436#M32500
<HTML><HEAD></HEAD><BODY><P>I am trying to get my head round what your worksheet "Algo in Program" is achieving.</P><P></P><P>The reason for the use of Mathcad is becuase of its ability to handle units. If I wanted to work through calculations unitless I could use a Excel or similiar software.</P><P>I am trying to get my head round what your worksheet "Algo in Program" is achieving.</P><P></P><P>The reason for the use of Mathcad is becuase of its ability to handle units. If I wanted to work through calculations unitless I could use a Excel or similiar software.</P><P>__________________________________</P><P></P><P>Mathematics are two things essentially:</P><P>1. Scalar</P><P>2. Unitless</P><P>So is Mathcad = scalar and unitless.</P><P>On one side you have the engineering formula(s), unitless c/w the corresponding constants in the system of the originator ... that you first convert if required. Then you carry the entire project unitless and the result is in the "Engineering system of unit" . At this point and only at this point the "Mathcad Unit System" may come into play for your client ... for instance : I read "Hg from the transmitter [the closest unspoiled process variable] ... I apply Jo Blo engineering formula , but my client wants it in MPa ... then just plug the Mathcad "Unit definer" and it converts to MPa.</P><P>That is too simple ! In real Engineering life you will be faced with more calculations and functions, functions that may support units [Given/Find] , but also functions that are purely in "scalar unitless" [root]. Mathcad carrying units is only valid in short sequences not involving solvers , that does not go far. More and more, clients/subcontracts have to comply to codes [ISO ....] which you carry as given, i.e: unitless then convert to meet local unit systems like the US imperial.</P><P>The "Algo in Program" is the generalised "vector function" . It passes the list of functions, that you can treat internally or simply as a new global function generator that is in discrete mode for the argument. The "sacalar argument" in the list of function is not a scalar argument anymore, but a "discrete argument" . The final data table is unitless, and you convert each column in the "UserUnitSystem" .</P><P></P><P>If you work in pure physics and use only little functions like integrals, derivatives ... or relationist formulas, you can carry unit [though not needed] . But as soon as you work in Engineering, the formulas are not as pure and simply "engineering algoritms" . What comes out from what you put in is already in the appropriate units, by the design of the algorithm. From °C and P of steam you get the kg/m³. Apart the logical and memory functions, a computing machinery performs no more maths than the 4 AOPS [Arithmetic Operations] +,-,*,/ ,,, besides these 4, your box and no matter how big it is , your box is empty. It just has instructions to collect the right asembly of [+,-,*,/] to get exp(1.234567890987654321).</P><P></P><P>Keep visiting the "Mathcad Usage", it's where the good stuff is [generally].</P><P></P><P>jmG</P><P></P><P>...............................</P><P></P><P>What's going on ?</P><P>It does not want to spell check !</P></BODY></HTML>Thu, 08 Jul 2010 17:34:49 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82436#M32500jeanGiraud2010-07-08T17:34:49ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82437#M32501
<HTML><HEAD></HEAD><BODY><P>Pleaseeeeee. Not again!</P><P><IMG alt="DeadHorse.gif" class="jive-image" src="https://community.ptc.com/legacyfs/online/1780_DeadHorse.gif" /></P></BODY></HTML>Thu, 08 Jul 2010 17:48:55 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82437#M32501RichardJ2010-07-08T17:48:55ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82438#M32502
<HTML><HEAD></HEAD><BODY><P> Good point. I take it your against the use of units throughout worksheets.</P><P></P><P>Your example seems the only valid option to original problem.</P><P></P><P>Mike</P></BODY></HTML>Fri, 09 Jul 2010 06:47:58 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82438#M32502MikeArmstrong2010-07-09T06:47:58ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82439#M32503
<HTML><HEAD></HEAD><BODY><P> Do you mean the UNIT ARGUMENT.......</P></BODY></HTML>Fri, 09 Jul 2010 06:49:04 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82439#M32503MikeArmstrong2010-07-09T06:49:04ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82440#M32504
<HTML><HEAD></HEAD><BODY><P>Mike,</P><P></P><P>All in all, I think you are lost. Those with unit problem is like this :</P><P>==> GrandPa, it's a 2 x3</P><P><== 2 what ? ...</P><P>==> Oh ! "meters" </P><P><== 3 what ?</P><P>==> ... "cm"</P><P><== How thick ?</P><P>==> very thin</P><P><== Yes, but thin like what ?</P><P>........................................</P><P></P><P>Your work sheet was all red 11, what color in 14 ?</P><P>It is a lot lot easier to exclude the unit system in the first place, whereas this procedure will accommodate all situations, rather than selecting the cases that work simple. To make it "layman", the unit system is limted to the "toy box", to be quick and practical. Take the cspline qs , no problem to add cm to the X vector and get the work sheet appear done well . NOT SO ! type S = and see the stupid 1/m² appended by the unit system ... S is essentially dimensionless. Next, try to spool the S to file <SPAN style="color: #ff0000;"><STRONG>"Must be dimensionless"</STRONG> </SPAN>so how can you spool to file a suite of the project .</P><P>In your red work sheet, what was the error message "Units don't match ... must be dimensionless" ? who cares because what is the unit of an index in that little for loop. In the second module "Algo in program", if you can't intoduce the unit system in the indexed loop, you can add it to the data table , fine but check the conversion is OK [I didn't] ... fine so far but can't spool to file. At this very same moment in the community, open the "Optical tweezer", c/w units. Works fine for display ... can't extract the data immediately because not in discrete form ... can't spool to file because of the unit in Z.</P><P>Worse is :::</P><P><SPAN style="font-size: 10pt;"></SPAN></P><P>"Now, do a numerical time integration of the force on the particle to get the velocity"</P><P>So, what do you get for the velocity ... Z(m) ... velocity is some length/some time.</P><P>Next. tabulate the independent variable ... no unit ... How come !</P><P>I'm no saying the project is wrong [I have no competence in that] but the resulting applied maths are no further exploitable than display, can't be saved in file . That puts us back to Maths are scalar and unitless, and back on the "Engineer design board" where all formulas are in the appropriate unit system as well as applicable codes. The unit system is usefull for the first time design of some physics, but as soon as proved correct, end of it, redo unitless as an exportable product.</P><P>Many collabs love to "band aid" projects with units.</P><P></P><P>jmG</P><P></P><P>____________________________</P><P></P><P>Two renewed problems with this community web:</P><P>1. past an unknown size of the compobox, the spell check is OFF.</P><P>2. past an unknown size of the compobox, the font formating is OFF.</P><P></P></BODY></HTML>Fri, 09 Jul 2010 13:37:36 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82440#M32504jeanGiraud2010-07-09T13:37:36ZRe: Vector function
https://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82441#M32505
<HTML><HEAD></HEAD><BODY><P><IMG alt="DeadHorse.gif" class="jive-image" src="https://community.ptc.com/legacyfs/online/1832_DeadHorse.gif" /></P></BODY></HTML>Fri, 09 Jul 2010 15:08:49 GMThttps://community.ptc.com/t5/PTC-Mathcad/Vector-function/m-p/82441#M32505RichardJ2010-07-09T15:08:49Z