MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed

When plotting a continous function that looks something like a square wave, for example like this:

f:=x->piecewise(0<x<Pi,0,Pi<x<2*Pi,Pi);
a:=0: b:=2*Pi: p:=b-a:
fp:=f(x-floor( (x-a)/p)*p);
plot(fp,x=-6*Pi..6*Pi,discont=true);

Is there some way to show dashed vertical lines at the points of discontinuity?

So i got a procedure test, she is kind of numeric, i whant to optimaze test([.5, .5, .5], 1, 3, 100, 100, true, [x, 0, 0, 0, 0])=0 by x. But optinization substitutes x like a symbol, i tryed all methods but they all do the same.

f := proc (x) options operator, arrow; abs(test([.5, .5, .5], 1, 3, 100, 100, true, [x, 0, 0, 0, 0])-.4) end proc; Minimize(f(x));
%;
Error, (in test) cannot determine if this expression is true or false: 0 < -43.0+100*x


Can i some how use optinization on such procedure?

file link  - >    primset.mw

A created an overly complicated worksheet thaI can no longer open.  It's about 17 Mb, has several interactive plots and equations in it.  Is there a way to force Maple to open a worksheet without executing it?

(Lesson learned:  split this up into separate worksheets next time.)

I wish to use closed Newton-Cotes with n=2, also known as Simpson's Rule to numerically integrate an improper integral.

 

If it matters the integrand is (cos(2x))/(x^1/3), integrating between x=0..1

I've tried a few different (but similar) code but to no avail. Here is some stuff I've tried:

 

1.

 

with(Student[NumericalAnalysis]):

with(Student[Calculus 1]):

Simp1 := ApproximateInt(cos(2*x)/x^(1/3), x = 0 .. 1, method = newtoncotes[2]);

 

This gives me an output message that says "Float(infinity)".

 

2.

with(Student[NumericalAnalysis]):

with(Student[Calculus 1]):

Simp2 := int(exp(-x)/sqrt(1-x), x = 0 .. 1);

 

This doesn't have Simpson's rule as an option.

 

I think I'm on the right track with my first try, since I guess it wasn't tecnically an error message, but I'm not sure how to alter the code accordingly to get a numerical value instead. Thanks for any help.

 

 

 

 

 

 

I am trying to numerically double integrate x^2+sqrt(y), with the bounds y=0..x and x=1..1.5.

Then I tried the following code:

 

int(int(x^2+sqrt(y),method=trapezoid,y=0..x),method=trapezoid,x=1..1.5);

 

I know how to write the code if instead of a 'x' in my upper limit for my integral, I had a real number, but I'm not sure how to remedy to code in order make it work. Any help would be appreciated. Thanks!

 

 

restart

with(ODETools):

eqn1 := ((diff(f4(r), r))*r-f4(r)*f1(r)+f4(r))/(f4(r)*r^2) = 0

((diff(f4(r), r))*r-f4(r)*f1(r)+f4(r))/(f4(r)*r^2) = 0

(1)

eqn4 := f4(r)*(r*(diff(f1(r), r))+f1(r)^2-f1(r))/(f1(r)^2*r^2) = 2*m*Dirac(r)*f4(r)/r^2

f4(r)*(r*(diff(f1(r), r))+f1(r)^2-f1(r))/(f1(r)^2*r^2) = 2*m*Dirac(r)*f4(r)/r^2

(2)

dsolve({eqn1, eqn4})

[{-(2*Dirac(r)*(diff(f4(r), r))^2*m*r^2+4*Dirac(r)*(diff(f4(r), r))*f4(r)*m*r+2*Dirac(r)*f4(r)^2*m-f4(r)*(diff(diff(f4(r), r), r))*r^2-2*(diff(f4(r), r))*r*f4(r))/f4(r) = 0}, {f1(r) = ((diff(f4(r), r))*r+f4(r))/f4(r)}]

(3)

``

When I try to solve this system of ODE, Maple does not factor out f4(r) in eqn4.  How do I get Maple to solve eqn4? So that I can get the correct result for f1(r) below:

 

dsolve((r*(diff(f1(r), r))+f1(r)^2-f1(r))/(f1(r)^2*r^2) = 2*m*Dirac(r)/r^2)

f1(r) = -r/(2*m*Heaviside(r)-_C1-r)

(4)

``

Thanks.

Download dsolve_question.mw

Hi,

I got the Real and Imaginary of an expression J1 

assume(d,real):

Gamma:=0.04:tau:=10*Pi:j:=0:

