Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I don't understand why the solution of sys_2 isn't those of sys_1 when M__p=1 and M__a=0 ?

Traces of the computation seem to indicate that dsolve proceeds exactly the same for sys_2 and sys_1 .

Please note that sol_1 contains a term of the form t*cos(t) that sol_2 doesn't, thus the question: "Is sol_2 correct?"

Could you help me to fix this?
TIA

restart

infolevel[dsolve] := 4;

4

(1)

sys_1 := {diff(x(t), t$2)=sin(t)-x(t), x(0)=0, D(x)(0)=0};
sol_1 := dsolve(sys_1)

{diff(diff(x(t), t), t) = sin(t)-x(t), x(0) = 0, (D(x))(0) = 0}

 

Methods for second order ODEs:
--- Trying classification methods ---
trying a quadrature
trying high order exact linear fully integrable
trying differential order: 2; linear nonhomogeneous with symmetry [0,1]
trying a double symmetry of the form [xi=0, eta=F(x)]
-> Try solving first the homogeneous part of the ODE
   checking if the LODE has constant coefficients
   <- constant coefficients successful
   -> Determining now a particular solution to the non-homogeneous ODE
      building a particular solution using variation of parameters
<- solving first the homogeneous part of the ODE successful

 

x(t) = (1/2)*sin(t)-(1/2)*cos(t)*t

(2)

sys_2 := {(M__p+M__a)*diff(x(t), t$2)=M__p*sin(t)-x(t), x(0)=0, D(x)(0)=0};
sol_2 := dsolve(sys_2)

{(M__p+M__a)*(diff(diff(x(t), t), t)) = M__p*sin(t)-x(t), x(0) = 0, (D(x))(0) = 0}

 

Methods for second order ODEs:
--- Trying classification methods ---
trying a quadrature
trying high order exact linear fully integrable
trying differential order: 2; linear nonhomogeneous with symmetry [0,1]
trying a double symmetry of the form [xi=0, eta=F(x)]
-> Try solving first the homogeneous part of the ODE
   checking if the LODE has constant coefficients
   <- constant coefficients successful
   -> Determining now a particular solution to the non-homogeneous ODE
      building a particular solution using variation of parameters
<- solving first the homogeneous part of the ODE successful

 

x(t) = sin(t/(M__p+M__a)^(1/2))*M__p*(M__p+M__a)^(1/2)/(M__p+M__a-1)-M__p*sin(t)/(M__p+M__a-1)

(3)

eval(sol_2, [M__p=1, M__a=0])

Error, numeric exception: division by zero

 

 

Download SomethingWrong.mw

PS: Already, in the following case, dsolve doesn't return the solution of sys_1.

sys_3 := {(A+B)*diff(x(t), t$2)=(A+B)*sin(t)-x(t), x(0)=0, D(x)(0)=0};
sol_3 := dsolve(sys_3)

If I do this

sys_4 := {(A+B)*diff(v(t), t)=(A+B)*sin(t)-x(t), diff(x(t), t)=v(t), x(0)=0, v(0)=0}:
sol_4 := dsolve(sys_4)

I get a very complex solution wich contains a piecewise function which separates the cases A+B=1 and A+B<>1.
Evaluating sol_4 for A+B=1 gives the same expression than sys_1:

simplify(eval(sol_4, A=1-B), trig)
       /       1                  1          1         \ 
      { v(t) = - sin(t) t, x(t) = - sin(t) - - cos(t) t }
       \       2                  2          2         / 

Here is a workaround to get the correct solution of sys_2:

sys_5 := {(M__P+M__A)*diff(v(t), t)=(M__P+C)*sin(t)-x(t), diff(x(t), t)=v(t), x(0)=0, v(0)=0}:
sol_5 := dsolve(sys_5):
simplify(eval(sol_5, [M__P=1, M__A=0, C=0]), trig)
       /       1                  1          1         \ 
      { v(t) = - sin(t) t, x(t) = - sin(t) - - cos(t) t }
       \       2                  2          2         / 

e

Hi, 

Please how I do plot: theta := -(65.7014900075861*(cos(-4.536529763+45365.29764*z)+.1749541674))*exp(-1.603200636*t) for z=0..d.

I tried this: 

display(plot([seq(subs(t = i, theta), i = [seq(0.1*ii, ii = 1 .. 7)])], z = 0 .. d));

But I want this sequence: [seq(subs(t = i, theta), i = [seq(0.1*ii, ii = 1 .. 7)])] to include Pi/2 such that t_0 = Pi/2 in the plot. I.e., I want the Pi/2 to be the initial value in the sequence.

I compute the solution of this differential system

