MaplePrimes Questions

Hello everyone, 

please need some brain power here to help me with this problem. I'm stacked here and I cannot find a solution. 

I would like to find the intersection between a plane and a quadric surfaces. Please notice that the two equations are written like f(x,y) and g(x,z) respectively. My first problem is that I cannot visualize the two surfaces correctly as implicitplot3d of the quadric surfaces displays nothing in return. 

I want then to find the centre of the ellipse and plot the point and the two surfaces all together in the same 3d plot. Somehow I canont make it. What is wrong with me? 

I am pasting here my MWE. 

Any kind of help would be really appreciated. Thank you so much. 

Andrea

MWE_maple_help.mw
 

restart:

with(plottools):
with(plots):

with(Student:-MultivariateCalculus):
with(Student:-Precalculus):
with(geometry):

with( Optimization ):

my_plane := 2024.30587449691-.341275505799078*x-3.89936179341114*y;
my_quadric := -10595.4104931095+6.73749956241827*x+42.1022818380012*z-0.654818649508000e-1*x^2-0.421174257681115e-1*z^2;

2024.30587449691-.341275505799078*x-3.89936179341114*y

 

-10595.4104931095+6.73749956241827*x+42.1022818380012*z-0.654818649508000e-1*x^2-0.421174257681115e-1*z^2

(1)

my_quadric_plot_3d := implicitplot3d(my_quadric, x=-10000..10000,
                                       y = -100..100,
                                      z=-10000..10000,color="DodgerBlue"):
my_plane_plot_3d := implicitplot3d(my_plane, x=-10000..10000,
                                       y = -100..100,
                                      z=-10000..10000,color="DarkOrange"):

my_ellipse := CompleteSquare( subs(y = solve(z = my_plane, y), my_quadric));

-0.4211742577e-1*(z-499.8202178)^2-0.6548186495e-1*(x-51.44553815)^2+99.68250

(2)

ellipse(e1, my_ellipse, [x,z]):
XY_centre_e1     := coordinates(center(o,e1)):
my_center_point := [XY_centre_e1[1],XY_centre_e1[2],
                       subs(x=XY_centre_e1[1], y=XY_centre_e1[2], my_plane)]:
my_center_point_plot := pointplot3d(my_center_point, color = "red"):

display(my_center_point_plot, my_plane_plot_3d, my_quadric_plot_3d);

 


 

Download MWE_maple_help.mw

 

 

with(LinearAlgebra):
test1 := Matrix([[1,-1],[-1,1]]);
for i from 1 to 20 do
print(Eigenvectors(test1)[2]);
od:

i run the same command 20 times, but sometimes left has negative 1 , sometimes right has negative 1

why position is like random , is my maple has virus?

the result are not consistent, i am learning quantum computation, will this influence the quantum computation and result?

i am doing up and down and change to a differential equation, Pauli equation

It seems only one Pauli equation

i find 3*3 matrix 

has 3 different kinds of matrix

one is row 1 and row 2

second is row 1 and row 3

Third is row 2 and 3

column 1 is constant 

Is there any one has the same experience to predict these 3 kind of matrix, and know what I mentioned?

 

I am writing questions in Maple T.A.  I want to call Matlab functions to generate answers and compare to the student's answers. I want to call both built-in functions and my own functions.  I notice that Maple has Matlab Link for this purpose.  Can it be used also within Maple T.A.?  

Stig Larsson, Mathematical Sciences, Chalmers University of Technology, Sweden

 

 

 

 

What am I doing wrong here, or don't understand about Maple. I followed the 'IF' structure from Maple help. I am getting the wrong result.

a := 1:
b := 3:
if a > b then
    print(wrong)
else
    print(correct)
end if
                            correct
 

Is there a way to have Maple show me approximately how much time is left for a calculation?  

lets say I wanted to calculate the new Mersenne Prime and check to see if it is prime.. 

type(2^(74207281)-1, prime)

This would no doubt take a long time to verify but that is not my concern.  I am simply concerned with whether or not I can see how long maple thinks it will take to perform this action 

I would be in worksheet mode simply inputing a calculuation.

thanks.

Does any body have example of maple code for solving optimal control problem in deterministic model using Pontryagin's maximum (or minimum) principle?

how can solve this nonlinear integral eq?

Hi

How do I disable the black borders around each command line in worksheet mode? I've seen it at several occasions, but I don't know how to do it :)

I think it would make my worksheets look much better, especially when exporting them to PDF.

 

If you are unsure about what I meant, the black borders can be seen here: https://image.prntscr.com/image/Foc_EYldSXiqb9T_8wLuYA.png

Anybody have idea how to solve endemic equilibrium using maple? 

dS/dt=(1−p)π+φV+δR−(μ+λ+ϑ)S

dV/dt=pπ+ϑS−(μ+ϵλ+φ)V

dC/dt=ρλS+ρϵλV+(1−q)ηI−(μ+β+χ)C

dI/dt=(1−ρ)λS+(1−ρ)ϵλV+χC−(μ+α+η)I

dR/dt=βC+qηI−(μ+δ)R

 

Or solve by hand?

Look at the following code:

M1 := (t,lambda1,k,lambda2) -> exp( -(1/2)*(log(1-2*lambda1*t) + k*log(1-2*lambda2*t)) )

int( diff(M1(z,2,9,1/2),z)/sqrt(abs(z)),z=-infinity..0 )/GAMMA(1/2) 

simplify(%)

evalf(%)

returns:    -4.682354481-5.587737200*I

 

