Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi,

How do i set up a Fourth order Runge-Kutta, RK4, routine to solve this nonlinear second order differential equation?:


  • a=-2, b=1
  • k=0.1
  • x0=2
  • from t=0..100


Do you have any good examples that is similar to this problem?

thanks

 

So I encountered a Chini differential equation which is solvable in terms of an implicit function

restart; assume(nu > 2, beta > 0, lambda > 0, delta > 0, y >= 0);
simplify(dsolve(beta+y+(D(h))(y) = nu*((lambda+beta+y)^2-delta*h(y))^(1/2)));

The answer is really too ugly to be pasted here, but I do get a
RootOf [ linear + log(linear) + delta* some integral + 2 * the very same integral]

It took me a quarter of an hour to deciphre that the integrals are the same and that I could get it all down to (delta+2)*integral. Because Maple did not simplify it. 

But if I copy what is inside the RootOf(), and paste it into a simplify() - then it does! So how to force it into doing that in the first place? 

 

Still novice, yes ... 

Hello guys, I have a problem using simplex, at linear exercises.

Example:

> Typesetting[delayDotProduct](with, simplex, true);
> minimize (4*x1+3*x2+5*x3,{x1-2*x2+3*x3>=-1,x1+x2-x3>=1},NONNEGATIVE);

And I got an error:

Error, Got internal error in Typesetting:-Parse : "'_Inert_DELAYLESSEQ' is not a valid inert form"

How can I solve this? I'm new in Maple software. I'm using Maple15.

Thank you, have a nice day!

restart;
unames();  # first call ok
unames();  # second call


Error, invalid input: Typeset:-Kernel expects an equation for keyword parameter numericformatting

Error, unexpected result from Typesetting

 

I have a polynomial of 4th order and I wanted to use allvalues on the RootOf expression. It then says:
 

