MaPal93

145 Reputation

5 Badges

2 years, 64 days

MaplePrimes Activity


These are questions asked by MaPal93

I am trying to compute partial derivatives of some complicated expression which include summations. First, I noticed that sum behaves differently if I use 1D vs. 2D math. Why?

Questions:
  1. Partial derivative of a summation: why is it not just 2*X[i]?
  2. Partial derivative of a double summation: how to define the nested structure of a double summation with j<>i?
  3. System of n+1 equations: how to define and solve for it?

For 3., each i equation is the partial derivative of my complicated expression with summations with respect to X[i], where i ranges from 1 to n. The last equation is the partial derivative with respect to X_r (a fixed variable).

Thanks.

restart

A := sum(X[i]^2, i = 1 .. n); eq[1] := diff(A, X[i]) = 0

sum(X[i]^2, i = 1 .. n)

 

sum(2*X[i], i = 1 .. n) = 0

(1)

B__wrong := sum(sum((X__r*w+X[i])*(X__r*w+X[j]), j = 1 .. n), i = 1 .. n); B__correct := 'sum(sum((X__r*w+X[i])*(X__r*w+X[j]), j = 1 .. n), i = 1 .. n)'

n^2*X__r^2*w^2+sum(sum(X__r*w*X[j]+X[i]*X[j], j = 1 .. n)+n*X__r*w*X[i], i = 1 .. n)

 

sum(sum((X__r*w+X[i])*(X__r*w+X[j]), j = 1 .. n), i = 1 .. n)

(2)

eqs := seq(eq[i], i = 1 .. n); vars := seq(X[i], i = 1 .. n)

Error, range bounds in seq must be numeric or character

 

Error, range bounds in seq must be numeric or character

 
 

NULL

Download equations_with_summations.mw

Function X__2(y1,y2) is a function of X__1(y1,y2). How do I express (implicitly) d(X__2)/d(y1) and d(X__2)/d(y2) in terms of d(X__1)/d(y1) and d(X__1)/d(y2) and perhaps of X__1 and X__2 themselves?

I illustrate what I mean with an example for X__1(y1,y2), where d(X__1)/d(y1) and d(X__1)/d(y2) are written in a relatively compact form in terms of X__1 itself:
 

restart;