which cannot be true. 

I tried a number of "simplify" options, none of which yielded the desired simple result.

In Maple12 and 2017 we can load a .wav file and Preview no problems. 

The problem occurs when we apply a moving average from the Statistics package and then attempt to Preview the result. Warning - if you don't limit the size of the number of elements when executing the Preview you will freeze and lock up your computer as it attempts to output to the display the errors on each element.

For example.

Using the windows Ding.wav

with(AudioTools):
a:=Read("c:/test/Ding.wav"): #just a random test location I have the Ding.wav file in.
b:=ToMono(a): #changing to Mono.
c:=b^2: #squaring the signal.

with(Statistics):

d:=MovingAverage(c,30):

Preview(d[1..5]) #selecting a small number of values so I don't lock up my system.

Now Preview(d) works in M12 (ie there were no errors and a plot was presented). 

Why doesn't this work in 2017? 

Hello,

I need to construct a sequence of matrices of different sizes, but with similar structure, and to study their determinants etc.

I wrote the following code:

restart: with(LinearAlgebra):
for n from 5 to 8 do:
for i from 1 to n do for j from 1 to n do A[i,j]:=0 od: od:
for i from 1 to n-1 do A[i,i+1]:=3 od:
for i from 1 to n do A[i,i]:=4 od:
for i from 2 to n do A[i,i-1]:=5 od:
A:=([seq([seq(A[i,j],j=1..n)],i=1..n)]);
Determinant(evalm(1-t*A));
od:

 

However, I get the following error message: "Error, out of bound assignment to a list".

If I add evalm to A:=..., it changes to "Error, 2nd index, 6, larger than upper array bound 5".

I don't see why. I think that by the moment that i and/or j can assume 6, n is already 6.

So what is wrong, and how can this be fixed? Thanks in advance.

I wish to solve three linear simultaneous equations and obtain the solutions in floating point form.

the following works...

solvec:=fsolve({T+N1-m1=0, N2-N1-m2=0,T-N2-m3=0}, {T,N1,N2});

...but the solutions are given in either symbolic, or equation form.  I would like numbers - floating point form.

Below is my attempt to solve this.  with(plots) & with(plottools) is not necessary for this - but I was doing some related graphic work.  I did try with(RealDomain), but it seemedto make little difference.  I have done a copy & paste of an rtf file, but the Maple output has not come out so well.  Any help would be appreciated. 

> restart:

with(plots):

with(plottools):

with(RealDomain);

#Masses in kg (or pounds!)

m1:=70.0:m2:=25.0:m3:=3.0:

#Equations

solvec:=fsolve({T+N1-m1=0, N2-N1-m2=0,T-N2-m3=0}, {T,N1,N2});

#Above gives the solutions in symbolic or equation form, as well as putting the solutions in a set.  How can the programme distinguish between the various values?

 

# From here is my attempt to form floating point values – to no avail.

NTab:=convert([solvec],table);

N1A:=evalf(solvefor[N1](T+N1-m1*g=0, N2-N1-m2*g=0,T-N2-m3*g=0));

N1B:=convert(N1A, float);

 

#Problem to isolate the solutions in the vector in floating form,

#and also get the correct ones.  NB the solution is a set - not an ordered list.

maxvec:=max(solvec[1],solvec[2],solvec[3]);

#maxvec:=convert(max(solvec[1],solvec[2],solvec[3]), float);

maxvec:=convert(solvec[2], float);

solvec[2];

whattype(solvec[2]);

type(N2,symbol);

type(solvec[2],equation);

N2_fl:=evalf(solvec[2]);

N2_fl:=convert(solvec[2], float);

 

N3:=N2_fl+3;

#Actual true answers

#T:=(m1+m2+m3)/2;

#N1:=(m1-m2-m3)/2;

#N2:=T-m2;

 

OUTPUT:

 

 

Error, (in simpl/max) arguments must be of type algebraic

 

Error, (in simpl/relopsum) invalid terms in sum

Is there a way for Maple to tell where the error occurs? For example I am not able to find the error that says 'Error, missing operator or `;'' in the following code.

 

# ctrl + del to delete a Maple cell
# golden search implementation
# chapra 7th ed
golden_search := proc(f, xl, xu, es100, maxiter)
description "find the optimal point using golden-search optimization method";
locals R, d, xopt, x1, x2, f1, f2, iter, ea, xint;
R := (sqrt(5)-1)/2;
d := R*(xu-xl);
x1 := xl + d;
x2 := xu - d;
f1 := evalf(eval(f, x = x1));
f2 := evalf(eval(f, x = x2));
# declare iterator and ea
iter := 1;
ea := 1.00;
# start while
while ea*100 > es100 and iter < maxiter do
    d := R*d; # new golden ratio
    xint := xu - xl;
    if f1 > f2 then
        xopt := x1;
        fx := f1;
        x1 := x2;
        x2 := x1;
        x1 := x1 + d;
        f2 := f1;
        f1 := evalf(eval(f, x = x1));
    else
        xopt := x2;
        fx := f2;
        xu := x1;
        x1 := x2;
        x2 := xu - d;
        f1 := f2;
        f2 := evalf(eval(f, x = x2));
    end if
    # calculate new ea
    if xopt <> 0 then
        ea := (1 - R)* abs(xint/xopt);
    end if
    iter = iter + 1;
end do;
# return xopt and fx here
xopt;
end proc:
 
First 894 895 896 897 898 899 900 Last Page 896 of 2434