Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Does anyone have any ideas on why this integral (third equation) is taking so long to solve/plot? Are there any hints on how to speed up the process?

I'm running Maple 2019.1, and it was chugging away for about 5 minutes before I pulled the plug.

If I have 2.14 & 10 or 2.14 & 20 as my plot arguments, it takes about 3 s. After 20, it just doesn't want to work.

P1:=(r,R)->(2/Pi)*(arccos(r/(2*R))-(r/(2*R))*sqrt(1-(r/(2*R))^2))

J0:=(r,shk)-> BesselJ(0, 2*Pi*r*shk);

Jhk:=(s,shk,R)-> evalf((1/s)*Int(P1(r,R)*J0(r,shk)*sin(2*Pi*r*s), r=0..2*R));

plot(Jhk(s,2.14,38), s=0..5)

I'm attempting to use Maple to study Maxwell's Equations, but as a newbie to Maple, I quickly became stuck :-)

For some context, this link shows how it is possible to accomplish this using Mathematica:

https://www.wolfram.com/mathematica/new-in-10/inactive-objects/study-maxwells-equations.html

This is how I have attempted the same in Maple:

Maxwell's Equations

NULL

Initialise

 

restart

with(Physics[Vectors])

[`&x`, `+`, `.`, ChangeBasis, ChangeCoordinates, Component, Curl, DirectionalDiff, Divergence, Gradient, Identify, Laplacian, Nabla, Norm, Setup, diff]

(1.1)

Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(1.2)

``

````

Maxwell's Equations

 

Maxwell_1 := Curl(E__field_(x, y, z, t)) = -(diff(B__flux_(x, y, z, t), t))

Physics:-Vectors:-Curl(E__field_(x, y, z, t)) = -(diff(B__flux_(x, y, z, t), t))

(2.1)

Maxwell_2 := Curl(H__field_(x, y, z, t)) = diff(D__flux_(x, y, z, t), t)

Physics:-Vectors:-Curl(H__field_(x, y, z, t)) = diff(D__flux_(x, y, z, t), t)

(2.2)

Maxwell_3 := Divergence(D__flux_(x, y, z, t)) = 0

Physics:-Vectors:-Divergence(D__flux_(x, y, z, t)) = 0

(2.3)

Maxwell_4 := Divergence(B__flux_(x, y, z, t)) = 0

Physics:-Vectors:-Divergence(B__flux_(x, y, z, t)) = 0

(2.4)

``

``

Constitutive Relations

 

Eq_1 := D__flux_(x, y, z, t) = epsilon*E__field_(x, y, z, t)

D__flux_(x, y, z, t) = varepsilon*E__field_(x, y, z, t)

(3.1)

Eq_2 := B__flux_(x, y, z, t) = mu*H__field_(x, y, z, t)

B__flux_(x, y, z, t) = mu*H__field_(x, y, z, t)

(3.2)

``

``

Solution

 

We need to get the Curl of H, to take the Curl of both side of Maxwell_1:

Curl(Maxwell_1)

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -Physics:-Vectors:-Curl(diff(B__flux_(x, y, z, t), t))

(4.1)

Now substitute B for H:

subs(Eq_2, %)

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -Physics:-Vectors:-Curl(diff(mu*H__field_(x, y, z, t), t))

(4.2)

OK, we manage to get Curl of H, so now we need to substitute the Curl of H with an expression in D.

subs(Maxwell_2, %)

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -mu*Physics:-Vectors:-Curl(diff(H__field_(x, y, z, t), t))

(4.3)

Well that didn't work, so try to seperate the Curl of H so that we can substitute for D.``

collect(%, Curl(H__field_(x, y, z, t)))

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -mu*Physics:-Vectors:-Curl(diff(H__field_(x, y, z, t), t))

(4.4)

simplify(%)

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -mu*Physics:-Vectors:-Curl(diff(H__field_(x, y, z, t), t))

(4.5)

collect(%, Curl(H__field_(x, y, z, t)))

Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -mu*Physics:-Vectors:-Curl(diff(H__field_(x, y, z, t), t))

(4.6)

``

``

``

SortProducts(%, [H__field_(x, y, z, t)], totheleft)

SortProducts(Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -mu*Physics:-Vectors:-Curl(diff(H__field_(x, y, z, t), t)), [H__field_(x, y, z, t)], totheleft)

(4.7)

``

``

``

``

``

isolate(%, H__field_(x, y, z, t))

SortProducts(Physics:-Vectors:-Curl(Physics:-Vectors:-Curl(E__field_(x, y, z, t))) = -mu*Physics:-Vectors:-Curl(diff(H__field_(x, y, z, t), t)), [H__field_(x, y, z, t)], totheleft) = 0

(4.8)

``

``

``

``

``

``

NULL

NULL

``

 

I need to be able to rearrange equation 4.3 so that I can substitute for Curl of H using Maxwell_2.  Any suggestions would be gratefully received!
 

Download Maxwells_Equations.mw

Hi forum

I got a problem:

When i use these lines:

with(plots);
implicitplot(y = a*x + b, x = -10 .. 10, y = -10 .. 10, axis = [gridlines = [10, color = blue]]);



The vertical axis dosent stretches as far as i want it to.

The 'Axis Gridlines Properties' match the plot.

But the 'Axis Properties' dosent:


I can change the 'range' manually, by checking off the 'use data extend' box.
- But i need to use these plotting commands, very often.
Is it possible to write something in the plot-function, so i dosent need to do these corrections manually, every time i plot something?

Thank you in advance
Dan