X1 := RootOf((8*y__1^14 + 32*y__1^12*y__2^2 + 48*y__1^10*y__2^4 + 32*y__1^8*y__2^6 + 8*y__1^6*y__2^8 + 16*y__1^12 + 80*y__1^10*y__2^2 + 160*y__1^8*y__2^4 + 160*y__1^6*y__2^6 + 80*y__1^4*y__2^8 + 16*y__1^2*y__2^10)*_Z^10 + (40*y__1^13*y__2^2 + 120*y__1^11*y__2^4 + 120*y__1^9*y__2^6 + 40*y__1^7*y__2^8 + 16*y__1^13 + 176*y__1^11*y__2^2 + 544*y__1^9*y__2^4 + 736*y__1^7*y__2^6 + 464*y__1^5*y__2^8 + 112*y__1^3*y__2^10)*_Z^9 + (84*y__1^12*y__2^4 + 168*y__1^10*y__2^6 + 84*y__1^8*y__2^8 - 20*y__1^14 + 28*y__1^12*y__2^2 + 552*y__1^10*y__2^4 + 1288*y__1^8*y__2^6 + 1132*y__1^6*y__2^8 + 348*y__1^4*y__2^10 - 48*y__1^12 - 192*y__1^10*y__2^2 - 272*y__1^8*y__2^4 - 128*y__1^6*y__2^6 + 48*y__1^4*y__2^8 + 64*y__1^2*y__2^10 + 16*y__2^12)*_Z^8 + (88*y__1^11*y__2^6 + 88*y__1^9*y__2^8 - 80*y__1^13*y__2^2 + 56*y__1^11*y__2^4 + 960*y__1^9*y__2^6 + 1432*y__1^7*y__2^8 + 608*y__1^5*y__2^10 - 48*y__1^13 - 416*y__1^11*y__2^2 - 944*y__1^9*y__2^4 - 736*y__1^7*y__2^6 + 16*y__1^5*y__2^8 + 256*y__1^3*y__2^10 + 80*y__1*y__2^12)*_Z^7 + (40*y__1^10*y__2^8 - 128*y__1^12*y__2^4 + 168*y__1^10*y__2^6 + 928*y__1^8*y__2^8 + 632*y__1^6*y__2^10 + 12*y__1^14 - 192*y__1^12*y__2^2 - 1084*y__1^10*y__2^4 - 1472*y__1^8*y__2^6 - 340*y__1^6*y__2^8 + 432*y__1^4*y__2^10 + 180*y__1^2*y__2^12 + 48*y__1^12 + 144*y__1^10*y__2^2 + 112*y__1^8*y__2^4 - 48*y__1^6*y__2^6 - 96*y__1^4*y__2^8 - 32*y__1^2*y__2^10)*_Z^6 + (-92*y__1^11*y__2^6 + 228*y__1^9*y__2^8 + 368*y__1^7*y__2^10 + 32*y__1^13*y__2^2 - 384*y__1^11*y__2^4 - 1272*y__1^9*y__2^6 - 704*y__1^7*y__2^8 + 376*y__1^5*y__2^10 + 224*y__1^3*y__2^12 + 48*y__1^13 + 304*y__1^11*y__2^2 + 432*y__1^9*y__2^4 + 16*y__1^7*y__2^6 - 288*y__1^5*y__2^8 - 128*y__1^3*y__2^10)*_Z^5 + (-24*y__1^10*y__2^8 + 96*y__1^8*y__2^10 + 24*y__1^12*y__2^4 - 412*y__1^10*y__2^6 - 576*y__1^8*y__2^8 + 164*y__1^6*y__2^10 + 160*y__1^4*y__2^12 + 4*y__1^14 + 172*y__1^12*y__2^2 + 532*y__1^10*y__2^4 + 252*y__1^8*y__2^6 - 328*y__1^6*y__2^8 - 216*y__1^4*y__2^10 - 16*y__1^12 - 32*y__1^10*y__2^2 + 32*y__1^6*y__2^6 + 16*y__1^4*y__2^8)*_Z^4 + (-8*y__1^11*y__2^6 - 192*y__1^9*y__2^8 + 28*y__1^7*y__2^10 + 60*y__1^5*y__2^12 + 16*y__1^13*y__2^2 + 232*y__1^11*y__2^4 + 296*y__1^9*y__2^6 - 168*y__1^7*y__2^8 - 184*y__1^5*y__2^10 - 16*y__1^13 - 64*y__1^11*y__2^2 - 32*y__1^9*y__2^4 + 64*y__1^7*y__2^6 + 48*y__1^5*y__2^8)*_Z^3 + (-15*y__1^10*y__2^8 + 9*y__1^6*y__2^12 + 24*y__1^12*y__2^4 + 116*y__1^10*y__2^6 - 36*y__1^8*y__2^8 - 80*y__1^6*y__2^10 - 4*y__1^14 - 40*y__1^12*y__2^2 - 48*y__1^10*y__2^4 + 40*y__1^8*y__2^6 + 52*y__1^6*y__2^8)*_Z^2 + (12*y__1^11*y__2^6 - 4*y__1^9*y__2^8 - 16*y__1^7*y__2^10 - 8*y__1^13*y__2^2 - 24*y__1^11*y__2^4 + 8*y__1^9*y__2^6 + 24*y__1^7*y__2^8)*_Z - y__1^10*y__2^8 - y__1^8*y__2^10 - 4*y__1^12*y__2^4 + 4*y__1^8*y__2^8):

alias(X__1=X1);

