MaplePrimes Questions

restart;
eq := 61*x^2 + 1 = y^2;
sols := (isolve(eq) assuming (x::posint, y::posint)):
for sol in sols do
  print(subs(_Z1 = 1, sol));
end do;

isolve returns the solution in terms of _Z1, indicating there may be infinite number of solutions?
I think {x = 226153980, y = 1766319049} is the only solution with x::posint, y::posint.

How do I restrict this to only positive integers in the solution?

If you could assist; I am trying to set something like an asymptote or upper limit such that my plot below approaches asymptotically (below y =1 ) from negative infinity:

Download Plotting.mw

Why Float(undefined) appears in calculation integrals

3333.mw

I see this question at here
https://mathematica.stackexchange.com/questions/239874/how-to-reduce-timing-to-find-the-integer-numbers-a-b-c-d-e-f-g-h-k-m-of

How to solve this problem by Maple?

command completion (when hitting the ESC key) in Maple could be made more useful. It does not seem to support type names for example.

What shows up on the command completion window are  possible commands that start with that partial text.

It does not list other known names by Maple, such as type names and other options.

This makes it hard to use in many places, where one have to remember type names exactly instead of the system helping them by listing all possible type names that start with that string.

Is there a way around this? Will Maple next version support smarter and more complete command completion menu?

 

 

dear all

I would like to display the error ( tab_err) and plot it. 
The code run without any mistakes but there is no table of error dispalyed and can then be plotted 


integ_R.mw

Thank you for any help 

 

How to plot Complex vales in 2D? 

Z be complex.

rho := 1/4; mu := 1/4; E := sum(Z^k/GAMMA(k*rho+mu), k = 0 .. 5)

I am trying to run this code but this error message is coming up "Error, (in fprintf) number expected for floating point format
". What have I done wrong and how do I correct it.

Thank you and best regards.

 

restart;
Digits:=30:

f:=proc(n)
	-((sin(x[n]))/(2-sin(x[n])))*(2+sin(x[n]-Pi)):
end proc:

e1:=y[n+1]=h*delta[n]-(1/2)*h^2*(-u^2*sin((1/2)*u)+2*cos((1/2)*u)*u-2*cos(u)*u-4*sin((1/2)*u)+2*sin(u))*f(n)/(u^2*(2*sin((1/2)*u)-sin(u)))+(1/2)*h^2*(u^2*sin((1/2)*u)+2*cos((1/2)*u)*u-4*sin((1/2)*u)+2*sin(u)-2*u)*f(n+1)/(u^2*(2*sin((1/2)*u)-sin(u)))-(1/2)*h^2*(u*sin(u)+2*cos(u)-2)*f(n+1/2)/(u*(2*sin((1/2)*u)-sin(u)))+y[n]:
e2:=h*delta[n+1]=h*delta[n]+h^2*(u*sin((1/2)*u)+cos(u)-1)*f(n)/(u*(2*sin((1/2)*u)-sin(u)))+h^2*(u*sin((1/2)*u)+cos(u)-1)*f(n+1)/(u*(2*sin((1/2)*u)-sin(u)))-h^2*(u*sin(u)+2*cos(u)-2)*f(n+1/2)/(u*(2*sin((1/2)*u)-sin(u))):
e3:=y[n+1/2]=(1/2)*h*delta[n]-(1/8)*h^2*(-u^2*sin((1/2)*u)+4*cos((1/2)*u)*u-4*cos(u)*u-16*sin((1/2)*u)+8*sin(u))*f(n)/(u^2*(2*sin((1/2)*u)-sin(u)))+(1/8)*h^2*(u*sin((1/2)*u)+4*cos((1/2)*u)-4)*f(n+1)/(u*(2*sin((1/2)*u)-sin(u)))-(1/8)*h^2*(u^2*sin(u)+4*cos(u)*u+16*sin((1/2)*u)-8*sin(u)-4*u)*f(n+1/2)/(u^2*(2*sin((1/2)*u)-sin(u)))+y[n]:
e4:=h*delta[n+1/2]=h*delta[n]-(1/2)*h^2*(-u*sin((1/2)*u)+4*cos((1/2)*u)-2*cos(u)-2)*f(n)/(u*(2*sin((1/2)*u)-sin(u)))+(1/2)*h^2*(u*sin((1/2)*u)+4*cos((1/2)*u)-4)*f(n+1)/(u*(2*sin((1/2)*u)-sin(u)))-(1/2)*h^2*(u*sin(u)+2*cos(u)-2)*f(n+1/2)/(u*(2*sin((1/2)*u)-sin(u))):


