MaplePrimes Questions

Use the bisection method in a while loop to estimate the root of f = (x − 1/9)(x − 2)(x − 3) which lies between 0 and 1 to an accuracy of 10^−4 .  

Good afternoon! I can not give such terms in the procedure, simplify and evalf do not help. Why does it write three lambdas instead of a lambda in a cube?
What can I do about it?


help.mw
 

 

I want to simulate the behaviour of a mass-spring system under an oscillating acceleration, but I also want that the mass remains between two rigid walls (no bouncing has to be considered).
Here is the notional example I use in the attached file (here x(t) will have to verify x(t) >= 0 and x(t) < 2).

s := t -> 10*cos(t)-x(t):

sys := { 
  diff(v(t), t)=s(t), 
  diff(x(t), t)=v(t), 
  v(0)=0, 
  x(0)=0
}:

When the mass reaches one wall it gets stucked at it until the acceleration allows it to take off from this wall. It can then move to the opposite wall and possibly get stucked at it waiting for appropriate conditions to fly again.
Here are two images to help you understand what happens:

  1. the first one represents the "unbounded" solution of the system above
  2. the second is the "bounded" solution
     

To obtain the right picture I construct the solution piecewise (the method, based on events and the use of discrete variables, is described in the attached file).
For some reasons I would like to build the global solution "in one shot" and no longer have to assemble it from elementary pieces (the blue, red and gray chunks on the right figure).
I've tried to do this through events but  I have failed so far (an ettempt is presented in the attached file).

From_wall_to_wall.mw

Could you show me how to use "events" to handle this problem?

Thanks in advance

Hi there.

It looks strange but simplify/symbolic cannot handle expression in file:

example.mw

Only after expanding numerator and denominator by hand.

I think simplify/symbolic should be smarter.

The following example (from help, direct call, without with) does not work.

restart;
(Q[`0`],Q[`1`],Q[`+`],Q[`-`],Q[`*`],Q[`/`],Q[`=`]) := (0,1,`+`,`-`,`*`,`/`,`=`):
A := Matrix([[2,1,4,6],[3,2,1,7],[0,0,5,1],[0,0,3,8]]):
LinearAlgebra:-Generic:-Determinant[Q](A, ':-method' = ':-BerkowitzAlgorithm');

==> error, (in hasoption)

We must use:

LinearAlgebra:-Generic:-Determinant[Q](A, method=LinearAlgebra:-Generic:-BerkowitzAlgorithm); # 37

which I suppose is not intended!
That's because the keyword name in the code appears as 'BerkowitzAlgorithm' instead of ':-BerkowitzAlgorithm'
(The problem occurs because there is an export LinearAlgebra:-Generic:-BerkowitzAlgorithm). 
 

Hi, everyone, here is my maple code

 

restart;
In := 5.75*10^(-12);             
M := 1000;

E := 10^12;

V := 100;

m := 2300;

K := 10^9;

A := E*In;
B := M*V^2;

C := 2*M*V^2;

F := M + m;

G := K;
pde := A*diff(w(x, t), x $ 4) + B*diff(w(x, t), x $ 2) + C*diff(w(x, t), x, t) + F*diff(w(x, t), t $ 2) + G*w(x, t);
tmax := 0.05;
xmin := 0;
L := 1;
bc := w(0, t) = 0, w(L, t) = 0, D[1, 1](w)(0, t) = 0, D[1, 1](w)(L, t) = 0;

ic := w(x, 0) = 0

pdsA := pdsolve(pde, eval({bc, ic}, L = 1), numeric, spacestep = 0.01)

 

 

 

I keep getting error message: Error, (in pdsolve/numeric/par_hyp) Incorrect number of initial conditions, expected 2, got 1

but when i change the pde to:

pde := A*diff(w(x, t), x $ 4) + B*diff(w(x, t), x $ 2) + C*diff(w(x, t), x, t) + F*diff(w(x, t), t) + G*w(x, t);

it works, although that is not what i am aiming for at all.

how may i solve this? my goal is to find w(x,t)

 

Finite Fields package seemed very useless for my purpose.

Is there a way to do some linear algebra computation (finding rank, solving linear systems, finding span of vectors) over a finite field (GF(2), GF(5), GF(3^5) etc) ?

Thank you in advance

Dear all

I have the following proc I, I need a help so that the proc run without error. 

I get Error, invalid =

 

Code_eigenvalues_eigenvectors.mw

 

Thank you for any help 

Determine the sert of point  Z in complex plane isuch that  l2z-il=Im(z+1-i)

