MaplePrimes Questions

I am trying to use task programming but getting incorrect results and taking more time when using a single core.  Please help

TASK_PARALLEL3.mw

Hello everyone,

I would have a question about how to colour a region of complicated inequalities.

I'm curious about the region where my 'lambdas' are all negatives regarding the parameters 'pm2' and 'am2', but I always find difficulties even if I try with implicitplot or inequal commands. Also, I would like to put into the same graph with different colours when they are separately smaller than 0.

I've already tried plenty of things, I hopefully attached some pics by snipping tool about them.  And here is an example of my problem:

p61w:= implicitplot([lambda61 <= 0], pm2 = 0 .. 1, am2 = 0 .. 1)

in61 := inequal(lambda61 <= 0, pm2 = 0 .. 1, am2 = 0 .. 1)

 

display(in61,p61w)

 

 

So, the main issue that it is not just coloured where my condition is true, but elsewhere too. In plot 'in61' as you can see, there is a region approx. pm2=0..0.6 where it shouldn't be coloured since my condition is not true there. In the graph; 'display(in61, p61w)',  it is visible that under the red line should be just coloured however my 'inequal' command coloured it outside too. 

Also, I tried with implicitplot, for example:

p6 := implicitplot([lambda61 <= 0], pm2 = 0 .. 1, am2 = 0 .. 1, filled = true, coloring = [blue, white], transparency = .5)

But the result is similarly wrong. And I'm not sure why it happens and how can I fix it.

(It's okay if for example for these particular lambdas (lambda61,lambda62) never negatives together, but I have more systems and I don't think it works properly)

I read similar questions too but I couldn't find an answer so, I would very appreciate any suggestions.

This is my first post in Maple, so please let me know if I have mistaken something.

Suppose I have an expression or a defined function that uses basic operations(typical stuff)... I have to go and add % to every operation to prevent it expanding so I can see the expression in detail. This really dirties up the formula.

 

Is there any way to automate this?

 

E.g., simple example

 

f := x->3%*x %+ x%^4;

 

 

Also %^ seems to have invalid order of operations, this seems like a bug in maple? 2%^x does not behave like 2^x in complex expressions, I have to put parathesis around it to avoid it grouping with other terms. It seems to do this with multiplication too. This then requires using tons of paranethesis to get normal expressions to behave correctly.

 

What would be real cool if one could automate all this and also have some way to control the expansion amount. E.g., some parameter than one can set to control from no expansion to full expansion(it would work by making inner most expressions inert then working to outer).

Also, it seems when I use the inert operators and make sure the precendence is correct maple evaluates the wrong value! I have used inert before and it seemed right but now I get very large values. There is something seriously buggy with %op.

If I type a differential equation in Maple software, I am getting a numerical value as in the below image. Can anybody help me to rectify the error? Thanks in advance.


 

 

 

I am experimenting with using units especially for when there are awkard conversion factors. 

The document is for motor gearbox torques inertia ration and frequency.

I have documented my specific questions in the worksheet.

I am interested is see different ways of setting this up. Like I would rather setup the formulas at the start, then supply figures.


 

restart

``

with(Units[Natural])

UseSystem('SI')

UseSystem(SI)

(1)

Can I set the units for mass, accel, etc. so I don't have to re enter the default units if I change the figures later?

``

Mass := 3000*'kg'

3000*Units:-Unit(kg)

(2)

Accel := 1.5*'m'/'s'^2

1.5*Units:-Unit(m/s^2)

(3)

Rat := 5

5

(4)

``

Radius := (1/2)*(0.8282e-1-0.6e-2)*'m'

0.3841000000e-1*Units:-Unit(m)

(5)

Torque := Mass*Accel*Radius

172.8450000*Units:-Unit(J)

(6)

````

MotorTorque := Torque/Rat

34.56900000*Units:-Unit(J)

(7)

Jload := Mass*Radius^2

4.425984300*Units:-Unit(kg*m^2)

(8)

Jmtr := 1.42*10^(-2)*'kg'*'m'^2

0.1420000000e-1*Units:-Unit(kg*m^2)

(9)

