Items tagged with diff

Hi everybody;

I have a problem with Physics[diff] command. When I run the following code, error messages appear where the Physics[diff] command exist. What is the source of error? How can I fix it?

Thanks in advance

Q1.mw

I wish to define a function which is the derivative of another function.

> f:=(x)->x^2:

> g:=(x)->diff(f(x),x):

> g(x);

2 x

> f(2);

4

> g(2);
Error, (in g) invalid input: diff received 2, which is not valid for its 2nd argument

 

I cannot find a way in which I can define the function g, using the functional operator, so that I can actually evaluate g(x).

 

How can I do this?

 

#Hello people in Mapleprimes,

#After

restart;interface(typesetting=extended);

diff(f(x),x);

#shows f'(x).

#But,

diff(f(t1),t1);

#shows just df(t1)/dt1, not f'(t).

#Can't I show f'(t1) not df(t1)/dt1?

#Is this a way peculiar to Maple?

#I hope someone could give me some hints.

 

#Best wishes.

#taro

 

 

 

 

hi 

how i can apply this differential in maple?

thabks...

 

Hello,

I need to crate a function to be evaluated in a range of values, and this function i would to use in other expression, example:

cel1      "seq(i,i=0.001..2,0.001)"

cel2      "A:=&1";cel1

cel3      "f:=x->diff(KelvinBei(0,x),x)"

cel4      ""B:=map(x->f(x),[A])"

 

This is ok with a lot of function but with diff(KelvinBei(0,x),x) in cel4 show this error "Error,(in f) invalid input:.1e-2, which is not valid for its 2nd argument.

Why??? How can I do??

Hey all,

I want to symbolically differentiate a function and recalculate the result later. Here is what I have tried so far:


restart;

myexp:=dfdb+sthlong

dfdb+sthlong

(1)

b:=<b1(t),b2(t)>;

b := Vector(2, {(1) = b1(t), (2) = b2(t)})

(2)

dfdb:=Physics[diff]~(f(b),b)

dfdb := Vector(2, {(1) = (D(f))(Vector(2, {(1) = b1(t), (2) = b2(t)})), (2) = (D(f))(Vector(2, {(1) = b1(t), (2) = b2(t)}))})

(3)

f:=b->b(1)^2+b(2)

proc (b) options operator, arrow; b(1)^2+b(2) end proc

(4)

eval(myexp);  #actual result

 

 

sthlong+(Vector(2, {(1) = (D(f))(Vector(2, {(1) = b1(t), (2) = b2(t)})), (2) = (D(f))(Vector(2, {(1) = b1(t), (2) = b2(t)}))}))

(5)

dfdb:=Physics[diff]~(f(b),b):

eval(myexp); #expected result

sthlong+(Vector(2, {(1) = 2*b1(t), (2) = 1}))

(6)

 


Download physics_diff.mw

I wonder if this is even possible, or if I missunderstand something. Can you please help me?

 

Thanks

 

Honigmelone

Hello,

 

I'm modeling the simple DC motor system in Maple.
The equations describing the system;

eq1:=J*diff(theta(t),t,t)+b*diff(theta(t),t)=K*i(t):
eq2:=L*diff(i(t),t)+R*i(t)=V(t)-K*diff(theta(t),t):
DCMotor:=[eq1,eq2];

First, I create the system using DiffEquation:

Sys:=DiffEquation(DCMotor,[V(t)],[theta(t)]);

And now I have problem. The input var is V(t) (input voltage) and the output var is theta(t) (position of the rotor).

But I wont to have in output var not position of the rotor but speed of the fotor - diff(theta(t),t)

How to set output var for diff(theta(t),t) (the speed of the motor)?

 

Best

Rariusz

 

Hi

 

I am new to Maple and discovering its features. I was wondering whether it is possible to define a function abstractly, say:

fo:=f(1/x)

and differentiate it, to obtain f'(1/x) (-1/x^2)? Is this possible?

 

Thanks!

Hello :-),

 

How can I differentiate the follwing function:

Cq = Cao*k1*t / [(1+k1*t)*(1+k2*t)]

If want to find the maximum:

dCq/dt = 0

I can solve if of course by hand. The solution is t=1/sqrt(k1*k2)

I tried it with maple, but I got a strange result (see picture). How can I use maple to get the right result?

 

Thank you very much!

 

Dear All

How can we collect coefficient wrt certain differential ration in an expression?

See for detail:


with(PDEtools):

u := a[0]+a[1]*(diff(phi(xi), xi))/phi(xi)

a[0]+a[1]*(diff(phi(xi), xi))/phi(xi)

(1)

-k*(diff(u, `$`(xi, 2)))+alpha*(diff(u, `$`(xi, 3)))