Lets say I wanna write a procedure DrawSpaceCurve3d. 

 

DrawSpaceCurve3d:=proc(fnc::algebraic, vars:name,h::integer, xvalue::range=a{integer}...b..{integer})
plots:-spacecurve([vars, h, funk(vars, h)], ':-x' = 'xvalue')
end proc; 

How I try to run this procedure, then I get the following error. 

"Error, (in Plot:-SpaceCurve) parameter range in the form name=range is missing"

So my question is it possible to get Maple to accept that I write DrawSpaceCurve3D(x^2*y, 2, xvalue=[-5..5]) 

I know the y - curve is missing, but I would like to see if I can get Maple to accept this kind of input?
 

I am trying to solve three simultaneous PDE where the first two PDEs are 1D while the third is 2D. When using pdsolve with numeric option I am getting the following error

Error, (in pdsolve/numeric/process_PDEs) PDEs can only contain dependent variables with direct dependence on the independent variables of the problem, got {Tg(t, z, 0.6985e-1)}. Can someone please help me with this.

 

restart;
T_well := 10. + 0.026*z;

PDE_in := -0.493381*diff(Ti(t, z), z) + diff(Ti(t, z), t) = 0.000176303*(-Ti(t, z) + To(t, z));
PDE_out := 0.186546*diff(To(t, z), z) + diff(To(t, z), t) = 0.0397694*(Tg(t, z, 0.06985) - To(t, z)) + 0.0000666597*(Ti(t, z) - To(t, z));
PDE_g := 0.22828*10^7/3.5*diff(Tg(t, z, r), t) = diff(Tg(t, z, r), r)/r + diff(Tg(t, z, r), r, r) + diff(Tg(t, z, r), z, z);
PDE := {PDE_g, PDE_in, PDE_out};
IC := {Tg(0, z, r) = T_well, Ti(0, z) = T_well, To(0, z) = T_well}
BC := {3.5*D[2](Tg)(t, 2000, r) = -3/40, 3.5*D[2](Tg)(t, z, 0.06985) = 0.0397694*(Tg(t, z, 0.06985) - To(t, z)), Tg(t, 0, r) = 10, Tg(t, z, 50) = 10 + 0.026*z, To(t, 0) = 10, To(t, 2000) = Ti(t, 2000)}
pdsolve(PDE, IC, BC, numeric)


 

with(plots);
a := -Pi;
b := Pi;
implicitplot3d(1/2*(sin(2*x)*cos(y)*sin(z) + sin(2*y)*cos(z)*sin(x) + sin(2*z)*cos(x)*sin(y)) - 1/2*(cos(2*x)*cos(2*y) + cos(2*y)*cos(2*z) + cos(2*z)*cos(2*x)) + 0.15 = 0, x = a .. b, y = a .. b, z = 1/2*a .. 3/2*b, grid = [70, 70, 70], style = patchnogrid, shading = xy, lightmodel = light2);
 

 

Hi! Is it possible to get more clear mesh plot when the grid is such large? 

Hello,

I am working on a project to code a conjecture in Maple and I am stuck.  It is as follows:

"Someone had a conjecture that any odd number greater than one can be written as the sum of a prime number and twice a perfect square.  (ie 3=3+2*02, 15 = 7+2*22)  I would like to know if this holds for all the numbers from 3 to 9,000 and if not, which odd numbers fail this criteria."

I have very little coding experience so I am looking to see if anyone has an idea where I can go with this.  I tried the following:

X=P+2*N where

X:=seq(3+2i, i=0..4499);

P:={seq(ithprime(i), i=1..1250)};

N:=seq(i^2, i=0..100);

Once I get this far, however, I don't know where to go.  I would like the left side of the equation to run from 0 through 4499 (giving me a value of over 9000) while the right side does the same thing.  If there are any situations where the left side and right side do not equal each other, I want it to tell me.

My apologies if this is too wordy or confusing.  Thank you.

Dear all,

I cannot quite seem to figure out what it is that I am doing wrong. In the plots that I am trying to plot, I keep getting an error "Error, bad index into Matrix". I understand what the error means (having read through the webpage that it takes me to), but I cannot figure out what my mistake is. Can someone please help me understand what I am doing wrong?

Simple_Plot.mw

In order to use a physical constant I have to load the package "ScientificConstants". For instance, if I need the speed of light, c, I have to assign c:= Constant(c). In other words just by loading ScientificConstants the constants are not automatically assigned. Is that correct?

First 302 303 304 305 306 307 308 Last Page 304 of 2308