shock := piecewise(t <0, 0, t < 1, 10, 0):
sys   := {(M__p+M__a)*diff(x(t), t$2)=M__p*shock-x(t), x(0)=0, D(x)(0)=0}
sol   := unapply(rhs(dsolve(sys)), (M__p,M__a))

I'm interested in 3 quantities:

  • the first time tend > 0 such that sol(tend) = 0,
  • the time tmax in (0..tend) where sol(tmax) reaches its maximum value,
  • the value xmax = sol(tmax).

Since sol has a relatively simple expression, I first attempted to use solve for calculating tend, but that didn't work.
The conclusion is still the same for tmax and xmax.

The values of these 3 quantities that I expect solve to provide, are those obtained using fsolve.

Can you explain me the failures I faced and show me how to force solve to get these values?
TIA

ToyProblem.mw

Paulina Chin of Maplesoft and I are pleased to annouce Maple Transactions Volume 2 Issue 1, the Proceedings of the 2021 Maple Conference.

Articles can be found at mapletransactions.org

Some articles are written directly in Maple and are published via the Maple Cloud.  There is also a Demo Video by Michael Monagan of his new GCD code.  There are articles on Math Education, on Applications of Maple, on software, and on mathematics research.  We draw particular attention to the article by Veselin Jungic, 3M Teaching Fellow at SFU and a Fellow of the Canadian Math Society, on Indigenising mathematics.  We hope that, as members of the Maple Community, you find much of interest.

Best wishes,

Rob Corless, Editor-in-Chief

Maple Transactions

Forest of ethnomathematics and its root.  Colourful natural trees growing in a forest above ground while below ground is a colourful mathematical tree going to a single glowing root

Let S be a set S={E1,E2,E3,E4,.....,Ek}  where E1 is a set of edges, E2 is another set of edges etc.

that like E1={{1,2},{2,3},..}, E2={{3,4},{1,2},....} , now we need to pick all possible  distinct sets of  size L  from the k sets of S such that the 

{E1,E2,E3,....,EL} are mutually disjoint with each other in other.

Ei intersect Ej is null no edge in common for i  not equal to j    where i, j varies from 1 to L.

F is the function which takes to parameters set S and L.

F(S,L)  then returns all possible sets which are such that {E1,E2,E3,....,EL} are mutually disjoint with each other in other.

Here mutually disjoint in graph theory terms they are edge-disjoint mutually 

I hava a recursive formula with variable n. The answer has the variable n and also N1.  What doe N1 mean?

Currrently maple exports it in huge fonts do the pdf is really big. I would like to make the pdf smaller by decreaseasing the font size. I cant seem to find any options for that online.


 

New generalized unit vectors in Physics:-Vectors

 

The Physics:-Vectors package, written many years ago to teach Vector Analysis to 1st year undergrad students in Physics courses, introduces several things that are unique in computer algebra software. Briefly, this package has the ability to compute sums, dot and cross products, and differentiation with

• 

abstract vectors, like `#mover(mi("A"),mo("&rarr;"))` or `#mover(mi("A"),mo("&rarr;"))`(x, y, z), symbols or functions with an arrow on top that indicates to the system that they are vectors, not scalars;

• 

projected vectors of algebraic (non-matrix) type in any of the Cartesian, cylindrical or spherical basis and/or associated systems of coordinates, including for that purpose an implementation of the corresponding unit vectors of the three bases;

• 

abstract or projected differential operators that involve Nabla, Gradient, Divergence, Laplacian and Curl;

• 

inert vectors or vectorial differential operators, including related expansion of operations and simplification; 

• 

path, surface and volume vector integrals.

 

In addition to the above, the display is as in textbooks, the input resembles paper and pencil handwriting, and examples of the use of Physics:-Vectors in Vector Analysis are presented in the Physics,Examples page.

 

Download New_generalized_unit_vectors.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi ---

      I know how to add the Angstrom symbol to a plot's axis label using my mouse and the palette menu.  How can I add the Angstroms symbol programmatically to the plot command?  Thanks!

David

Hi

I want to solve two equations (Eqmin and Eqmax) numerically  and plot curves of Mmin and Mmax versus "sigma" in one frame, But the  second curve (Mmax) is not plotted !  What should I do? 
(We know that only real and positive roots are acceptable)
Eq.mw

I can not spawn draw the circles C3 and C4