-k*(a[1]*(diff(diff(diff(phi(xi), xi), xi), xi))/phi(xi)-3*a[1]*(diff(diff(phi(xi), xi), xi))*(diff(phi(xi), xi))/phi(xi)^2+2*a[1]*(diff(phi(xi), xi))^3/phi(xi)^3)+alpha*(a[1]*(diff(diff(diff(diff(phi(xi), xi), xi), xi), xi))/phi(xi)-4*a[1]*(diff(diff(diff(phi(xi), xi), xi), xi))*(diff(phi(xi), xi))/phi(xi)^2+12*a[1]*(diff(diff(phi(xi), xi), xi))*(diff(phi(xi), xi))^2/phi(xi)^3-3*a[1]*(diff(diff(phi(xi), xi), xi))^2/phi(xi)^2-6*a[1]*(diff(phi(xi), xi))^4/phi(xi)^4)

(2)

expand(dsubs(diff(phi(xi), `$`(xi, 2)) = -lambda*(diff(phi(xi), xi))-mu*phi(xi), -k*(a[1]*(diff(diff(diff(phi(xi), xi), xi), xi))/phi(xi)-3*a[1]*(diff(diff(phi(xi), xi), xi))*(diff(phi(xi), xi))/phi(xi)^2+2*a[1]*(diff(phi(xi), xi))^3/phi(xi)^3)+alpha*(a[1]*(diff(diff(diff(diff(phi(xi), xi), xi), xi), xi))/phi(xi)-4*a[1]*(diff(diff(diff(phi(xi), xi), xi), xi))*(diff(phi(xi), xi))/phi(xi)^2+12*a[1]*(diff(diff(phi(xi), xi), xi))*(diff(phi(xi), xi))^2/phi(xi)^3-3*a[1]*(diff(diff(phi(xi), xi), xi))^2/phi(xi)^2-6*a[1]*(diff(phi(xi), xi))^4/phi(xi)^4)))

-a[1]*(diff(phi(xi), xi))*alpha*lambda^3/phi(xi)-a[1]*alpha*lambda^2*mu-7*a[1]*(diff(phi(xi), xi))^2*alpha*lambda^2/phi(xi)^2-8*a[1]*(diff(phi(xi), xi))*alpha*lambda*mu/phi(xi)-a[1]*(diff(phi(xi), xi))*k*lambda^2/phi(xi)-2*a[1]*alpha*mu^2-a[1]*k*lambda*mu-12*a[1]*(diff(phi(xi), xi))^3*alpha*lambda/phi(xi)^3-8*a[1]*(diff(phi(xi), xi))^2*alpha*mu/phi(xi)^2-3*a[1]*(diff(phi(xi), xi))^2*k*lambda/phi(xi)^2-2*a[1]*(diff(phi(xi), xi))*k*mu/phi(xi)-6*a[1]*(diff(phi(xi), xi))^4*alpha/phi(xi)^4-2*a[1]*(diff(phi(xi), xi))^3*k/phi(xi)^3

(3)

How ca extract coefficients of fraction (diff(phi(xi), xi))/phi(xi) in (3) ????


Download Coefficients_of_Fractions.mw

Regards

diff(a(t), t) = diff(a(t), t);
diff(b(t),t) = 0;
diff(c(t),t) = -b(t)/a(t);

[diff(rhs(sol[1][2]), a(t)),diff(rhs(sol[1][2]), b(t)),diff(rhs(sol[1][2]), c(t))];
Error, (in VectorCalculus:-diff) invalid input: diff received a(t), which is not valid for its 2nd argument

 

 

question1 := b(t)*(diff(c(t), t))*(diff(a(t), t))+a(t)*(diff(b(t), t))

how to subs(b(t)=0, question1) result in a(t)*(diff(b(t), t)) ?

in fact b(t) = 0 but diff(b(t), t) != 0 

Consider, say, the following third order derivative:

expr := diff(f(x,y),x,y$2);

Does there in Maple exist some built-in functions for extracting from such an expression 1.) the function being differentiated, and 2.) the coordinates being differentiated with respect to? Using op(expr) is of no immediate avail as it returns only a second order derivative (as the first operand), and one of the coordinates being differentiated with respect to (as the second operand).

It is, of course, possible to make ones own function for extracting these two quantities, a crude example being

splitDeriv := proc(expr,coords::expects(list) := [])
   if PDETools:-difforder(expr) > 0 then
      splitDeriv(op(1,expr),[coords[],op(2,expr)])
   else
      expr,coords
   end if
end proc:

for which

splitDeriv(expr);

But it would be much nicer to use built-in functions. And perhaps such functions do exist. If so, I am unable to locate them. Perhaps I am just being stupid, for the problem seems rather elementary.

Dear all

I have problem related to collection of coefficient of differtials in differential expression containing multiple dependent variables and we want to collect coefficient wrt to selected dependent variables. Please see attached Maple file for details.

 


with(PDEtools):

DepVars := [u(x, t), v(x, t), a[1](t), a[2](t), a[3](t), b[1](t), b[2](t), b[3](t), r(x, t), s[1](x, t), p[1](x, t), s[2](x, t), p[2](x, t)]

[u(x, t), v(x, t), a[1](t), a[2](t), a[3](t), b[1](t), b[2](t), b[3](t), r(x, t), s[1](x, t), p[1](x, t), s[2](x, t), p[2](x, t)]

(1)

