Maple 2018 Questions and Posts

These are Posts and Questions associated with the product, Maple 2018

Hello Dr/Pof/Colleague

Please help me on the ODE BVP problem

my target i want RUN double loop


 

restart

with(plots)

b := 0; c := 0; k[1] := 1; k[2] := 0; Un := 0; d := 0

Eq1 := (101-100*lambda)*(1+a*phi(eta))*(diff(f(eta), `$`(eta, 3)))+(diff(f(eta), `$`(eta, 2)))*(f(eta)+g(eta)+a*(diff(phi(eta), eta)))-(diff(f(eta), eta))^2+k[2]+Un*(k[2]-(1/2)*eta*(diff(f(eta), `$`(eta, 2)))-(diff(f(eta), eta))) = 0

(101-100*lambda)*(1+a*phi(eta))*(diff(diff(diff(f(eta), eta), eta), eta))+(diff(diff(f(eta), eta), eta))*(f(eta)+g(eta)+a*(diff(phi(eta), eta)))-(diff(f(eta), eta))^2 = 0

(1)

Eq2 := (101-100*lambda)*(1+a*phi(eta))*(diff(g(eta), `$`(eta, 3)))+(diff(g(eta), `$`(eta, 2)))*(f(eta)+g(eta)+a*(diff(phi(eta), eta)))-(diff(g(eta), eta))^2+k[2]+Un*(k[2]-(1/2)*eta*(diff(g(eta), `$`(eta, 2)))-(diff(g(eta), eta))) = 0

(101-100*lambda)*(1+a*phi(eta))*(diff(diff(diff(g(eta), eta), eta), eta))+(diff(diff(g(eta), eta), eta))*(f(eta)+g(eta)+a*(diff(phi(eta), eta)))-(diff(g(eta), eta))^2 = 0

(2)

NULL

Valpha := [0, .1, .2]; Va := [0, 0]

etainf := 100

bcs := (D(f))(0) = k[1], (D(g))(0) = alpha, f(0) = 0, g(0) = 0, (D(f))(etainf) = k[2], (D(g))(etainf) = k[2]

(D(f))(0) = 1, (D(g))(0) = alpha, f(0) = 0, g(0) = 0, (D(f))(100) = 0, (D(g))(100) = 0

(3)

dsys := {Eq1, Eq2, bcs}

for j to 2 do for i to 3 do a := Va[j]; alpha := Valpha[i]; dsol[j][i] := dsolve(dsys, numeric, continuation = lambda); print(alpha); print(a); print(dsol[j][i](0)) end do end do

Error, incorrect number of arguments to _Inert_FORFROM

"for j from 1 to 2 do   for i from 1 to 3 do a:=Va[j]; alpha:=Valpha[i];  dsol[j][i]:=dsolve(dsys,numeric, continuation=lambda);  print(alpha);    print(a);  print(dsol[j][i](0));  od  end"

 

NULL

 


 

Download 3DAKc2alpha.mw

I am developping an algorythm in which I need to obtain a 3D plot and its respective colorbars. As far as I know, Maple does not have a function with includes such a colorbar automatically (like Matlab, for example). So, I have had to get 3D plot and colorbar separatelly, as independent plots. It has worked fine, but now I need to export such graphics as EPS files, which imply merging them as a single graphic.

Here is a small example, where I try to put such graphics inside a table for then exporting it as EPS:

restart:

with(plots):
with(DocumentTools):

graph:= plot3d(x^2+y^2, x = -10..10, y = -10..10, colorscheme = ["zgradient", ["Red","Blue"]]):

grad_min, grad_max:= (min, max)(op([1,3], indets(graph, specfunc(anything, GRID)))):

colorbar:= densityplot(axis_z, axis_x = 0..0.1, axis_z = grad_max..grad_min, style = patchnogrid, size = [100,250], axes = boxed, tickmarks = [0,10], labels = ["",""], colorscheme = ["zgradient", ["Red","Blue"]]):

tab:= Tabulate([graph, colorbar], exterior = none, interior = none, weights = [4,1]):

 It has not worked, though. Can anyone suggest a solution for that? I need to export both graphics as one single file, preferably EPS, because of its high resolution.

