MaplePrimes Questions

Suppose we have a parametric function g(x)=max{h(x,p),f(x,p)}. How can I find the exact form of g(x) by conditioning on x and also how I can find the integration of g(x) over an interval [a,b]?

For example, g(x)= max{ x-p, x^2+px} and [a,b]=[0,10].

I want to solve the following system of differential equations to find xphi, but I seem to be doing something wrong because I get an error message.

 

xodephi := {diff(x(t), t) = 16250.25391*(1 - (487*x(t))/168 + 4*Pi*x(t)^(3/2) + (274229*x(t)^2)/72576 - (254*Pi*x(t)^(5/2))/21 + (119.6109573 - (856*ln(16*x(t)))/105)*x(t)^3 + (30295*Pi*x(t)^(7/2))/1728 + (7.617741607 - 23.53000000*ln(x(t)))*x(t)^4 + (535.2001594 - 102.446*ln(x(t)))*x(t)^(9/2) + (413.8828821 + 323.5521650*ln(x(t)))*x(t)^5 + (1533.899179 - 390.2690000*ln(x(t)))*x(t)^(11/2) + (2082.250556 + 423.6762500*ln(x(t)) + 33.2307*ln(x(t)^2))*x(t)^6)*x(t)^5, diff(xphi(t), t) = 5078.204347*x(t)^(3/2), x(0) = 0.03369973351, xphi(10.92469316) = 0}

xsolphi := dsolve(xodephi, numeric)

Error, (in dsolve/numeric/bvp) precision is insufficient for required absolute error, suggest increasing Digits to approximately 25 for this problem

 

Later, I am interested in plotting xphi for t ranging from (11.92469316 - 1) to 11.92469316, but first I need to obtain a numerical solution for xphi in this region. Any advice?

Hey

Can anyone help me with this file?

I don't know how it happend, but the file somehow got corrupted. Is there anything i can do?

Thanks 

Videregående_beton_Gang_9.mw

 

 

A := Matrix(2, 2):
CodeGeneration:-Matlab(unapply(A), optimize, resultname = "A");

Warning, unable to optimize
Warning, procedure/module options ignored
function Areturn = A()
  Areturn = [0 0; 0 0;];
 

What is this behaviour. I can't find any explanation online.

Suppose you do this
 

restart:
with(plots):
with(Statistics):
A := Sample(RandomVariable(Normal(0, 1)), 10^4):
B := Sample(RandomVariable(Normal(0, 1)), 10^4):
ScatterPlot(A, B, symbol=point);

The plot shows a greater density of dots around (0, 0) and they become increasingly sparse as one moves away from (0, 0).
A pretty way to represent such clouds is to do "2D density plots".
You will find some example from R here  2d-density-plot-with-ggplot2.html

For the moment I do something like this (which is to be adpated for almost any particular case).
My main question is: do recent versions of MAPLE possess something similar to R's features?
 

restart:

interface(version);

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

with(Statistics):

UseHardwareFloats := false:

N := 10^5:
A := Sample(RandomVariable(BetaDistribution(2, 6)), N):
B := Sample(RandomVariable(BetaDistribution(6, 2)), N):

nb := 50:

mA := min(A):
hA := Range(A)/(nb-1):
mB := min(B):
hB := Range(B)/(nb-1):

cA := floor~((A-~mA)/~hA)+~1:
cB := floor~((B-~mB)/~hB)+~1:

NP := Matrix(nb$2, 0):
for n from 1 to N do
  NP[cA[n], cB[n]] := NP[cA[n], cB[n]]+1
end do:

NP:
 

plots:-matrixplot(
  NP,
  heights=histogram,
  colorscheme=["Blue", "White", "Red"],
  orientation=[270, 0, 0],
  style=patchnogrid,
  lightmodel=none,
  labels=["A", "B", ""],
  axis[1]=[tickmarks=[nb+1=max(B), 1=mB]],
  axis[2]=[tickmarks=[nb+1=max(A), 1=mA]]
)

 

 


 