X__2 := -y__1*y__2^2*X__1*(8*X__1^7*y__1^10 + 24*X__1^7*y__1^8*y__2^2 + 24*X__1^7*y__1^6*y__2^4 + 8*X__1^7*y__1^4*y__2^6 + 24*X__1^6*y__1^9*y__2^2 + 48*X__1^6*y__1^7*y__2^4 + 24*X__1^6*y__1^5*y__2^6 + 26*X__1^5*y__1^8*y__2^4 + 26*X__1^5*y__1^6*y__2^6 + 8*X__1^4*y__1^7*y__2^6 + 32*X__1^7*y__1^8 + 128*X__1^7*y__1^6*y__2^2 + 192*X__1^7*y__1^4*y__2^4 + 128*X__1^7*y__1^2*y__2^6 + 32*X__1^7*y__2^8 + 16*X__1^6*y__1^9 + 192*X__1^6*y__1^7*y__2^2 + 480*X__1^6*y__1^5*y__2^4 + 448*X__1^6*y__1^3*y__2^6 + 144*X__1^6*y__1*y__2^8 - 16*X__1^5*y__1^10 + 32*X__1^5*y__1^8*y__2^2 + 392*X__1^5*y__1^6*y__2^4 + 624*X__1^5*y__1^4*y__2^6 + 280*X__1^5*y__1^2*y__2^8 - 36*X__1^4*y__1^9*y__2^2 + 72*X__1^4*y__1^7*y__2^4 + 396*X__1^4*y__1^5*y__2^6 + 288*X__1^4*y__1^3*y__2^8 - 28*X__1^3*y__1^8*y__2^4 + 84*X__1^3*y__1^6*y__2^6 + 156*X__1^3*y__1^4*y__2^8 - 7*X__1^2*y__1^7*y__2^6 + 33*X__1^2*y__1^5*y__2^8 - 64*X__1^5*y__1^8 - 192*X__1^5*y__1^6*y__2^2 - 192*X__1^5*y__1^4*y__2^4 - 64*X__1^5*y__1^2*y__2^6 - 32*X__1^4*y__1^9 - 288*X__1^4*y__1^7*y__2^2 - 480*X__1^4*y__1^5*y__2^4 - 224*X__1^4*y__1^3*y__2^6 + 8*X__1^3*y__1^10 - 88*X__1^3*y__1^8*y__2^2 - 408*X__1^3*y__1^6*y__2^4 - 312*X__1^3*y__1^4*y__2^6 + 12*X__1^2*y__1^9*y__2^2 - 108*X__1^2*y__1^7*y__2^4 - 196*X__1^2*y__1^5*y__2^6 + 4*X__1^2*y__1^3*y__2^8 + 2*X__1*y__1^8*y__2^4 - 46*X__1*y__1^6*y__2^6 + 4*X__1*y__1^4*y__2^8 - y__1^7*y__2^6 + y__1^5*y__2^8 + 32*X__1^3*y__1^8 + 64*X__1^3*y__1^6*y__2^2 + 32*X__1^3*y__1^4*y__2^4 + 16*X__1^2*y__1^9 + 96*X__1^2*y__1^7*y__2^2 + 80*X__1^2*y__1^5*y__2^4 + 32*X__1*y__1^8*y__2^2 + 64*X__1*y__1^6*y__2^4 + 16*y__1^7*y__2^4)/(-8*X__1^7*y__1^11*y__2^2 - 24*X__1^7*y__1^9*y__2^4 - 24*X__1^7*y__1^7*y__2^6 - 8*X__1^7*y__1^5*y__2^8 - 32*X__1^6*y__1^10*y__2^4 - 64*X__1^6*y__1^8*y__2^6 - 32*X__1^6*y__1^6*y__2^8 - 50*X__1^5*y__1^9*y__2^6 - 50*X__1^5*y__1^7*y__2^8 - 28*X__1^4*y__1^8*y__2^8 + 32*X__1^8*y__1^10 + 160*X__1^8*y__1^8*y__2^2 + 320*X__1^8*y__1^6*y__2^4 + 320*X__1^8*y__1^4*y__2^6 + 160*X__1^8*y__1^2*y__2^8 + 32*X__1^8*y__2^10 + 160*X__1^7*y__1^9*y__2^2 + 640*X__1^7*y__1^7*y__2^4 + 960*X__1^7*y__1^5*y__2^6 + 640*X__1^7*y__1^3*y__2^8 + 160*X__1^7*y__1*y__2^10 - 8*X__1^6*y__1^12 - 24*X__1^6*y__1^10*y__2^2 + 328*X__1^6*y__1^8*y__2^4 + 1048*X__1^6*y__1^6*y__2^6 + 1056*X__1^6*y__1^4*y__2^8 + 352*X__1^6*y__1^2*y__2^10 - 24*X__1^5*y__1^11*y__2^2 - 48*X__1^5*y__1^9*y__2^4 + 400*X__1^5*y__1^7*y__2^6 + 848*X__1^5*y__1^5*y__2^8 + 424*X__1^5*y__1^3*y__2^10 - 38*X__1^4*y__1^10*y__2^4 - 54*X__1^4*y__1^8*y__2^6 + 274*X__1^4*y__1^6*y__2^8 + 290*X__1^4*y__1^4*y__2^10 - 44*X__1^3*y__1^9*y__2^6 - 32*X__1^3*y__1^7*y__2^8 + 104*X__1^3*y__1^5*y__2^10 - 27*X__1^2*y__1^8*y__2^8 + 15*X__1^2*y__1^6*y__2^10 - 64*X__1^6*y__1^10 - 256*X__1^6*y__1^8*y__2^2 - 384*X__1^6*y__1^6*y__2^4 - 256*X__1^6*y__1^4*y__2^6 - 64*X__1^6*y__1^2*y__2^8 - 256*X__1^5*y__1^9*y__2^2 - 768*X__1^5*y__1^7*y__2^4 - 768*X__1^5*y__1^5*y__2^6 - 256*X__1^5*y__1^3*y__2^8 + 16*X__1^4*y__1^12 + 32*X__1^4*y__1^10*y__2^2 - 408*X__1^4*y__1^8*y__2^4 - 848*X__1^4*y__1^6*y__2^6 - 424*X__1^4*y__1^4*y__2^8 + 48*X__1^3*y__1^11*y__2^2 + 48*X__1^3*y__1^9*y__2^4 - 352*X__1^3*y__1^7*y__2^6 - 352*X__1^3*y__1^5*y__2^8 + 54*X__1^2*y__1^10*y__2^4 - 150*X__1^2*y__1^6*y__2^8 + 22*X__1*y__1^9*y__2^6 - 30*X__1*y__1^7*y__2^8 - 2*y__1^8*y__2^8 + 32*X__1^4*y__1^10 + 96*X__1^4*y__1^8*y__2^2 + 96*X__1^4*y__1^6*y__2^4 + 32*X__1^4*y__1^4*y__2^6 + 96*X__1^3*y__1^9*y__2^2 + 192*X__1^3*y__1^7*y__2^4 + 96*X__1^3*y__1^5*y__2^6 - 8*X__1^2*y__1^12 - 8*X__1^2*y__1^10*y__2^2 + 104*X__1^2*y__1^8*y__2^4 + 104*X__1^2*y__1^6*y__2^6 - 16*X__1*y__1^11*y__2^2 + 48*X__1*y__1^7*y__2^6 - 8*y__1^10*y__2^4 + 8*y__1^8*y__2^6):