Error, (in evala/Normal/preproc) reducible RootOf detected.  Substitutions are {RootOf(4678560000000000000000000000000000000000+(16573041*CO^2+70122975000000000000*CO-623180900000000000000000000000000)*_Z^4+(-19887649200*CO^2-82987335000000000000000*CO+745755960000000000000000000000000000)*_Z^3+(5966294760000*CO^2+23851989000000000000000000*CO-221858784000000000000000000000000000000)*_Z^2+(417684600000000000000000000*CO-757598400000000000000000000000000000000)*_Z) = 600, RootOf(4678560000000000000000000000000000000000+(16573041*CO^2+70122975000000000000*CO-623180900000000000000000000000000)*_Z^4+(-19887649200*CO^2-82987335000000000000000*CO+...
Error, (in allvalues) numeric exception: division by zero

So apparently the expression is reducible but how do I do that?

I'm working with Fourier Transform. I'd like to transform a noisy image to the frequency domain, create a grayscale version of the spectrum, mask the dots or lines, threshold it, multiply the binary mask image with the magnitude image and then transform back to the spatial domain. Is this possible using Maple?

 

Any help would be appreciated.

I have a procedure, se, that takes 2 real numbers as arguments and returns a list of 3 real numbers,
so, for example,
se(1.2,2.7)=[-5.85,3.24,3.9].
(The exact nature of that procedure should not be important for plotting purposes.) 

The command   >plot3d(se(x,y),x=0..2,y=-2..3);  returns a surface plot as hoped.   
(I had some doubt because the help page suggests one needs 3 functions or procedures [f,g,h] to get a 3 d plot rather than one procedure that generates a list of 3 values but Maple 2017.3 came through). 
I have another procedure , td,that takes 2 real numbers as arguments and returns a list of 3 real numbers,  ;
so, for example,
td(2.7, 3.4)=[3.4, .594943507924521, -.111391393034295].

(Again, the exact nature of that procedure should not be important for plotting purposes.) 
The command   > plot3d(td(x,t),x=0..2,t=0..3);  returns the error message: 

Error, (in dsolve/numeric/process_parameters) parameter values must evaluate to numeric, got a = x

For some reason, plot3d is going back to the body of the procedure, td, rather than just accepting the values it provides.

Knowing that quotes can sometimes solve this sort of problem I then tried:
plot3d('td(x, t)', x = 0 .. 2, t = 0 .. 3);
only to get

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

I am not sure what plot3d is complaining about. The procedure I believe has all the information it needs in the form it needs it.
I then tried another workaround.

I set td1(x,t) :=td(x,t)[1], td2(x,t) :=td(x,t)[2], td3(x,t) :=td(x,t)[3] and tried :
plot3d([td1(x, t), td2(x, t), td3(x, t)], x = 0 .. 3, t = 0 .. 2);
to get
Error, (in dsolve/numeric/process_parameters) parameter values must evaluate to numeric, got a = x
Again, for some reason, plot3d is going back to the body of the procedure td.

Finally, I tried:
plot3d('[td1(x, t), td2(x, t), td3(x, t)]', x = 0 .. 3, t = 0 .. 2);
 
and I got the plot I wanted.

I am very happy to have a working file but I do not understand what worked and why. The nest time I have such a problem I will have to resort to the mysterious syntax manipulations again and hope that I hit on a combination that works.

For completeness I include the procedure bodies for  se and td below but I think that is irrelevant information.

se := proc (x, y) [x^2-y^2, x*y, x+y] end proc;


td := proc (x, tt)
local des, ff, fpfp; global ans;
ans(parameters = [a = x]);
des := ans(tt); ff := rhs(des[2]); fpfp := rhs(des[3]); [tt, ff, fpfp]
end proc;
 and
ans:=dsolve(ic,numeric,parameters=[a]):  where ic is an ode (I used several with the same result) with initial condition involving a.;

Can anybody explain what is happening?

 

How does one declare 3d vector in Maple, say p1, p3, and x, and integrate the following function from -Infinity to q, and q to + Infinity? Note that there is an iota in the exponential, and p1.x is the dot product of p1 and x

Integrate from -Infinity to q, q to infinity w.r.t. p1 and p3 

e^( - i p1 . x ) * 1/((p3 -p1)^2)

The integration should preferably be in spherical co-ordinates, but a demonstration in Cartesian co-ordinates would also be helpful. 

how may i encounter this problem,

Please help me on this ode solve (dsolve) wit
 

restart

with(plots):

ps := 8933:

Eq1 := 8*(11-10*d)*(eta*(diff(f(eta), `$`(eta, 3)))+diff(f(eta), `$`(eta, 2)))/((1-phi)^2.5*(1-phi+phi*ps/pf))+4*f(eta)*(diff(f(eta), `$`(eta, 2)))+m*(1-4*(diff(f(eta), eta))*(diff(f(eta), eta))) = 0;

8*(11-10*d)*(eta*(diff(diff(diff(f(eta), eta), eta), eta))+diff(diff(f(eta), eta), eta))/((1-phi)^2.5*(1+7.958981045*phi))+4*f(eta)*(diff(diff(f(eta), eta), eta)) = 0

(1)

Eq2 := 2*knf*(eta*(diff(theta(eta), `$`(eta, 2)))+diff(theta(eta), eta))/(Pr*kf*(1-phi(eta)+phi*ps*cps/(pf*cpf)))+f(eta)*(diff(theta(eta), eta))-n*(diff(f(eta), eta))*theta(eta) = 0;

186.4367280*(eta*(diff(diff(theta(eta), eta), eta))+diff(theta(eta), eta))/(1-phi(eta)+.8253667629*phi)+f(eta)*(diff(theta(eta), eta)) = 0

(2)

Va := [.1, .1, .1]:

`Vφ` := [0.5e-1, 0.5e-1, 0.5e-1]:

etainf := 8:

bcs := f(a) = 0, (D(f))(a) = 0, theta(a) = 1, (D(f))(etainf) = 1/2, theta(etainf) = 0;

f(a) = 0, (D(f))(a) = 0, theta(a) = 1, (D(f))(8) = 1/2, theta(8) = 0

(3)

dsys := {Eq1, Eq2, bcs}:

for i to 3 do for h to 3 do phi := `Vφ`[i]; a := Va[h]; dsol[h][i] := dsolve(dsys, numeric, continuation = d); print(a); print(phi); print(dsol[h][i](0)) end do end do

Error, (in fproc) unable to store 'YP[3]' when datatype=float[8]

 

``


 

Download Grosan.mw

h bcs

Hello

I wonder how I could use maple to manipulate a symbolic matrix.  For instance, I need to calculate the transpose of the following matrix:

 

Matrix(2, 2, [[Transpose(X)+X-Q, A . X], [Transpose(X) . Transpose(A), Q]])

 

where X, Q and A are matrices of unknown (but compatible) size.  Of course, the main problem is how  X, Q and A should be defined to allow maple to calculate the transpose. 

Many thanks.

 

Ed

 

 

I am new to Maple and need assistance optomizing the following function F with respect to t:

F := int(f, [yip = -infinity .. infinity, xip = -infinity .. infinity, tp = 0 .. t])

Where: f := exp(-(xip^2+yip^2)*(1/2))*exp(-((2*Pe*tp+x-xip)^2+(y-yip)^2+z^2)/(4*(t-tp)))/((4*Pi^(3/2))*(t-tp)^(3/2))

and

Pe := 10; x := 0; y := 8/10; z := 1/18

 

I have a plot of F from 0 to approximately 1/2 and I know what the shape of the function is:

 

Is is clear that there definitely is a maximum within this range of t (i.e. t=0 to 1/2). When I right click on the function F and click the "Optomization" tab, then "Maximize (local)" maple results in the following pink text "Error, (in Optimization:-NLPSolve) integration range or variable must be specified in the second argument, got HFloat(1.0) = 0 .. HFloat(1.0)"

 

Any help fixing the error and optimizing the function F will be appreciated. Thank you!

I am trying to numerically solve y'=f(x,y) with y(0)=y0, where f is a solution to a PDE. In this case, f is a numeric approximation itself. I attempted to add this equation to the system of equations when finding f, but pdsolve will not accept an equation of this form. Then, in attempting to use f in dsolve, I get an error, stating that the input system must be an ODE system, found {y(x),f(x,y(x))}. 

 

Is there any way to use dsolve or pdsolve to generate y(x)? Or will I have to stick with using more classical methods like RK4?

Hello dearz.

Hope you will be fine with everything. I am facing in plotting the set of points like seq(u[i,20] $ i=1..25) in the attached file. Please see the problem and fix it. I shall be vary thankful. Waiting quick and positive response.

Help.mw 

Dear maple users,

I am solving around 170 linear algebraic equations (symbolic) using linearalgebra " solve" command. I see the cpu usage is only 15%; as I the cpu is  i-7, octacore ,15% means around 1 core is in use. With time (12 hours)  cpu usage goes down to 0% showing free memory approx 0.

Why  is it happening? Is it due to high memory usage in storing large symobic expressions? Is there a way to engage all the cores( 100% Cpu)?

Thanks and regards.

Amor

Hi,

As a notional example those instructions generate 21 variables and around 4 Giga Bytes of data (bottom right of the Maple window ; roughly the same value read from the windows manager)

with(Statistics):
for n from 1 to 10 do
   X__||n := RandomVariable(Uniform(0,1)):
   S__||n := Sample(X__||n, 10^8)
end do:

I want to clean some part of the  memory ; for instance all the S__||n.
The following doesn't work

KeepVars := { seq(X__||n, n=1..10)}:
unassign({anames(user)} minus KeepVars ) ;
gc();


Is there a way to deallocate the memory occupied by some of my user variables ?
 

First 891 892 893 894 895 896 897 Last Page 893 of 2215