Parse:-ConvertTo1D, "first argument to _Inert_ASSIGN must be assignable"

12.46756141

(10)

stiff := convert(48, 'units', 'N'*'m(radius)'/'arcmin', 'N'*'m(rarius)'/'rad', 'symbolic')

518400/Pi

(11)

/rad

518400/Pi

(12)

"(->)"

0.16501e6

(13)

``

Freq := sqrt(stiff/Jload)/(2*Pi)/s   i.e. Hertz

30.73072153*Units:-Unit(1/(kg^(1/2)*m))

(14)

stiff := 4567

4567

(15)

Freq

30.73072153*Units:-Unit(1/(kg^(1/2)*m))

(16)

``


 

Download Units_questions.mw

I want to solve the following IBVP:

However, the answer given by pdsolve doesn't give  with pdetest.


 

restart

eq := diff(u(x, t), t)-k*(diff(u(x, t), x, x)) = 0

diff(u(x, t), t)-k*(diff(diff(u(x, t), x), x)) = 0

(1)

ic := u(x, 0) = 0

u(x, 0) = 0

(2)

bc := u(0, t) = p(t)

u(0, t) = p(t)

(3)

sol := `assuming`([simplify(pdsolve([eq, ic, bc]))], [k > 0, x > 0, t > 0])

u(x, t) = (1/2)*x*(Int(p(zeta)*exp(-(1/4)*x^2/(k*(t-zeta)))/(t-zeta)^(3/2), zeta = 0 .. t))/(Pi^(1/2)*k^(1/2))

(4)

`assuming`([simplify(pdetest(sol, [eq, ic, bc]))], [k > 0, t > 0, x > 0])

[(1/2)*x*(-t*(Int(p(zeta)*exp(-(1/4)*x^2/(k*(t-zeta)))/(t-zeta)^(7/2), zeta = 0 .. t))+limit(p(zeta)*exp(-(1/4)*x^2/(k*(t-zeta)))/(t-zeta)^(3/2), zeta = t)+Int(p(zeta)*exp(-(1/4)*x^2/(k*(t-zeta)))*zeta/(t-zeta)^(7/2), zeta = 0 .. t)+Int(p(zeta)*exp(-(1/4)*x^2/(k*(t-zeta)))/(t-zeta)^(5/2), zeta = 0 .. t))/(Pi^(1/2)*k^(1/2)), 0, -p(t)]

(5)

``

Download IBVP.mw

Hi i'm trying to plot a height(feet) and distance(time) of a projectile.

I doesn't seem to land.

Thanks in Advance

 

Projectile.mw

Hello,

       I  am trying to use the ODE Analyzer tool in order to solve a system of differential equations, and then add the plot of a polynomial function to the plot generated using the ODE Analyzer tool.

       I have successfully figured out how to use the ODE analyzer to produce the plot of the solution curve:

Here's the system of DE's:

diff(f(x), x) = u(x)

diff(u(x), x) = x + f(x) - f(x)^2

Initial conditions: f(0) = -1, u(0) = 1

The code for the solution curve is given by the ODE Analyzer as follows:

sol1 := dsolve([diff(f(x), x) = u(x), diff(u(x), x) = x + f(x) - f(x)^2, f(0) = -1, u(0) = 1], numeric, method = taylorseries[series]);
plots[odeplot](sol1, [x, f(x)], 0 .. 10, color = red);

Does anyone know how I might add an additional plot to compare to the plot the ODE Analyzer produced?

The plot I would like to add is: T(x) = -1 + x - x^2 +2/3*x^3 - 1/3*x^4 + 1/5*x^5

Thanks!

 

 

Hi there:

 

I have a short question. For an algorithm, I need a solution to a linear equation, and I use LinearAlgebra[LinearSolve]. In the case of

 

0            0                    0

                       =      

5            0                    0

 

for example, there are infinitely many, however, so Maple returns (_t2,0). My algorithm just needs one solution, if there are multiple ones, then any (except for _t2=0) is fine. However, if (_t2,0) is the saved solution, the algorithm later breaks down, since it does not expect the extra variable. Is there any way to tell Maple to replace every variable with, say, 1 when solving such an equation?

 

