MaplePrimes Questions

1 discuss and show graphically the effects of decrease in wage on labor supply. if A, leisure is normal good. B, if leisure is inferior good.

How do I animate the cylinder width, or some variation of it as we trace it's path in the z-axes

with(plots);
with(plottools);
display([seq(cylinder([2, 2, 2], 3, i/10, capped = false), i = 1 .. 60)], insequence);

 

Hi,

I'm trying to create an agent vehicle which drives along a path of a uniform width, and finds the distance to the edge of the path directly ahead of it. Like this:

The aim is to somewhat simulate how far the agent can see down the road.

Since the thickness of a plot curve is unrelated to the units of the axis, and has no means of interacting with objects this would be no use.

I also considered shadebetween function, however this only can shade between the y values of 2 functions, so for a vertical curve it cannot produce any width to the path.

I then realised using parametric equations of form (x(t), y(t)) would likely make most sense and wrote some code which roughly gets the boundarys at a fixed distance from the centre path equation, by adding the x-y components of the reciprocal of the gradient:

For certain simple path equations such as this one, it roughly works other than the areas between which the boundary curves overlap themselves (I would need to find these points of intersection and break the curves up to remove these squigly inner bits). Any advice on this would be much appreciated cause this seems like it will be tricky, if not computationally heavy.

 

More annoyingly, due to the nature of the trig functions involved, for more complex graphs which include a vertical turning point, the left and right boundaries seem to swap over:

and

Clearly this is not the behaviour I had in mind.. and I'm not sure what I can do to fix it, I think maybe using piecewise trig may be a potential solution to avoid the jumping from + to -, though I'm not sure where I would put these breakpoints (I've tried just using abs(arctan(...)) with no luck).

 

If anyone could help wih this that would be really appreciated, or even suggest a better approach to this problem!

Thanks

 

[code] agentpath.mw

I just updated to Maple 2020

interface(version)

Standard Worksheet Interface, Maple 2020.0, Windows 10, March 4
   2020 Build ID 1455132

Physics:-Version()
         The "Physics Updates" package is not installed

My question is: For new Maple 2020 installation, should one go and install latest Physics package from the cloud, which I see is at version 619 now, or is it allready included in the new Maple 2020?

 

 

 

 

 

 

Help me to export data of 3d plot

Download export.mw

Dear,

 

Could you please help me with the following problem? 

I have a list, say, L:= [2,3,4,5]; 

and I need to find the position of several of its elements. However, when a apply the BinarySearch command I get a wrong return. For example, element >= 5:  BinarySearch(L, 5, `>=`);  

Maple returns 0

Element = 4: BinarySearch(L, 4, `=`); 

Maple returns 0

Element < 3: BinarySearch(L, 3, `<`); 

Maple returns 2. 

Obviusly, I'm doing something wrong. Could you please tell me what it is?

Many thanks for your help.

 

I am trying to get the output of the system of ODE in the mesh form. Can I set the step length for range? when I use range=0..10 it takes many values whereas I only need the values for integers between 0 and 10 inclusive.

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

 

First 326 327 328 329 330 331 332 Last Page 328 of 2174