## How to handle piecewise defined matrix valued func...

Hi,

I have some matrix valued functions that that I can only define piecewise. Unfortunately I have some problems to manipulate those functions. Piecewise sees to do the job for  scalar valued functions. There I can easily differentiale and add results. For Matrix valued functions however, those features seem to not be availible.

I can work around these limitations by manually applying all operations to the operands of the piecewise function. Like I show here:

 > restart:
 > # a piecewise function
 > p1:=piecewise(a(t)^2=0,,<1,1/a(t)>)
 (1)
 > # differentiation does not work
 > diff(p1,t)
 (2)
 > # selecting individual entries does not work
 > r:=p1(1)+1
 (3)
 > # strange simplification behaviour
 > simplify(p1)
 (4)
 > # current workaround, define new piecewise function by using op
 > r:=piecewise(op(1,p1),op(2,p1)(1)+1,op(3,p1)(1)+1)
 (5)
 >

I think my workaround is very cumbersome and error prone. Is there a better way to tackle this probem? Or should I try to overload all needed operations, and is this even possible?

Thanks for all suggestions!

Honigmelone

## Making a function which is the derivative of anoth...

I am relatively new to maple and am using it for a multivariate calculus class.

I want to define a function g(x,y) which is the derivative of f(x,y).

I am trying:

which is my function, and

which should be the derivative.

When I try g(x,y) I get

but when I try to put numerical values in the first argument, (eg: f(1,y) I get

"Error, (in g) invalid input: diff received 1, which is not valid for its 2nd argument"
Any tips?

## DEtools/DEplot/CheckDE) derivatives must be given ...

subs can not make diff(1, t) = 0

sys := simplify(subs(diff(1,t)=0,subs(c(t)=1,[ode1a,ode3a])));
sys := [diff(a(t), t) = 1.342398800*10^5*a(t)+89591*b(t)+44647, 44647*a(t)+44902*b(t)+44859];

DEplot(sys, [a(t), b(t)], t = 0 .. 16, a = -16 .. 16, b = -16 .. 16, color = magnitude, title = Stable Limit Cycles, arrows = curve, dirfield = 800, axes = none);
Error, (in DEtools/DEplot/CheckDE) derivatives must be given explicitly

why can not plot?

## help with content of uploaded worksheet...

please see the attached worksheet and assist me with understanding why these unusual results are computed.

 >
 >

## prime notation setup changed in Maple 2017...

Not sure if this is documented explicitly to Maple users, but normally (prior to Maple 2017) interface(typesetting=extended) was all that was required to output display diff(y(x),x) as y'(x)

With Maple 2017 typesetting=extended is default and one must use with(Typesetting)  Settings(typesetprime=true) in order to output the display of diff(y(x),x) as y'(x).

Perhaps this is well documented somewhere, however I was unable to find the change.

## make latex() generate y'(x) for diff(y(x),x) ?...

I know the latex() command in Maple have many issues and I have no hope of what I will ask having a solution, but thought to ask any way.

Is there a way to make maple generate the latex for all the derivatives to use ' instead of d/dx ?

for example, given this

ode:=diff(y(x),x)=x;
latex(ode,output=string);


The Latex generated (which is correct) is

{\frac {\rm d}{{\rm d}x}}y \left( x \right) =x

but sometines I find it more readable if the latex was

y'(x)=x

which is more common in textbooks and other places. The problem also is that I am using worksheet so can't use  y'(x) as input.

But even switching to document mode, and writing it 2D math as input, the Latex output still does not match the input

So if there is a solution to this, would it require changing the latex() command itself? or can it be done at user level?

I'd like all orders of derivatives anywhere in the equation to come out as y'' etc.. so diff(y(x),x\$3) should generate the latex y'''(x) and so on.

Is there a trick to do this?

Maple 2017.2

## Is there a way to have diff(f,...) with f a symbol...

Hello,

I'm trying to write and simplify expressions involving partial derivatives of an arbitrary function, say f(x,y).

Specifically, I would like  to evaluate to , instead of

And  gives the same result.

Interestingly,  does evaluate to , as expected.

I could get some results by using a custom differentiation function

diff/f := proc(x,y,v)
if v = x then return D[1](f)(v,y):
elif v = y then return D[2](f)(x,v):
else return 0: # is there a fallback I can use without risking infinite recursion?
fi:
end proc:

and it works for the simple case, but now  does not work.

All this makes me feel that there must be a way to get what I want by default, but I can't figure it out.

Is there? Thank you in advance!

## Problem with instruction subs of Maple...

Hi, i have a problem with subs instruction. I'd like to change a function D(s) with symbol d/ds d(t), but i won't to calculate derivate, I want only change symbol. Thanks a lot.

## How can I group certain variables and integers of ...

I'm still quite new to maple and I'm working calculating some dynamic equations.

I want to be able to selectively group certain variables or numbers depending on how I need the equations to be showed, I don't know if that's possible, I´ll explain further.

In typewritting extended format one equation is shown like this:

And maple standard:

The fisrt thing I want is to show the time derivatives in the dot representation, but I also want the 1/2 multiplyting each term of the whole equation like in the maoke standard format.

I also need to group certain variables in some other equations I have and I was wondering if there is a way to do this.

## Why do I obtain a wrong answer using diff()?...

Since I am a very recent Maple user, I do not know why I obtained a wrong answer with the following two comands:

Exp:= Psi(rho(x,t),theta(x,t));
Psi(rho(x, t), theta(x, t))
Exp1:= diff(Exp,t);
/ d           \
|--- rho(x, t)| D[1](Psi)(rho(x, t), theta(x, t))
\ dt          /

/ d             \
+ |--- theta(x, t)| Psi(rho(x, t) + 1, theta(x, t))
\ dt            /

Thank you.

## Partial derivative of multivariable function using...

Problem.mw

Hi,

I want to know the partial derivative of

where

in order to

ρ

If I write

I obtain this

which is incorrect  since I did not have any indexes in sigma. However if I do this next command the result seems correct although no substituion of rhocrf

What I would like to obtain was the solution in order to rho and not to rhocrf and additionally having the result as a summation over p and q and not the extended result. How should I write it in Maple then?

Thank you very much!

## How to collapse derivatives?...

Let

z := Diff(x(t),t)*y(t) + x(t)*Diff(y(t),t);

Is there a way to tell Maple to collapse that into Diff(x(t)*y(t), t) ?

I tried factor, combine, simplify, but none of them worked.

## Error, (in eval/diff) invalid input: diff received...

hi .in substuting in ode equation i encounter with error

Error, (in eval/diff) invalid input: diff received (f1[i+1, i]-2*f1[i, i]+f1[i-1, i])/h^2, which is not valid for its 2nd argument

thanksh_2.5_eq4.mw

 (1)

 (2)

 (3)

## How to convert a huge expression from Maple to Mat...

Dear all:

I have used the "diff" command in Maple to help me derive a huge and very long function, and now I want to convert this huge expression from Maple to Matlab format, for example, into a Matlab .m file. The format of this expression in Maple is very different from Matlab.

So could you help me with this problem?

Thank you all.

## an error occurred, diff received 0...

Hello, I have a function defined as

g :=  (x, y)->diff(u1(x, y), x, x)+diff(u2(x, y), x, y).

I want to define another function as follows

f :=  (y) ->subs(x = 0, g(x, y)) ,

Now, when I want to calculate numerical values for the new function f(0), f(0.1), f(0.2),..... and so on. The following massage appear

Error, (in f) invalid input: diff received 0, which is not valid for its 2nd argument.

What is the problem here.

Amr

 1 2 3 4 5 6 7 Last Page 1 of 13
﻿