MaplePrimes Questions

I am starting a course on differential forms. They have introduced the wedge product by comparing it to the curl product. I can do it by hand. But I would like to do it in Maple. I tried to read the help page of with(difforms) but I cannot see how to do it. And to add to the complication, since my keyboard is in French, I don't know how to insert the circumflex accent right after &. Maybe I should just wait that more theory is done, but just for the principle, I would like to be able to do it. For example, the vectors are:

a=(1, 3,-2)

b=(5, 2, 8)

Thank you in advance for your help.

Mario

Hi Dear

Is it possible to know the algorithm and method behind a specific Maple command? 

Thank you in advance.

The attached integral is plotted quite quickly, but the search for the maximum and for the inverses of function values takes time. Can the search be accelerated or is the integrand simply too complicated?

Int(22.89730452*exp(-3.373250126*10^6*x^2)*sqrt(2)*(erf(1298.701299*sqrt(2)*(sqrt(2.500000000*10^(-7)-x^2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*sqrt(2)*(sqrt(2.500000000*10^(-7)-x^2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3, method = _d01ajc)

Int(22.89730452*exp(-3373250.126*x^2)*2^(1/2)*(erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3, method = _d01ajc)

(1)

plot(Int(22.89730452*exp(-3373250.126*x^2)*2^(1/2)*(erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3, method = _d01ajc), y = 0 .. .25)

 

unapply(int(op(1 .. 2, Int(22.89730452*exp(-3373250.126*x^2)*2^(1/2)*(erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3, method = _d01ajc))), y)

proc (y) options operator, arrow; int(22.89730452*exp(-3373250.126*x^2)*2^(1/2)*(erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3) end proc

(2)

CodeTools:-Usage(Optimization:-Maximize(proc (y) options operator, arrow; int(22.89730452*exp(-3373250.126*(x^2))*(2^(1/2))*(erf(1298.701299*(2^(1/2))*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*(2^(1/2))*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3) end proc, 0 .. .15))

[HFloat(0.0356073228322897), Vector[column](%id = 36893490875463313756)]

(3)

CodeTools:-Usage(fsolve((proc (y) options operator, arrow; int(22.89730452*exp(-3373250.126*(x^2))*(2^(1/2))*(erf(1298.701299*(2^(1/2))*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*(2^(1/2))*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3) end proc)-0.5e-2, 0 .. .15, maxsols = 2, method = subdivide))

0.2456248637e-1, 0.9863751363e-1

(4)

Download slow_maximize_and_fsolve.mw

I am trying to solve three nonlinear equation for A, B and P. f solve is not working for them.

File ling: SOlve.mw

Dear all

I would like to plot a rectangular cylinder,, but the code does not generates a cylinder 

rectangular_cylinder.mw

Thank you in advance for your help 

Consider the following simple procedure:
 

restart;
p:=proc(x::{realcons,{set,list}(realcons)} ) x end proc;
p(8);
p({8,9});
p([7,8]);

I would like to be able to do something like this instead:

q:=proc(x::{ID,set,list}(realcons) ) x end proc;
## ID(realcons) should just be realcons.
q(8); ## Obviously we get an error.
q({8,9}); #OK
q([7,8]); #OK

In Q below ID is simply s->s, but that won't work in q.
Q works because the type check evaluates its arguments first.
 

Q:=proc(x) 
    if type(x,{s->s,list,set}(realcons)) then 
      x 
    else 
      error "%1 expects its first argument to be of type %2", procname,{s->s,list,set}(realcons)
    end if
end proc;
Q(8);
Q({8,9});
Q([7,8]);

I believe that Carl Love had a solution on MaplePrimes some years ago, but I can't find it.

Hi,

I am looking to integrate this LaTeX code into Maple...Any ideas? Thanks

\begin{tikzpicture} \tkzTabInit{$x$ / 1 , $f(x)$ / 2}{$-\infty$, $-5$, $-3$, 0, $+\infty$} \tkzTabVar{-/ $-\infty$, +CD-/ $0$/ $2$, +D+/ $0$ /$0$, -V-/ $-2$ / $3$, +/ $+\infty$} \end{tikzpicture}

The Maple 2023 System Requirements    shows the fact , that only older MATLAB versions (2021b, 2021a, 2020b) are supported. Does it mean that the latest versions of MATLAB (2022ab, 2023ab) are not supported anymore? 

Good day everyone,

I am writing a numerical code using dsolve which works fine but I have a challenge in inputting the previous answers in the subsequent ones. For example, how can I substitute the solutions in S1 into equ11, equ22, equ33, and equ44 in the link below? 

Thank you very much as I will be expecting responses from you soon.

New.mw


Code:

Graph := NULL; for i from 0 to N-1 do for j from 0 to 10 do if j <= finite_element_xi[i] and finite_element_xi[i] <= j+1 then finite_element_sigma[i] := evalf(finite_element_epsilon[i]*R(j)); p := plot(finite_element_sigma[i](x), x = finite_element_xi[i] .. finite_element_xi[i+1]); Graph := display(Graph, p) end if end do end do;
Error, (in plot) illegal use of an object as a name

I don't understand how to draw a graph for sigma

I wanted to debug some code from worksheet A.  So added DEBUG(); command in the code where I want to start the GUI debugger from, and then run the command from the worksheet. All is working OK. the debugger GUI comes up and I can step in. 

Now I wanted to debug some other code from worksheet B. But without closing the currect debugger which is open and running.

It turned out this is not possible.  When running debugger from worksheet B, it uses the same debugger GUI that was up and running. I think it closed that session automtically also.

So basically using same Maple process, one can't open two debgging sessions at same time? Is there a way around this.

I run each worksheet using its own math engine. So each is separated from each other.

But this is first time I wanted to debug two things at same time, i.e. side by side, thinking I will be able to open two GUI debuggers at same time.

I know ofcourse I can open two separate Maple processes and then I will be able to do this. I think I am allowed to have two Maple's open at same time. Will try that next.

But it will be better if one is able to open two debuggers from same Maple at same time. I do not see why this should not be possible.

Any suggestions if there is a workaround? May be some hidden setting that allows this?

Maple 2023.2.1 on windows 10

Good day.

I am working on a time series problem that uses 107 data sets (historic) and I wish to obtain a forecast for the next successive 12 events. I have obtained the time series plot for the predicted values and the associated dates separately (see attached), however - I am looking to get the solution in a more user-friendly format and was hoping someone could help me out.

Can someone tell me how to 

1. Express the data values only as whole number values (decimal-free)

2. Construct a table of data values and dates for the average forecast as well as the 2nd and 98th percentile forecasts?

Thanks for reading!

MaplePrimes_TS_Example.mw

Here is the layout challenge: Whenever the value of a physical quantity is one as in

mass = 1* Unit('kg')

automatic simplification removes the one and the output displays

Desired would be which reads better (in particular when used inline in text passages).

Using the Empty Symbol

mass = ``(1)*Unit('kg')

an expression with parenthesis is obtained (that can be removed in subsequent calculations with the expand command) which looks worse than my current workaround of using floats

(Introducing floats in expressions is not always acceptable)
So the idea would be to use the empty symbol for initial parameter definition in textbook style layout and remove it with expand in subsequent calculations.

Any other symbol that prints as "1" that can be removed in later calculations by Maple commands is welcome as well. It should be better than

mass=`#mrow(mo("1"));`*Unit('kg');
subs(`#mrow(mo("1"));` = 1, %);

 

Hi all,

I wrote a little simple minded procedure for finding the sum of divisors for a positive integer.  I thought I would share.

sum_of_proper_divisors.mw

sum_of_proper_divisors.pdf

Has someone written better code for this task?

Regards,
Matt

When there are print commands in a loop their content is printed as soon as this command is executed.
This is not the case with printf whose displays are delayed (buffered?).
Is there a way to force the display of printf when the command is executed?

TIA

Motivation: I want to display intermediate execution times in a prettier way than print offers.

First 144 145 146 147 148 149 150 Last Page 146 of 2426