zorg

10 Reputation

One Badge

8 years, 257 days

MaplePrimes Activity


These are replies submitted by zorg

Thank you so much.

I never realised that "Text" does not mean text as in no math evaluation but simply another way of how to enter information or how to display the input (by "Text" i am referring to the button in the top left corner next to "Math"). That is why i never considered "maple notation" or 1-D Math as a valid input that can be evaluated.

The things your learn...

@Carl Love 

Thank you very much for your quick reply. While this approach solves the issue of assigning a unit to an unknown function it does not quite do it for me.

First of all I will state the problem and secondly elaborate in more detail on why i am interested in such a solution and why this particular solution won't do it.

 

Since diff is overloaded i get an error when i add this line to your code (I am sorry for not adding 2-D maple code to my post but i get the error "invalid maple expression" when i click on the symbol and try to enter the expression and insert it):

> diff(x(t)*y(r), y(r))

trying to run this additional line fails due to
" Error, (in Units:-Standard:-diff) wrong number (or type) of parameters in function Units:-Standard:-diff "

I guess this is because the function y(r) has no unit and thus the overloaded diff() fails.

If I try to run this code:

> y := (r) -> 'procname' *Unit(1):
> diff(x(t)*y(r), y(r))

the diff() evaluates as expected to

> x(t)*Unit('m')

While this is a possible work around i am looking for a neater solution (for assigning the unit to x(t) and t and for "fixing" the diff() call with y(r)). Due to too many occurances I can neither change the call of diff(x(t),t) to diff(x(t),t()) nor brake the call of diff(x(t)*y(r), y(r)) and fix it with my approach.

 

Here is why:

I am confronted with a rather large set of differential algebraic equations (about 130 equations with the same amout of time dependent parameters like x(t), dx(t)/dt and a few unknown functions like y(r)) that contain a few mistakes. While i do understand most of those equations (and thus can make sure they are correct) there are a few equations that seem wrong. Due to the large amount of parameters the equations are hard to read and therefore difficult to interpret. My first approach to inspect the equations is to check if the used units make sense and are consistent (this is in my case a lot easier to interpret and will greatly reduce the time needed to finding errors).

An example: I have an equation whose result has a unit of work (e. g. Joule). The equation is a sum of many smaller equations but since the result has to have unit joule every summand has to have unit joule as well. If units where to be shown in every small equation i could make sure that they are at least not complete rubbish.

Since i have this worksheet with many equations i need a solution where i do not have to change enormous amounts of code. I can easily make assumptions or something similar like renaming or creating an alias for x(t) but I can not make changes to functions like y(r) and i can not edit other function calls (like diff( ) ).

 

I am looking forward to further ideas.

Thanks to everyone who gives this some thought.

Page 1 of 1