alias(u = u(x, t), v = v(x, t), a[1] = a[1](t), a[2] = a[2](t), a[3] = a[3](t), b[1] = b[1](t), b[2] = b[2](t), b[3] = b[3](t), r = r(x, t), s[1] = s[1](x, t), p[1] = p[1](x, t), s[2] = s[2](x, t), p[2] = p[2](x, t))

u, v, a[1], a[2], a[3], b[1], b[2], b[3], r, s[1], p[1], s[2], p[2]

(2)

Suppose we differential expression like:

a[1]*(diff(u, x))*s[1]*u-2*a[1]*u*(diff(r, x))*(diff(u, x))+2*a[2]*(diff(v, x))*s[2]*v-2*a[2]*v*(diff(r, x))*(diff(v, x))-(diff(a[3], t))*r*(diff(u, x))/a[3]+diff(p[1], t)+a[3]*(diff(p[1], x, x, x))+(diff(r, t))*(diff(u, x))+(diff(s[1], t))*u-(diff(a[3], t))*s[1]*u/a[3]-s[1]*a[2]*v*(diff(v, x))-(diff(a[3], t))*a[1]*u*(diff(u, x))/a[3]-(diff(a[3], t))*a[2]*v*(diff(v, x))/a[3]-3*(diff(r, x))*p[1]+(diff(a[1], t))*u*(diff(u, x))+(diff(a[2], t))*v*(diff(v, x))+a[2]*(diff(v, x))*p[2]+a[2]*v^2*(diff(s[2], x))+a[2]*v*(diff(p[2], x))+a[1]*u*(diff(p[1], x))+a[1]*(diff(u, x))*p[1]+a[1]*u^2*(diff(s[1], x))+3*a[3]*(diff(s[1], x))*(diff(u, x, x))+3*a[3]*(diff(s[1], x, x))*(diff(u, x))+a[3]*(diff(r, x, x, x))*(diff(u, x))-(diff(a[3], t))*p[1]/a[3]-3*r*(diff(r, x))*(diff(u, x))-3*(diff(r, x))*s[1]*u+a[3]*(diff(s[1], x, x, x))*u+3*a[3]*(diff(r, x, x))*(diff(u, x, x)) = 0

3*a[3]*(diff(diff(r, x), x))*(diff(diff(u, x), x))+3*a[3]*(diff(s[1], x))*(diff(diff(u, x), x))+3*a[3]*(diff(diff(s[1], x), x))*(diff(u, x))+a[3]*(diff(diff(diff(r, x), x), x))*(diff(u, x))+a[3]*(diff(diff(diff(s[1], x), x), x))*u+diff(p[1], t)+(diff(r, t))*(diff(u, x))+(diff(s[1], t))*u-3*(diff(r, x))*p[1]+a[3]*(diff(diff(diff(p[1], x), x), x))-(diff(a[3], t))*a[1]*u*(diff(u, x))/a[3]-(diff(a[3], t))*a[2]*v*(diff(v, x))/a[3]+a[1]*(diff(u, x))*s[1]*u-2*a[1]*u*(diff(r, x))*(diff(u, x))+2*a[2]*(diff(v, x))*s[2]*v-2*a[2]*v*(diff(r, x))*(diff(v, x))-(diff(a[3], t))*r*(diff(u, x))/a[3]-(diff(a[3], t))*s[1]*u/a[3]-s[1]*a[2]*v*(diff(v, x))+(diff(a[1], t))*u*(diff(u, x))+a[1]*u*(diff(p[1], x))+a[2]*v*(diff(p[2], x))+a[2]*v^2*(diff(s[2], x))+a[2]*(diff(v, x))*p[2]+a[1]*(diff(u, x))*p[1]+a[1]*u^2*(diff(s[1], x))-(diff(a[3], t))*p[1]/a[3]-3*r*(diff(r, x))*(diff(u, x))-3*(diff(r, x))*s[1]*u+(diff(a[2], t))*v*(diff(v, x)) = 0

(3)

We can collect coefficients of differential like u[x], u[x, x], v[x], u, vin following manner:

The Procedure

   

 

 

Now how can we collect coefficents with respect to u[x], u[x, x], v[x], u, vso that differential expression (3) appear as
"(......)*u+(.......)*v+(......)*u[x]+(........)*uu[x]+(.........)vv[x]+(........)u[xx]  =0....................."????????""

``


Download Collecting_Coefficients_in_Differential_Expression.mw

Regards

Hey,

I have an expression like this:

a:= b(t)+diff(b(t),t)+diff(b(t),t$2)+diff(b(t),t$3)+...:

 

I want to substitute diff(b(t),t) with b_symbol_diff. I dont know how many more differentials are in the expression.

If I use subs(diff(b(t),t)=b_symbolic_diff,a)

maple also substitutes in diff(b(t),t$2). Because b_symbol_diff is not a function of t the higher order differentials are zero.

Is there a way to tell maple not to substitute those expressions that are enclosed in diff()?

I need this because I want to calculate the Jacobian of a vector and VectorCalculus[Jacobian]() does not accept functions.

Thanks in advance!

1 2 3 4 5 6 7 Last Page 1 of 14