J1:=(exp((1-I*d)*Gamma*tau)-1)/((1-I*d));

J1mod:=simplify((Re(J1))^2+(Im(J1))^2): (I works here this amont is real)

################

but when I change the expression  for J1 to be

J1:=((2*e^(-2^(-j-1)*(1-I*d))-e^(-2^(-j)*(1-I*d))-1)*exp((1-I*d)*Gamma*tau)-1)/((1-I*d)):

J1mod:=simplify((Re(J1))^2+(Im(J1))^2): 

J1mod here is complex(I dont know why? it doesnt separate the real and the im )

Any comments will help

Thanks

Hello everybody,

 

can somebody tell me how to use subscripts in textmode? 

 

Thanks for your help!

 

Picard

OK, what am I doing wrong here?

This polynomial can be factored by almost anyone who knows algebra:

factor(x^2+y^2+2*xy);

but Maple refuses:

 x2  + y2  + 2 xy

but if I pose the question this way:

ans := expand((x+y)^2);

factor(ans);

(x + y)2

I get the expected result.  What is wrong with how I am using the factor?

If we have a piecewise continous 2*Pi-periodic function

h(t)=e^(2*t) when 0 < t < 2*Pi

How can we plot it? It should look something like this:

 

Periodic plot

 

I.e. I want to be able to just set an interval and then it automatically plots the function with the specified periodicity.

Hi,

I am new to maple. I want to write the following codes in Maple in a file and execute it. I am writing the code in matlab. thanks

 

for i =1:1:5

for j=1:1:5

M(i,j)=i+j;

end

end

 

thanks

I am working with a package that is not entirely stable and which can sometimes corrupt Maple's state. I would like to "sandbox" the risky operations, executing each of them in another kernel thread that I can destroy (or somehow reset), getting back just the return result of each operation (each return result involves only global names, numbers, and strings). What would be a good way to achieve this?

I see the Task model, but it is not clear to me that each kernel used is effectively restart()'d for each Task Start(). At the moment I would have a bit more confidence in manually using Thread Create(), except that I do not see any information on how to destroy a thread (just to destroy Mutex and Condition Variable resources.)

This is, I suppose, a kind of security, but it is not covered by EngineSecurity. (Not unless I need to process[popen] to achieve this.)

Hy all its my first post, thankyou for having me.
I'm not sure why this happens but say I got a list

X := [0, 1, 2, 3];

and perform this expression

sum(sum(a[k]*X[i]^k, k = 0 .. n), i = 1 .. nops(X))

I get output 4*a[0]+6*a[1]+14*a[2] which is correct and what I want, but if I swap the summations

to 

sum(sum(a[k]*X[i]^k, i = 1 .. nops(X)), k = 0 .. n)

I get 3*a[0]+6*a[1]+14*a[2] which is incorrect I believe, unless I'm being silly and missing something.

this happens because its a 0 in my list, if I replace a zero with a non zero number then it works fine and if I replace my set with

X := [seq(x[i], i = 0 .. 3)];
both summations give me
a[2]*x[0]^2+a[2]*x[1]^2+a[2]*x[2]^2+a[2]*x[3]^2+a[1]*x[0]+a[1]*x[1]+a[1]*x[2]+a[1]*x[3]+4*a[0]

and at the end there is 4*a[0]
nothing that is really depending on any element in the list. so why when I replace an element with 0 using the second expression (which should be equivalent to first) gives me less a[0]I really would like to understand why this is happening

any insight or assistance would be gratefully appreciated.(I'm still a noob)

I Need eliminate u(t) in Matrix U
How can I do it directly from dsolve without using string tools?

 

 

I am trying to take a list of prime numbers that I already generated with the following:

L4:=NULL:

for i from 2 to 50 do

if nops(ifactor(i))=1 then L4:=L4,i end if:

end do;

[L4]

This gives me the primes bewteen 2-50, [2,3,5,7,11,13,17,23,29,31,37,43,47].  I want to write something that takes the products of my list like this

2*3=6

2*3*5=30

2*3*5*7=210

and so on through the whole list.  Any ideas?  I figured out how to take the product of 2*3, 2*5, 2*7 and so on, but I cant figure how to make it do 2*3, 2*3*7 and so on.

I am doing a presentation on Euclids infinite prime proof and thought it would be cool to write a maple program that will show his proof for a certain amount of prime numbers.

 

Thanks,  Matt

 

 

 

3 4 5 6 7 8 9 Last Page 5 of 1123