Let us consider

plots:-inequal(max(1, min(x, 2))+max(1, min(y, 2)) <= 3, x = -4 .. 4, y = -4 .. 4);


and compare it with

plots:-implicitplot(max(1, min(x, 2))+max(1, min(y, 2)) = 3, x = -4 .. 4, y = -4 .. 4, gridrefine = 2);

The latter plot must be a subset of the former plot, but it isn't so. bug_in_inequal.mw

Hi guys! First time posting here and I'm very new to Maple too.

I'm using maple right now to calculate statics problems, and for that we've customized some units to better fit what we're working with and want to see in output. In general, it's working great, but sometimes when I try to use the solve function including these units, I get an error mesage I don't really understand..

Here's the unit customization:

restart;
with(Units); AddSystem(NewSI, GetSystem(SI), kN*m, kN/m, kN, MPa); UseSystem('NewSI');
Automatically loading the Units[Natural] subpackage 

Error, (in Units:-AddSystem) expecting a unit but got `Units:-Unit(kN*m)`
with(Units[Natural]);
 
- As said, in general I have no problems, despite the error message above, it's only when using the solve function as follows:
 
(I've defined A,B,C and G, all with results in kN)
solve(OL-A-B-C-G=0,OL)
 
Then it gives me this error:
Error, (in Units:-Standard:-+) the units `1` and `kN` have incompatible dimensions
 
What I want here is to setup an equilibrium equation, and then solve for the variable OL, which should be output in kN. 
First of all, I don't really understand what Maple is trying to tell me here?
-I figure it has something to do with the new units i'm adding, and when if I'm putting the units commands into the startupcode customizer, it tells me another error:
Error: (in Units:-AddSystem) expecting a unit but got `Units:-Unit(kN*m)
 
But I don't know how to do something about this, the new units I defne is simply something I've cpoy/pasted from another source, I don't have any knowledge about how to customize the system myself..
Googling this problem only leads me to the maple help websites, but that doesn't help me as I'm completely new to all this...

So I was hoping someone could help me fix the error(s), or at least understand what the errors mean..

 

I have the following Maple code.

 

x := [5, 10, 15, 20];

y := [4.22, 7.49, 12.24, 19.60];  

yui := [2.48, 3.76, 6.11, 14.60];

yli := [2.27, 3.34, 6.09, 10.90];

 

with(Statistics): with(plots):

p1 := ErrorPlot(y, coords = x, yerrors = yui);

this produces a plot with error bars. The problem is that I acutally have unequal errors. In the ErrorPlot helpfile it says:

"This options specifies errors along the x-axis. The array of errors must have the same number of elements. To specify right errors and left errors separately, use the list of two vectors." (this pertains to xerrors obviously but below it says the same applies to yerrors)

I have tried entering the code above with yerrors=[yli,yui] and with yerrors={yli,yui}....but neither option works and I get the error:

"Error, invalid input: Statistics:-ErrorPlot expects value for keyword parameter yerrors to be of type {identical(default), [{array, list, rtable, DataFrame, DataSeries}, {array, list, rtable, DataFrame, DataSeries}], {array, list, rtable, DataFrame, DataSeries}}, but received {[2.27, 3.34, 6.09, 10.90], [2.48, 3.76, 6.11, 14.60]}"

Can anyone advise me on what I'm doing wrong - I am very new to Maple.

Jo

 

I have been trying to solve this equation by obtaining solutions for x and I actually handed in for an assignment what Maple gave me as an output. Then it turns out that Maple was wrong. This is in fact not a solution for the equation. What am I doing wrong here?
Solve_error.mw

This is my first problem with Maple but i am pretty confused as to why it would struggle with these steps.

Just using a standard worksheet, here is what i have:

> f:=(4^x)+1

>g:=x^4

> solve(g=f,x)

now, i would just expect this to come back with 3 answers, but instead i get 

Warning, solutions may have been lost
                     RootOf(-4^_Z - 1 + _Z^4)

if I do:

>fsolve(g=f,x)

It comes back with only one of the answers(2.094012853), instead of all three.

What am I doing wrong?

I mean, for example,

solve({4*x1+7*x2+6*x3 = 186, floor((1/2)*x1)+floor((1/5)*x2)+floor((1/3)*x3) = 18, 
floor((1/5)*x1)+floor((1/2)*x2)+floor((1/4)*x3) = 21});
Warning, solutions may have been lost

A finite number of the solutions can be found by DirectSearch

DirectSearch:-SolveEquations([floor((1/2)*x1)+floor((1/5)*x2)+floor((1/3)*x3) = 18, 
floor((1/5)*x1)+floor((1/2)*x2)+floor((1/4)*x3) = 21, 4*x1+7*x2+6*x3 = 186], 
{x1 >= -100, x2 >= -100, x3 >= -100, x1 <= 100, x2 <= 100, x3 <= 100}, 
AllSolutions, solutions = 3, number = 1000);

Matrix(3, 4, [[0., Vector[column](3, [0., 0., 0.]),
 [x1 = 74.18778903830886, x2 = 58.93905207777524, x3 = -87.22075344961036], 185], 
[0., Vector[column](3, [0., 0., 0.]),
 [x1 = 71.22714241634635, x2 = 56.43467122661542, x3 = -82.32521137528222], 164],
 [0., Vector[column](3, [0., 0., 0.]), 
[x1 = 73.6407870507502, x2 = 58.33738250527096, x3 = -86.15413762331626], 165]])

I don't see a way to obtain the MMA answer (in Maple notation)

(155/2 < x1 and x1 < 78 and 744/7-4*x1*(1/7) < x2 and x2 < 62 or 72 <= x1 and x1 <= 73 and
 102-4*x1*(1/7) < x2 and x2 < 62 or 73 < x1 and x1 <= 147/2 and 102-4*x1*(1/7) < x2 and
 x2 <= 726/7-4*x1*(1/7) or 147/2 < x1 and x1 < 74 and 60 <= x2 and x2 <= 726/7-4*x1*(1/7) or
 74 <= x1 and x1 < 75 and 726/7-4*x1*(1/7) < x2 and x2 < 62 or 153/2 < x1 and x1 < 78 and
 726/7-4*x1*(1/7) < x2 and x2 < 60 or x1 = 72 and 58 <= x2 and x2 < 60 or 72 < x1 and x1 < 74 and
 58 <= x2 and x2 <= 708/7-4*x1*(1/7) or 75 <= x1 and x1 < 76 and 102-4*x1*(1/7) < x2 and x2 < 60 or
 x1 = 74 and 442/7 < x2 and x2 < 64 or 74 < x1 and x1 < 75 and 738/7-4*x1*(1/7) < x2 and 
x2 <= 744/7-4*x1*(1/7) or 74 <= x1 and x1 < 75 and 708/7-4*x1*(1/7) < x2 and x2 <= 102-4*x1*(1/7) or 
151/2 < x1 and x1 < 76 and 708/7-4*x1*(1/7) < x2 and x2 < 58 or 157/2 < x1 and x1 < 80 and
 762/7-4*x1*(1/7) < x2 and x2 < 64 or 68 <= x1 and x1 < 137/2 and 56 <= x2 and x2 <= 666/7-4*x1*(1/7) or
 x1 = 137/2 and x2 = 56 or x1 = 70 and 56 < x2 and x2 < 58 or 70 < x1 and x1 <= 71 and 56 <= x2 and
 x2 < 58 or 71 < x1 and x1 < 72 and 56 <= x2 and x2 <= 690/7-4*x1*(1/7) or 70 <= x1 and x1 <= 281/4 and
 54 <= x2 and x2 < 55 or 281/4 < x1 and x1 < 72 and 54 <= x2 and x2 <= 666/7-4*x1*(1/7)) and
 x3 = 31-2*x1*(1/3)-7*x2*(1/6)

PS. MMA_solution.pdf MMA_solution.mw

I get this message everytime I am trying to open my worksheet: "Recover Corrupt File and Save As"

2.G_anden_aflevering.mw

I've tried alot, but nothing seems to work. The problem occurres whenever im trying to use multiple SI Units in caculations that require division. Example:

"`E__n`:=n->-6.63*10^(-34)&lobrk;J&robrk;*&lobrk;s&robrk;*3*10^(8)*&lobrk;m&robrk;/(&lobrk;s&robrk;)*1.097*10^(7)&lobrk;m&robrk;^(-1)*1/(n^(2)):"

Error, null

Parse:-ConvertTo1D, "invalid input %1", 3

 

""

"eV:=x->x/(1.602*10^(-19)&lobrk;J&robrk;/(&lobrk;eV&robrk;))"

Error, null

Parse:-ConvertTo1D, "invalid input %1", 6

 

``


 

Download Maple_prob1.mw

 

 

Here I put two functions defined by piece-wise command and then using int(...,numeric) to take their integration but Maple computes only one while for the other one just gives the expression back. The integration domain is bounded, the function is bounded too so I don't think the reason is being divergent in the one that Maple is not computing it.

Is there any prepared command or package for Maple which computes the integrals like this or is better than just int(...,numeric)? Or I have to write an algorithm an force Maple to compute my integral using an algorithm given by myself?
--
The codes in plain text:
 

int(piecewise(0 < -k5*x1*x2+k1*x1 < 1, 1, -k5*x1*x2+k1*x1 <= 0 and 1 <= -k5*x1*x2+k1*x1, 0)*piecewise(0 < -k5*x1*x2+k2*x2 < 1, 1, -k5*x1*x2+k2*x2 <= 0 and 1 <= -k5*x1*x2+k2*x2, 0), k1 = 0 .. 1, k2 = 0 .. 1, k5 = 0 .. 1, x1 = 0 .. 1, x2 = 0 .. 1, numeric);
int(piecewise(0 < x+y < 1, 1, x+y <= 0 and 1 <= x+y, 0)*piecewise(0 < y*x^2 < 1, 1, y*x^2 <= 0 and 1 <= y*x^2, 0), x = 0 .. 1, y = 0 .. 1, numeric);

 

I want to solve system of nonlinear ordinary differential equations numerically using the variational finite
element method (FEM). is it possible to solve on Maple? If anybody have a idea please share with me. I attach the image of my problem which I am tryimng to solve.

Hi,

Let a in ] 0, 1[  and  x real

Let  f := sin(x) / ( ( sin(a*x) )^a * ( sin((1-a)*x) )^(1-a) );

How can I find the limit of f as x goes to 0 ?
(limit, series, taylor don't work, wether I set or not assumptions on "a" [assume/assuming])

PS 1:  the limit is found once a numeric value is given to alpha

PS 2:  By simple calculations:
           sin(x) ~x  ;  sin(a*x) ~ ax  ; sin((1-a)*x) ~(1-a)x and thus
          ==>  f(x->0) ~ x / ( -a*x)^a * ((1-a)*x)^(1-a) )
                              = x / ( -a^a * (1-a)^(1-a) * x^(a+1-a)
                              = 1 /  ( -a^a * (1-a)^(1-a)  )

Hi,

Is it possible to write the title of a plot on two different lines with different fonts for each line?
For instance:

MyTitle := typeset("Identity function", "\n(illustration));
plot(x, x=0..1, title=MyTitle);

with the upper line  [times, bold, 14]
and the lower one   [times, roman, 12]

 

Hi,

I use the first example in the HeatMap help page.

restart:
with(Statistics):
RM := LinearAlgebra:-RandomMatrix(10):
HeatMap(RM);

I want to replace each tickmarks k (k=1..10) by cat(`A`, k).
So I do

NewTickMarks := [seq(k+1/2=cat(`A`, k), k=1..10)]:
HeatMap( RM, tickmarks=[NewTickMarks , NewTickMarks ] );

The horizontal tickmarks are displayed as expected: why the vertical tickmarks do not appear?

PS : HeatMap( RM, tickmarks=[NewTickMarks , default] ) changes the horizontal tickmarks without removing the vertical ones.

Thnks for the help
 

First 43 44 45 46 47 48 49 Last Page 45 of 61