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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Symbolics without making explicit a function

anthonyQueen
8-Gravel

Symbolics without making explicit a function

Still using MC 11.2, which (for me) is fine.

 

I was wonder if  a function which is not explicitly expressed, can be used in a symbolic operation. Maple and Mathematica I saw can do it quite well.

Below an example with derivatives.

Derivative_fail.png

 

 

It seems that only n.1. works while the others (I am in fact interested in a function f(y/x) do not. The n. 3. solution seems incomprehensible to me.

Does exist a trick to make possible to solve for instance function n.2 symbolically?

[[Sol: f(y/x)-[y*f'(y/x)]/x  ]]

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:anthonyQueen)

Since you're still using Mathcad 11, try using the diff() function symbolically.

It is available due to a backdoor to Maple functionality.

LucMeekes_0-1576674121496.png

Success!
Luc

View solution in original post

16 REPLIES 16
LucMeekes
23-Emerald III
(To:anthonyQueen)

Since you're still using Mathcad 11, try using the diff() function symbolically.

It is available due to a backdoor to Maple functionality.

LucMeekes_0-1576674121496.png

Success!
Luc

@LucMeekes Thanks,

apart saying that "diff" does something, I cannot find for equation n.2 [i.e. z=f(x/y)*x] the solution. I don't know even how to interpret "&where" and the various t1, etc.

As I said the solution should be the one I gave in the first post.

Just a note, in your picture numbers 1 and 3 take derivatives WRT y, but number 2 asks for the derivative WRT x.

>Just a note, in your picture numbers 1 and 3 take derivatives WRT y, but number 2 asks for the derivative WRT x.

 

Yes, I wanted just to try if there was a difference in processing the symbolic result to derive the variable at the nominator or at the denominator, guessing that the latter was much more difficult to handle.

 
 

LucMeekes
23-Emerald III
(To:anthonyQueen)

You give the differential equation you are trying to solve as: f(y/x)-[y*f'(y/x)]/x

Assuming the * is meant as multiplication, not as convolution, that is the same as: f(y/x)-(y/x)*f'(y/x)]

And that, after substition t=y/x, is the same as f(t)-t*f'(t). The solution for that DE is f(t)=c*t, or after reverse substition, f(y/x)=c*y/x, where c is to be determined by a constraint.

 

Success!
Luc

 

Hi,
you could do as in the photo:

A.Q. answer.jpg

 

@-MFra- 

One point, may be helpful to stress that makes my question diverge somewhat from your example. Writing f(y/x) does not necessarily mean that f(x,y):=y/x, but it means that whatever function f is, it is dependent from the compound variable y/x.

Hi,

I absolutely agree with you. Typically, in Mathcad, when defining a function, the arguments of the function are comma-separated variables and operators are not allowed. However, this is only possible when the function is already defined and a numerical value is desired.

You can see an application of the technique I suggested, in the attached example.

LucMeekes
23-Emerald III
(To:anthonyQueen)

"but it means that whatever function f is, it is dependent from the compound variable y/x"

 

Which in practical terms means: f is dependent on a single variable, also referred to as 'dummy parameter', e.g. t.

It is upon usage of the function that one can decide to supply y/x as the actual parameter, in other terms: that is substitution.

 

I should think that, also in mathematical terms you cannot define a function f(y/x), unless y/x by itself is identified as a single symbol. As in:

LucMeekes_0-1576777536539.png

And of course:

LucMeekes_0-1576777683955.png

but also:

LucMeekes_0-1576777784029.png

and, not surprisingly:

LucMeekes_0-1576777901378.png

 

 

Luc

@-MFra- @LucMeekes 

Thanks for the further clarification and (MFra) for the file. Congratulations for the latter. Most of it is foreign language for me.

The  use of f(y/x) instead of simply f(t) may be explained as follows. In many scientific fields you are interested to both F(x,y) and  f(y/x). A simple example. In economics you are interested in both Total Production, but also in Production per Worker. So if you make y=machinery(capital) and x=workers, you could write  Total Production using "F", and the production per worker using "f", which is F(y,x)/x=F(y/x,1)--> f(y/x). It is better to keep x separated from y, because you may want to know how production per worker reacts to the change of workers. If you merge x,y into "t", you cannot do that.

The  use of f(y/x) instead of simply f(t) may be explained as follows. In many scientific fields you are interested to both F(x,y) and  f(y/x). A simple example. In economics you are interested in both Total Production, but also in Production per Worker. So if you make y=machinery(capital) and x=workers, you could write  Total Production using "F", and the production per worker using "f", which is F(y,x)/x=F(y/x,1)--> f(y/x). It is better to keep x separated from y, because you may want to know how production per worker reacts to the change of workers. If you merge x,y into "t", you cannot do that.

 

I understand your comment.  In Mathcad you define a function with its operators.  If you define f(t) using t as a "dummy variable," with or without giving t a value, you can then evaluate f(y/x) for any instance where y and x have defined values--Mathcad will do the division and use that value to replace instances of t in f(t).

Separately you can define the ratio r = y / x and then calculate f (r).. Perhaps it is more understandable the small program, in the attached file, where only symbols are manipulated:

test 3+.giftest 3++.gif

Just tried with MC 15 (and curious to know what MCPrime does).

With v.15, at least to me, the result seems much clearer than v. 11.2, and it does not show an error.

Derivative_fail2.png

 

 


@anthonyQueen wrote:

 (and curious to know what MCPrime does).

You will love it!

One of the few good things in Prime is that they have implemented the prime symbol (f ') as a fully working operator (in MC15 and below it was only available in solve block with odesolve).

So the symbolic results makes use of it and displays like you expected.

In Prime 6 they introduced a new sombolic (friCAS) which is supposed to replace muPad in one of the next releases. From what was posted here in the forum this new symbolic is less capable than muPad (which in turn was much less capable than Maple in mathcad 11).

Nevertheless given your symbolic task even the new symbolic returns the desired result:

Werner_E_0-1576680997276.png

Much better than MC15 way to say f ' (y/x) which is

Werner_E_0-1576681331853.png

 

 

@Werner_E  Thanks again. Yes, here MCP does a good job.

@LucMeekes @-MFra- @Fred_Kohlhepp many thanks.

 

@LucMeekes in fact seems right to suggest the use of "diff" function, though in v.11.2 is not listed among "Function..." Insert menu.

Here, it is my understanding: the outcome is less clearer to understand than in v.15, but it works. I hope to have interpreted right.

Derivative_fail3.png

 

 

Top Tags