lena

56 Reputation

4 Badges

9 years, 352 days

MaplePrimes Activity


These are answers submitted by lena

here I have 2 sums what shall I do:

term:=sum(sum(((gamma3(r[i])*alpha1(r[j])-1/2*alpha3(r[j])*beta3(r[i])-1/2*alpha3(r[j])*beta3(r[i])/r[j]))/((r[j]-I*y)*g(r[i])*g(r[j]))*((exp(r[i]*x)-exp((r[j]-I*x)*y))/(r[i]-r[j]+I*y)-(exp(r[i]*x)-1)/(r[i])),i=1..3),j=1..3):

 

Thanks,

I'll try but how about the sum is there need for it .

evalf(sum(alpha1(r)*exp(x*r), r = RootOf(_Z^3 + x*_Z + y)))

>restart; assume(x,real):assume(y,real):

>c:=(y^2)/2*(1+2*n-2*cos(phi))+(7+2*n)*(m^2+6): # coefficients of the function g.

>b:=(7+2*n)^2+m^2+y^2+1/4:

>a:=5*n:

#n,phi,m input parametrs
>g:=r->r^3+a*r^2+b*r+c:

>sol:=evalf(solve(g(r),r)): r:=array([],1..3): r[1]:=sol[1];r[2]:=sol[2];r[3]:=sol[3]; #r are roots of g(r)

>alpha1:=s->(s+2*m)*(s+6-I*n)+1/2*y^2:

>patt1:=Re(exp(-I*x)/4*(alpha1(0)/g(0))*sum(alpha1(r[i])/((r[i]-I*x)*g(r[i]))*((exp((r[i]-I*x))-1)/((r[i]-I*x))-6),i=1..3)):
 

>f:(x,y)->patt1:# I just type part of the function

>with(plots):plot3d(f(x,y),x=-20..20,y=0.2..10,axes=boxed,tickmarks=[3,3,3],orientation=[-105,66],color=gray,grid=[30,30]);

So, I plot the above function in three dimentional it works for some paramers.

Then I tried to put the function in 2 loops and point the data  as:

for ii from 1 to 100do:
for II from 1 to 100do:
XX[II]:=evalf(0+II*0.2):
x:=XX[II]:ti:=time():
y[ii]:=evalf(ii*0.1):
 y:=y[ii]:
and then i put the all functions above
f[ii,II]:=

pts:=[seq([XX[i],YY[i],f[i]],i=1..100)];

surfdata(pts,axes=boxed,style=patch,color=gray,grid=[60,60],shading = zgrayscale,tickmarks=[3,3,3],orientation=[-105,66]);

but i'm not sure  the points are in correct way.

where r[i] are r1,r2 and r3 are roots of cubic eq. so i need it in f(x,y)=...+sum(alpha1(r[i])*exp^(x*r[i]),i=1..3)

The function I got contains exp([r[i]*x)

for the first code

Can I use random generate instead of the loops where:

-10<x<10 and .1<y<10

Page 1 of 1