Download 2D_density_plot.mw

 1. Consider this code line: > a := b; b := c; c := matrix([[1, 2, 3], [3, 4, 5]]);
    • if you ask Maple to return the values assigned to a, b and c, which values will be printed?
    • Are these values the ones you would expect? Why? Which kind of evaluation rule is utilized by Maple to return these values?
   • Show the single steps of the evaluation process and briefly explain the outcome of each evaluation step (hint: use eval (a, 1/2/3), to return each evaluation step).
   • How can you “force” Maple to return the “expected” values for a, b and c? • Extract the first row of the matrix in such a way to have [1, 2, 3] as output. Hint: use the command row/Row and its right syntax (it needs two arguments: the name of the matrix and the number of the row to extract). Be careful to load the linalg/LinearAlgebra package before using the command. Instruction: apply the row/Row command to a, b and c.
  • Can you explain what Maple does in the previous step? Can you explain, in other words, why you get the expected outcome? Hint: remember which are the “drivers” of the evaluation process in Maple (position of the assignment/level of evaluation; type of object / data-structure / datacontainer / procedures / local versus global variables / use of built-in commands, etc.).

      how to write a procedure that shuffle a matrix  (c:=matrix([[1,2,3],[3,4,5]] ) by using command randperm in maple?

What is the logic behind this. 

restart;
expr:=int(f(x),x);
lprint(algsubs(int=Int,expr));
lprint(subs(int=Int,expr));

gives


   int(f(x),x)

   Int(f(x),x)

So algsubs failed to replace int by Int

Looked at help. and see nothing. But I might have overlooked something. It says

It is a generalization of the subs command, which only handles syntactic substitution.

Generalization? If so, I expected it to work here. But may be there is a subtle reason why it did not? May be with algsubs, the replacement has to be algebraic expression and "int" is not, it is just a name.

Maple 2020.2
 

Hello Maple experts.

According to our teacher class notes, the ODE   y'=2*sqrt(y) with IC  y(0)=0 has 2 solutions. y(0)=0 and sqrt(y)=x

I am not able to get Maple to give the second solution,. It only gives y(0)=0.

Is there an option I am overlooking to make it give the other solution sqrt(y)=x ?

ode := diff(y(x),x) = 2*sqrt(y(x));
ic:=y(0)=0;
sol:=dsolve([ode,ic],y(x));

One can see the other solution by doing this

ode := diff(y(x),x) = 2*sqrt(y(x));
ic:=y(0)=A;
sol:=dsolve([ode,ic],y(x));
subs(A=0,sol)

I tried this in Mathematica. Mathematica does not give y=0 but it gives the second solution

I tried the singsol=all also, but it had no effect. Maple only shows the y(0)=0 solution.

Any suggestions?

Maple 2020.2

 

Hello everyone,

I have a question about adding references to a non executable math in a document. Namely, If we use an executable math there is a label that appears on the right of a formula. We can use it as a reference. However, there is no label when we use non-executable math. I wonder how can I refer to that, the point is to create a document with a references to formulas.

To illustrate the point I would like to create a text like the following :

...

X=2 (equation 1)

X=3 (equation 2)

.....Some text here......

From the (equation 2) we can achieve that ....

Regards

Hi

cant get the answer, any comments plz

f := (x, y) ->(1/2)*a*(sinh(y-x^2)+tanh(x-y^3));

evalf(int(int(f(x, y), x = -6 .. 5), y = -5 .. 5)):

Is there any simple way to combine the commands ChromaticNumber(G) and DrawGraph(G), in order to get a vertex coloring of a graph G? Thanks

Hi everybody,

This is my code:

assume(0 < a, 0 < L, a < L);

M := piecewise(0 <= x and x < a, P*x*(L-a)/L, a <= x and x < L, P*a*(L-x)/L);
ode := diff(y(x), `$`(x, 2)) = M/(E*I__0);
ic := y(0) = 0, y(L) = 0;
sol := factor(dsolve([ode, ic], y(x))); assign(sol); y1 := y(x);

I have two questions:

1) How to plot y1?

I would like to plot y1, but in the plot can to specify a values of a, L, P, E and I.

2) How can I find a maximun and minimun value of y1?

I tried to use maximize and minimize commands but really I don't know if I used them correctly.

Thank you.

 

 

Hello everybody,

 

Being a beginner in maple, I tried to make some animations involving geometrical objects.

I haven't been through any problems for typical 2-variables or 3-variables functions.

However, I couldn't get to making 3d-objects like spheres/cylinders.... to grow in link with a parameter (radius, axes...)

I've found lots of procedures to get sphere to rotate but I didn't succeed in adapting them to, for example, an animation showing a growing zero-centered sphere from radius zero to a radius n (variable entered by the user).

Thank you for your reading, your patience and your kindness.

 

This is a piece of code from my file.

 g(1,a) should be 0, but not. I find some other questions  mentioned  assuming n::posint, but it does not take effect, so how could I avoid this? Thanks.

a := 0.12;
kn := n -> (n + 0.5)*Pi/a;
g := (n, x) -> cos(kn(n)*x);
g(1, a);
 

First 473 474 475 476 477 478 479 Last Page 475 of 2427