restart;
with(plots):
with(geometry):
_EnvHorizontalName := x:
_EnvVerticalName := y:
R := 7:
point(A, [0, R]):
line(L1, y = sqrt(3)*x + R):
line(L2, y = -sqrt(3)*x + R):
line(L3, y = R/3):
intersection(B, L1, L3):
intersection(C, L2, L3):
detail(C):
triangle(ABC, [A, B, C]):
circle(C1, [point(P1, [0, 0]), R]):
circle(C2, [point(P2, [0, R/3 + (2*R)/9]), (2*R)/9]):
detail(C2):
center(C2), coordinates(center(C2)):
reflection(P3, P2, C):
detail(P3):
reflection(C3, C2, C);
detail(C3):
Error, (in geometry:-reflection) unable to compute coeff
Error, (in geometry:-detail) unknown object:  C3
circle(C3, [point(P3*[(28*sqrt(3))/9, 7/9]), (2*R)/9]):
Error, (in geometry:-point) wrong number of arguments
reflection(C4, C2, B);
detail(C4);
Error, (in geometry:-reflection) unable to compute coeff
Error, (in geometry:-detail) unknown object:  C4
circle(C3*[point(P3, [(28*sqrt(3))/9, 7/9]), (2*R)/9]);
Error, (in geometry:-circle) wrong number of arguments


draw([L1(color = blue), 
ABC(color = red, transparency = 0.5, filled = true), 
L2(color = blue), L3(color = blue), 
C1(color = blue, thickness = 3), C1(color = yellow, transparency = 0.8, filled = true), C2(color = blue, filled = true)], 
axes = normal,
 view = [-R .. R, -R .. R], 
scaling = constrained);
Why these error messages. Thank you veru much.

Respected sir,

It looks like the Maple function IsSubgraphIsomorphic(G1,G2) function I think it is developled from the

phyton networkx package function 

GraphMatcher.subgraph_is_isomorphic()   The source python code for this is in this link below

networkx.algorithms.isomorphism.ismags — NetworkX 2.8.6 documentation

Now Can considering the Graphs G1 and G2 as vertex labeled graphs can we tweek the function in such way that rather than just to return true based on shape The function will now take a new parameter extra

IsSubgraphIsomorphic(G1,G2,Label=True or False)

If Label= True the then the function will return true if their is a subgraph G1 isomorphic in G2 with the same type of labels exists then it returns true and also returns that graph G1 edges based on those labels in G2.

Can anyone help please your help will be acknolwedged surely

Intially let it be for the undirected graph cases only.

Einstein's principle of relativity

 

The main difference between Newtonian mechanics and the mechanics based on Einstein's principle of relativity is that in the latter the velocity of light, c, is the same in all inertial reference systems. Therefore, when comparing the velocity of an object measured in two reference systems 1 and 2 that are moving relative to each other, the Newtonian rule of addition of velocities, v__2_ = v__1_+v__R_, where v__R_ is the velocity of one system with respect to the other one, is not valid; if it were, the speed v__1_ and v__2_ of light in the systems 1 and 2 would not be the same. This introduces surprising conceptual consequences, and algebraic complications in the formulas relating the values of measurements, in the systems 1 and 2, of time, space and everything else that is related to that.

 

This post is thus about Einstein's principle of relativity and the consequences of the velocity of light being the same in all inertial reference systems. Although the topic is often considered advanced, the concepts, as shocking as they are, are easy to understand, and the algebra is still tractable in simple terms. The presentation, following Landau & Lifshitz [1], Chapter 1, is at a basic level, with no prerequisite expertise required, and illustrates well how to handle the basic algebraic aspects of special relativity using computer algebra.

 

Finally, it seems to me not useful to just present the algebra when the concepts behind Einstein's theory are straightforward and surprising. For that reason, the short sections 1 and 2 are all about these concepts, and the algebra only starts in section 3, with the Lorentz transformations (which was recently the topic of a Mapleprimes post at a more advanced level ). To reproduce the computations shown in this worksheet, please install the Maplesoft Physics Updates v.1314 or any subsequent version.

 

Download Einstens_principle_of_relativity.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

 

A "while" ago this was possible by commands. E.g.:

(from https://www.youtube.com/watch?v=uaQh_bXcIGA)

I consulted the help pages for Export and CodeGeneration options, but could not find anything suitable to generate a C code file.

Did I overlook something or searched for the wrong help pages?

If such options no longer exist, what is the preferred way to transfer C code from Maple to MapleSim?

Am I supposed to copy, paste & save with a third party editor? If I do so for a C code generated from a Maple procedure (generated with makeproc), I get

A complete example that works in 2022 versions would be helpfull. The tutorial "6.6 Tutorial 6: Using the External C Code/DLL Custom Component App" unfortuneately does not include code generated by Maple that can be imported, compiled, simulated and verified against a MapleSim model as in the example from youtube (which is still very instructive by the way). 

First 281 282 283 284 285 286 287 Last Page 283 of 2219