inx:=0:
ind:=1:
iny:=2:
h:=Pi/4:
n:=0:
omega:=1:
u:=omega*h:
N:=solve(h*p = 8*Pi, p):

c:=1:
for j from 0 to 1 by 1/2 do
	t[j]:=inx+j*h:
end do:

vars:=y[n+1/2],y[n+1],delta[n+1/2],delta[n+1]:

step := [seq](eval(x, x=c*h), c=1..N):
printf("%6s%15s%15s%16s%15s%15s%15s\n", 
	"h","Num.y","Num.z","Ex.y","Ex.z","Error y","Error z");
#eval(<vars>, solve({e||(1..4)},{vars}));


st := time():
for k from 1 to N do

	par1:=x[0]=t[0],x[1/2]=t[1/2],x[1]=t[1]:
	par2:=y[n]=iny,delta[n]=ind:
	res:=eval(<vars>, fsolve(eval({e||(1..4)},[par1,par2]), {vars}));

	for i from 1 to 2 do
		exy:=eval(2+sin(c*h/2)):
		exz:=eval(-sin(c*h/2)+10*epsilon*cos(10*c*h)):
		printf("%6.5f%17.9f%15.9f%15.9f%15.9f %13.5g%15.5g\n", 
		h*c,res[i],res[i+2],exy,exz,abs(res[i]-exy),
		abs(res[i+2]-exz)):
		
		c:=c+1:

	end do:
	iny:=res[2]:
	ind:=res[4]:
	inx:=t[1]:
	for j from 0 to 1 by 1/2 do
		t[j]:=inx + j*h:
	end do:
end do:

 

Hi 

How to add a legend to Statistics:-Histogram?

This could be particularly useful to compare histograms, for instance in

S := Statistics:-Sample(Normal(0, 1), 1000):
T := Statistics:-Sample(Normal(1, 1), 1000):

plots:-display(
  Statistics:-Histogram(S, color=gold, transparency=0.3, legend="N(0,1)"),
  Statistics:-Histogram(T, transparency=0.3, legend="N(1,1)")
);

But doing this generates the error Error, (in Statistics:-Histogram) display does not accept the legend option

And yes indeed, even this command

h := Statistics:-Histogram(S, legend="N(0,1)")

already produces the same error.

After having examined the structure of h and using a way Carl Love gave here How to change the colour inn Statistics:-Sunflower?  I finally obtained the expected plot.
 

HS := Statistics:-Histogram(S, color=gold, transparency=0.3):
HT := Statistics:-Histogram(T, transparency=0.3):

hs := evalindets([op(HS)], specfunc(COLOUR), c-> (c, LEGEND("N(0,1)")) ):
ht := evalindets([op(HT)], specfunc(COLOUR), c-> (c, LEGEND("N(1,1)")) ):

PLOT(op(hs), op(ht))



But this rather long a way to proceed (Note: it seems that the overrideoption  that acer suggested in this prevous thread doesn't "work" here?)
Do you have any idea if there is a simpler solution?

TIA

AoA....

sir how we solve partial differential equation by Adomian Decomposition method in maple? plz send me maple code..

Dear all
I have a problem when running the follwoing code using the input proposed. 

 

integ_R.mw

problem : print_table , used as input in  proc 

Thank you for your help 

Dear all

I tried to compute an integral using trapezoidal rule using two differents methods but I get two different results
trap.mw

Thank you for your help 

How to solve and plot the integral equation?
b.mw
 

I am trying to input X-data, Y-data from spreadsheet-section of Numbers (Apple App) to do reression analysis in Maple. I do not understand the export or import tools very well just yet, asis obvious from numerous wrong results.

Since I want to do regression of the X-Y data trends, what format would you recommend using for the data once imported into Maple; two sequences, two-vectors, multi-row column matrix ???

If someone has worked with Numbers-Apple-App (Not Excel) into Maple to do this and can provide simple example with steps/tools used. It would be appreciated. Thanks

Dear all

I would like to sketch the solution of first ode, but by hand we can not get the solution. I used maple, to  solve the ode but unfortunattely there is no solution obtained so I can sketech the behavior of the solution. 

Is there any way to sketch the solution behavior .

sketch_solution.mw

 

thank you 

First 248 249 250 251 252 253 254 Last Page 250 of 2237