Currently I am using maple as a backend computer algebra system that is doing the heavy lifting for an application written in python. 

The procedure I currently use is:

app.py
```
from subprocess import run
my_input = 1233
cmd = 'cmaple -q -c input:={}: backend.mpl'.format(my_input) # Command Line call to cmaple
output = run(cmd, capture_output=True)
stdout = str(output.stdout) # A bytes object i.e. b'            1234\n\r\n\r'
# Do some string operations on stdout to get the output I want
output = stdout[-12:-8] # '1234'
```

backend.mpl
```
#do something with my_input
output := my_input+1:
#print to console to be recovered later
print(output);
quit:
```
This setup works reasonable well so long as I know exactly what format the ```output``` is going to be in but is not effective when I want to access more than one ```output``` or when the required ```output``` is a float.

I realise that I could likely save these variables to a file (a .csv say) and load them into ```app.py``` that way, but the dream is that there would be some way to directly access the variables in ```backend.mpl``` from within memory, an analogue of the ```Pipe``` framework in python for example?
 

Here is my try:

with(plots):
epsilon:=5*Pi/2:
gammaa:=0.4:
gammao:=0.1:
gammab:=0.002:
omegab:=100:
X:=60:
Omega:=6*Pi:
g:=10:
sigmag:=5*gammaa:
a:=1/(sigmag*sqrt(2*Pi)):
for deltao from 0 to 4 do
D7:=evalf(a*int(g*Omega*(gammao/2-I*Delta)*exp(-0.5*((Delta-deltao)/sigmag)^2)/(gammao^2/4+Delta^2),Delta=-infinity..infinity)):
D8:=evalf(0.5*a*int(g^2*gammao*exp(-0.5*((Delta-deltao)/sigmag)^2)/(gammao^2/4+Delta^2), Delta=-infinity..infinity)):
D9:=evalf(a*int(g^2*Delta*exp(-0.5*((Delta-deltao)/sigmag)^2)/(gammao^2/4+Delta^2), Delta=-infinity..infinity)):
b1:=deltao-(2*X^2*omegab*Y^2)/(omegab^2+gammab^2)-D9:
f:=epsilon-D7=Y*(gammaa+D8+I*(b1)):
P1:=implicitplot(f,Y^2=0..10,delta0=0..1,numpoints=1000,axes=boxed,thickness=2,color=black,font=[1,1,20],tickmarks=[4, 3],linestyle=1);
end do:

display(P1);

The function (f)  is an implicit function of Y^2

so my code above is an example to plot Y^2 against deltao

note that Y is complex

I appreciate valueble comments.

Hello guys, 

im not an expert of maplesim, I'm working on one of the default quarter car models (first pic).

 

 

I set a probe to measure the instant contact force between the tire and the post, but the graph shows that the force reaches both posite and negative values (as if the post were pulling back down the tire, is that right?)

What l have to do in order to see the real contact force graph? i just want to see the real positive value or 0. 

 

 

I have a variable that can take multiple values since it is the RootOf solution of a polynomial. Based on the setup of the problem, the variable should be between 0 and 1, and therefore should be only one of the four values spitted out by the allvalues of the RootOf function. How can I make Maple understand that this variable should only take one of the four values that is the outcome of allvalues of the RootOf function? Can I define this variable to be between 0 and 1 upfront? If not, how do you make Maple "pick" only one value out of multiple outcomes of allvalues evaluation?

 

Dear friends, please I would like to ask for your help with the following problem: 

I need to invoke the number of elements of an Array working with parallel programming in the task programming model. I've tried to used the command rtable_num_elems as it is contained in the thread safe functions lists. However, Maple does not recognize it as I obtain the error "Bad index into array". Using the same code, I've substituted the array for a list and rtable_num_elems for nops and the code works perfectly. What could I be doing wrong? I need to use arrays given the extension of the data I'm handling. 

Many thanks for your kind help. 

I have this problem, that maple wont isolate for x_1. I want to automate the prosses of any funktion, but how come it not work?

Hope you can help 

First 423 424 425 426 427 428 429 Last Page 425 of 2308