Write a procedure approxInt that takes in a function f, a number of intervals
N, a left endpoint a, and a right endpoint b. Given these data, the procedure should split the
interval [a, b] into N subintervals and use the function f to estimate the area under the curve
using 
(a) Left endpoints,
(b) Right endpoints,
(c) Midpoints, and
(d) Trapezoids.

 Write another procedure called compareApproxInt that does the following:
  (a) Takes as inputs the function f, the endpoints a and b, and the number of subintervals N.
  (b) Calls the procedure approxInt in order to estimate the area under the curve of f(x) with
       N subintervals, with the four different approximations methods.
  (c) Returns four sentences:
       Using        , the approximate area under f is        . This method has a margin of error of         .

Test compareApproxInt with the functions 
 f1(x) = x
 f2(x) = x^2 ,
 f3(x) = x^3 - 4 · x^2 , and
 f4(x) = e^x ,
 each on the interval [-1, 1], with 10 subintervals.

 

Is it possible to put 2D math text on Text Area or Label components?

Like greek alpha, beta, or more complex expressions.

Hello, 

I am doing a regression analysis, but some of my model says: Warning, model is not of full rank. Can anyone help what to do with that? 

Rok := Vector([2013, 2014, 2015, 2016, 2017, 2018], datatype = float);

TrzbyCelkemEmco := Vector([1028155, 1134120, 1004758, 929584, 995716, 1152042], datatype = float);

KubickaTrzby = Statistics:-PolynomialFit(3, Rok, TrzbyCelkemEmco, x);


 

 

Thank you :)  

 

 

 

Hello.

Is there a way to make maple sum variables with a index definition?

I want to sum this

`X__1`:=4.83

`X__2`:=4.33

`X__3`:=4.66

sum(X[i], i = 1 .. 3)

But it result with X[1] + X[2] + X[3] instead of 13.81

 

Hi,

Is there anyway to solve this equation for x(t) analytically in Maple?

m * diff(diff(x(t),t), t) = - m * A * sin(2*pi*f*t) - piecewise( abs(x) < x__max, 0, abs(x) >= x__max, -k*(abs(x)-x__max)*Sgn(x)) - diff(x(t), t);

m, x_max, f, A, and k are constant parameters.

Thanks,

Baharm31

 

In the help file the permitted declartions for the second argument of the Escape command from the StringTools package are html,regexp and xml, to not specify one, which as far as I can tell instructs maple to take all characters as plain text with no escape characters.

Is this the complete list of options for the form when using the escape command?

Or is it possible to custom build escape rules?

 

Sorry to bother you with another very basic question.

This very simple example shows that Maple gives the first value that is defined back, ignoring changes further down the definition chain.

Could someone explain why, and if there is a way to always get the updated values?


 

m := Matrix(2, 2, {(1, 1) = 1, (1, 2) = 3, (2, 1) = 2, (2, 2) = 4})

Matrix(%id = 18446745932232999750)

(1)

a := 1

1

(2)

b := m[a, 1]

1

(3)

a := 2

2

(4)

b

1

(5)

m[2, 1]

2

(6)

``


 

Download VariableIndex.mw

Hi,

I've been trying to replicate an example described in a book called "Quantum Mechanics Using Maple" by M. Horbatsch, but at the end, when I'm using fsolve it returns 0. instead .500 .

I'm using Maple 18, but I think this book was written using Maple V. I don't know if the syntax changes are causing this. I'm very new to maple. Here's my worksheet (qm_maple_-_periodic_potentials.mw) and book section (qm_maple_periodic.pdf). Thanks in advance!

I was wondering if there was any way to reassign the "||" operator to calculate parallel resistors?

like this:

R1 || R2 = (1/R1+1/R2)^(-1)

 

solve it by Maple , get the following form solution, what's the Int(1,0)

 


 

restart;

 

ODE :=diff(r(t),t)=r(t)*(1-r(t)^2)+mu*r(t)*cos(t)

diff(r(t), t) = r(t)*(1-r(t)^2)+mu*r(t)*cos(t)

(1)

dsolve(ODE)

r(t) = ((_C1+2*(Int((exp(t))^2*(exp(mu*sin(t)))^2, t)))*exp(2*t+2*mu*sin(t)))^(1/2)/(_C1+2*(Int((exp(t))^2*(exp(mu*sin(t)))^2, t))), r(t) = -((_C1+2*(Int((exp(t))^2*(exp(mu*sin(t)))^2, t)))*exp(2*t+2*mu*sin(t)))^(1/2)/(_C1+2*(Int((exp(t))^2*(exp(mu*sin(t)))^2, t)))

(2)

g := unapply(sqrt((C1+2*(Int((exp(t))^2*(exp(mu*sin(t)))^2, t)))*exp(2*t+2*mu*sin(t)))/(C1+2*(Int((exp(t))^2*(exp(mu*sin(t)))^2, t))), t)

proc (t) options operator, arrow; ((C1+2*(Int((exp(t))^2*(exp(mu*sin(t)))^2, t)))*exp(2*t+2*mu*sin(t)))^(1/2)/(C1+2*(Int((exp(t))^2*(exp(mu*sin(t)))^2, t))) end proc

(3)

g(0)

1/(C1+2*(Int(1, 0)))^(1/2)

(4)

``


 

Download m39.mw
 

I'm working along in Maple 2019 and then all of a sudden it freezes.  Anyone else have this?

Maple 2018 and earlier displayed an Array like this

In Maple 2019 I get this

How do I display Arrays in Maple 2019 like Maple 2018?

First 574 575 576 577 578 579 580 Last Page 576 of 2218