Synthetic representation of derivatives


derivatives for X__1 okay: written in terms of y__1, y__2, and X__1 itself.

derX1_y1 := diff(X1, y__1):
derX1_y2 := diff(X1, y__2):

Diff('X__1(y__1,y__2)', y__1) = collect~(normal(eval(derX1_y1, X1 = 'X__1(y__1,y__2)')), 'X__1(y__1,y__2)');
Diff('X__1(y__1,y__2)', y__2) = collect~(normal(eval(derX1_y2, X1 = 'X__1(y__1,y__2)')), 'X__1(y__1,y__2)');


derivatives for X__2 not okay (X__2 is itself a function of X__1): how do I write them in terms of y__1, y__2, X__1 AND the derivatives for X__1 just found? What's the most compact way to express these two derivatives below?

derX2_y1 := diff(X__2, y__1):
derX2_y2 := diff(X__2, y__2):

Diff('X__2(y__1,y__2)', y__1) = collect~(normal(eval(eval(derX2_y1, derX1_y1='Diff('X__1(y__1,y__2)', y__1)'), X__1 = 'X__1(y__1,y__2)')), 'X__1(y__1,y__2)');
Diff('X__2(y__1,y__2)', y__2) = collect~(normal(eval(derX2_y2, X__1 = 'X__1(y__1,y__2)')), 'X__1(y__1,y__2)');

``

 

Download compact_derivatives.mw


Thank you for the help.

I can't combine standard font and Greek symbols in a plot legend. I want to type:

"Limit of X_{i}^{\rho=0} (\alpha\mapsto+\infty)>0"

where I used LaTeX notation to emphasise that I want (1) superscript and subscript of X displayed as aligned exactly on top of each other, (2) rho, alpha, mapsto-style arrow, and infinity typed in their respective symbolic forms.

thanks!

I want to display W__LJ as I typed it, without Maple running the calculations resulting in the output here below:

restart;

'W__LJ = 0.75 + 0.98*((1.18/Gamma)^1.9 - (1.15/Gamma)^0.98)';

W__LJ = .75+1.342152577*(1/Gamma)^1.9-1.123854165*(1/Gamma)^.98

(1)
 

NULL

Download display_formula.mw

This is important as I will place such expression in a plot like this:
textplot([2,0.9,typeset('W__LJ=0.75+0.98((1.18/Gamma)^1.9-(1.15/Gamma)^0.98)')],'font'=["helvetica","roman",35])
and I need it in the original functional form, which is easier to interpret.

I have two surfaces crossing the z=0 plane for some ranges of x and y values.

For the first surface, x=Gamma is bounded between 0 and 10 and y=rho between -1 and +1. For the second surface, x=Gamma_1 is bounded between 0 and 10 and y=Gamma_2 between 0 and 10 as well. I want to clearly identify (parametric):

  1. For which Gamma and rho ranges of values the first surface is positive (and for which negative)
  2. For which Gamma_1 and Gamma_2 ranges of values the second surface is positive (and for which negative)

Worksheet: sign_regions.mw (highlighted in yellow my two failed attempts)

1 2 3 4 5 6 7 Page 1 of 8