MaplePrimes Questions

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 

Hi,

What could be an easy solution to get 2-d, 3-d etc derivatives (∂^2 V)/(∂x^2) ..,

subject to the conditions

1) 1/V(x,y) (∂V/∂x)=α(x,y)

2) -V(x,y)/diff(V(x,y),y)=beta(x,y)

More or less easy with (1), a bit tricky with (2) but is there any more or less simple and common (universal) solution(s) both for (1)-(2) and similar? I mean, find derivatives (2-d, 3-d, ...) with known first derivative.

Best

How to find the coefficient of x, x^2,and xy from the following polynomial

 

F:-2*x+6*y+4*x^2+12*x*y-5*y^2

 

coeff(F, x) gives an answer 12*y+2 but I want it as 2 etc

coeff(F, x*y) gives an error 

Error, invalid input: coeff received x*y, which is not valid for its 2nd argument, x
 

Dear maple users,

Greetings.

How to plot a contour for the below-mentioned function.

f(x):=-0.09465519086 x^3+0.02711194463 x^2+0.3862193003 x-0.00030060626-0.0003613678673 x^6-0.001538973646 x^5-0.01937304057 x^4-3.822344860 10^(-8) x^8-0.000007297718101 x^7

 

Anyone have any thoughts on how I can combine these two terms? (see screen shot)  The error message implies the units are somehow not really the same but there is no help page for this error.  Any insight would be appreciated.  Thanks.

Here is the file:  units_issue.mw

 

I want to creat a two dimisional plot of a circle.   Every time I try it gives me a parabola.

I am trying a multistart local search over a multimodal function. I need to locate around 700 local minima where the dimension of the function is very high. It will be really helpful if the computational time can be reduced. Thank you.

 

opt.mw

First 544 545 546 547 548 549 550 Last Page 546 of 2429