## solve an equation by maple...

Asked by:

Hi

how can I find e^(-x) with respect to x in this relation

e^x (1 + sqrt(1 + e^(-2 x))) - sinh^(-1)(e^(-x))=x

## How can I display the required double spiral using...

Asked by:

This worksheet attempts to implement figures in Section 3 of the book "Indra's pearls" by Mumford, Series and Wright using the  command complexplot.

The worksheet seems to display Figure 3.1 on page 63 accurately but fails to correctly display Figure 3.4 on page 67.

Can complexplot be coded to accurately display this figure?

Indras_pearls_spirals.mw

## Most efficient way to compute roots of a polynomi...

Asked by:

Hi all,

I need to compute all roots of a polynomial equation for geometric reasons. I do want accuracy but more important is speedy calculations. I know fsolve works pretty well, but I process the polynomials on my own first. Does the roots command work better? What about solvetools. Any and all thoughts welcome.

Note I need to compute all roots.

## Almost a rational solution to a transcendental equ...

Asked by:

While solving an exercise in class, I ran into the following interesting solution of a transcendental equation.  It was not intentionally designed to be like this.

restart;
eq := 2*exp(-2*t) + 4*t = 127:
fsolve(eq, t=0..infinity);
31.75000000

The solution looks like a rational number while it was expected to be transcendental.  Let's increase the number of digits:

Digits := 20:
fsolve(eq, t=0..infinity);
Digits := 10:
31.750000000000000000

Let's make it even more accurate:

Digits := 29:
fsolve(eq, t=0..infinity);
Digits := 10:
31.750000000000000000000000000

And even more:

Digits := 40:
fsolve(eq, t=0..infinity);
Digits := 10:
31.74999999999999999999999999986778814353

Is there a deep reason why the solution is so close to being a rational or is it just a coincidence?

## Could you help me find the value of P?...

Asked by:

I want to estimate numerically the value of P (that is the probability that f exceeds the value 12 when x, y and z are uniformly distributed within the box [-Pi, Pi]3).

restart
f := sin(x)+7*sin(y)^2+0.1*z^4*sin(x);
Omega := [x, y, z] =~ [(-Pi..Pi)\$3]:
2        4
sin(x) + 7 sin(y)  + 0.1 z  sin(x)

h := Heaviside(f-12):
P := Int(h, Omega);

Here is a simple Monte Carlo estimation of P.

f_MC  := x -> sin(x[1])+7*sin(x[2])^2+0.1*x[3]^4*sin(x[1]);
h_MC  := x -> Heaviside(f_MC(x) - 12);
omega := -Pi, Pi;

P_MC := proc(N)
local Z := Statistics:-Sample(Uniform(omega), [N, 3]):
local F := Vector(N, n -> h_MC(Z[n])):
local K := add(F):
local P := evalf(add(F)/N):
local q := Statistics:-Quantile(Normal(0, 1), 0.005, numeric):
local e := -q*sqrt(P*(1-P)/N):
printf("A bilateral 99%% confidence interval that Prob(f > 12) is %1.3e +/- %1.2e\n", P, e);
end proc:

P_MC(10^6)
A bilateral 99% confidence interval that Prob(f > 12) is 1.643e-02 +/- 3.27e-04

I was hoping to get a value for P using  evalf/Int with some method.
But I didn't succeed with any of the methods for multiple integration:

• The following command returns 0 for n=1 and 2 and Int(h, Omega) if n >=3
evalf( Int(h, Omega, 'epsilon=1e-n', 'method=_MonteCarlo') );

• And all my attempts with methods from the Cuba library have resulted in an unevaluated Int(h, Omega) integral.

Could you help me to estimate P using  evalf/Int ?
TIA

## Wrong result in integrating a Heaviside function...

Asked by:

Hi,
Can anyone tell me what's going wrong with int(Heaviside(f-1/2), x=0..1, y=0..1); ?

restart:

f := x*y:

JH := int(Heaviside(f-1/2), x=0..1, y=0..1);  #???
1
-
4

JP := int(piecewise(x*y>1/2, 1, 0), x=0..1, y=0..1);
1   1
- - - ln(2)
2   2

# integrate "1" over the domain where f > 1/2

S := solve(f=1/2, x):
JS := int(1, x=S..1, y=1/2..1);
1   1
- - - ln(2)
2   2

Thanks in advance

## Numbering in set...

Asked by:

При использовании «объединения» нумерация не сохраняется. Непонятно, по каким алгоритмам «объединение» применяется к тому или иному месту. Почему sistema [1] не равно GRAN [1]? Как я могу это исправить?

PS Прошу прощения за грамматические ошибки, английский плохо знаю

 > рестарт;
 >
 >
 > B:=matrix([[1,        0,        1,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0], [-1,        -1,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0], [0,        0,        -1,        0,        -1,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0], [0,        1,        0,        1,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0], [0,        0,        0,        0,        1,        1,        0,        1,        0,        0,        0,        0,        0,        0,        0,        0], [0,        0,        0,        -1,        0,        -1,        -1,        0,        0,        0,        0,        0,        0,        0,        0,        0], [0,        0,        0,        0,        0,        0,        1,        0,        1,        0,        0,        0,        0,        0,        0,        0], [0,        0,        0,        0,        0,        0,        0,        -1,        0,        -1,        0,        0,        0,        0,        0,        0], [0,        0,        0,        0,        0,        0,        0,        0,        -1,        0,        -1,        -1,        0,        0,        0,        0], [0,        0,        0,        0,        0,        0,        0,        0,        0,        1,        1,        0,        1,        0,        0,        0], [0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        1,        0,        1,        0,        0], [0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        -1,        0,        -1,        0], [0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        -1,        0,        -1], [0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        0,        1,        1] ]):
 > E:=16:V:=14;
 (1)
 > G:=2*E; êîëè÷åñòâî ãðàíè÷íûõ óñëîâèé
 (2)
 > l:=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]:
 >
 > for i to E do De[i]:=-diff(phi[i](s[i]),s[i]\$2)=He*phi[i](s[i]):  Äó âèäà od:
 > for i to E do FSR[i]:=subs(s[i]=x,dsolve(De[i],phi[i](s[i]),output=basis)):  Îáùèå ðåøåíèÿ od:
 > for i to E do OBCHEE_RECHIE[i]:=unapply(C[i+i-1]*FSR[i][2]+C[i+i]*FSR[i][1],x): od:
 >
 > for i to E do PROIZ:=diff(OBCHEE_RECHIE[i](x),x): PROIZ_OB_RECH[i]:=unapply(PROIZ,x):od:
 >

×òåíèå ìàòðèöû èíöèäåíòíîñòè

 > i0:=1:i1:=1:z:=1:y:=1:
 > for i from 1 to V do  y:=1: z:=1:   for j from 1 to E do    if B[i,j]=1 then     x[z]:=j: z:=z+1:    fi:    if B[i,j]=-1 then     x[y]:=j:     y:=y+1:    fi:   od;   if z>=2 then    v0[i0]:=[seq(x[s],s=1..z-1)]:    i0:=i0+1:   fi:   if y>=2 then    v1[i1]:=[seq(x[s],s=1..y-1)]:    i1:=i1+1:   fi: od:
 > v0:=convert(v0,list):
 > v1:=convert(v1,list):
 >

Ïîäñ÷åò êîëè÷åñòâà ãðàíè÷íûõ óñëîâèé òèïà f(0)

 > number0:=0:
 > for i to i0-1 do if nops(v0[i])=2 then number0:=number0+2; fi: if nops(v0[i])=3 then number0:=number0+4; fi: od:
 > number0:=number0/2; #êîëè÷åñòâî ãðàíè÷íûõ óñëîâèé òèïà f(0)
 (3)
 >

Ïîäñ÷åò êîëè÷åñòâà ãðàíè÷íûõ óñëîâèé òèïà f(1)

 > number1:=0:
 > for i to i1-1 do if nops(v1[i])=2 then number1:=number1+2; fi: if nops(v1[i])=3 then number1:=number1+4; fi: od:
 > number1:=number1/2; #êîëè÷åñòâî ãðàíè÷íûõ óñëîâèé òèïà f(1)
 (4)
 >

Êîëè÷åñòâî ãðàíè÷íûõ óñëîâèé ñ ïðîèçâîäíûìè

 > GP:=i0-1+i1-1;
 (5)
 >

ÍÓËÅÂÛÅ ÓÑËÎÂÈß

 > i:=1:
 > while i
 >

ÅÄÈÍÈ×ÍÛÅ ÓÑËÎÂÈß (ÈËÈ îò l)

 > i:=number0+1:
 > while i
 >

ÍÓËÅÂÛÅ ÏÐÎÈÇÂÎÄÍÛÅ

 > i:=number0+number1+1:
 > while i
 >

ÍÅÍÓËÅÂÛÅ ÏÐÎÈÇÂÎÄÍÛÅ

 > i: = число0 + число1 + nops (v0) +1:
 > в то время как i
 >
 >
 >

новогодний

 > sistema: = {}:

новенькие

 > время: = {}:
 >
 > для я от 2 до G делаю
 > sistema: = sistema union {GRAN [i]}:
 > od:
 > для я от 2 до G делаю
 > peremenie: = peremenie union {C [i]}:
 > od:
 >
 > коэфф: = решить (система, изменение):
 > коэфф:
 >
 > система [1];
 (6)
 > ГРАН [1];
 (7)
 >
 > urav: = subs (koeff, GRAN [1]):
 > uravnenie: = collect (numer (lhs (normal (urav))), {He, C [1]}):
 > uravn: = remove (has,%, C [1]):
 > uravnenie_sobs_chisla: = evalf (algsubs (He = x, uravn)):
 > ВЕСЕЛЫЕ: = неприменить (uravnenie_sobs_chisla, x):
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >

Скачать 1.mws

## Problem in implementing chain rule of partial diff...

Asked by:

Initially I have a system of w(x,y,t) and f(x,y,t). I have a set of two partial differential equations with this system. Later on, the system is modified into w(x,y,t,z) andf(x,y,t,z) where x and z are related due to the presence of boundary layers. Because of this, the partial differential expressions with respect to x has to change.

For example, initially: diff(w(x,y,t),x)=diff(w(x,y,t),x)
Later on, when the system gets modified in the presence of boundary layers on application of chain rule: diff(w(x,y,t,z),x)=diff(w(x,y,t,z),x)+diff(w(x,y,t,z),z)*diff(z,x)

This change has to happen for all higher order derivatives of x. In my case, I have upto 4th order derivative in x. How do I achieve these changes in the expressions in Maple in an elegant manner?

## I cannot use series function. How can I solve this...

Asked by:

Good day everyone. I need to calculate series of the function given above. But I can not find result. It writes "Error, (in series/function) improper op or subscript selector". How can I fix this error? Please help me.

The detailed file has been attached above.

 > Ek4:=sqrt((Ea^2*Eb^2-Eab^2*X5^2)*Ds);
 (5)
 > series(Ek4,k=0,4);
 > series(sqrt(Ek4),k=0,4);

Download function.mwfunction.mw

## Same problem as last year for upgrading thr Physic...

Asked by:

Hello,

I encounter the same error for upgrading the physics package

which was never solved for Maple 2020 !

See the screenshot.

This is again a problem of permission.

Best

## How do I create a function that returns a random e...

Asked by:

I want to create a random polynomial using randpoly() with coefficients in a given list A := [1,1,2,5,6].

For that, I need to create a function that works as rand(1..9) but that when called returns a random element of A instead of a random number between 1 and 9.

What I have tried so far is

r := rand(1..numelems(A))
A[r()]

However, that returns a random element of A, not a function that returns a random element of A.

I've also tried

rand(A(1..numelems(A)))

But that gives an error.

One way of solving this problem would be to find out how to create a `..` type with the desired elements, something that works as 1..9 but with the elements of A. But convert(A,`..`) doesn't work and the rest of the things I tried don't work either.

## Filled command for multiple graphics ...

Asked by:

Hi,

I can’t use my "Filled" command to simultaneously explore my 3 graphs

Thanks for ideas

PétalesGraphes.mw

## Error in computing the results of BVP using Shooti...

Asked by:
Hi, I am new to MAPLE and trying to solve the given BVP using shooting method but after defining the expression in u0 and u1, the code didn't compute the numerical value, and so that the whole code won't run exactly.
Please help me out to figure out the problem. I am looking for the answer. (NOTE: I copied this code from the web and it run so fine with the example but when I changed it according to me, it give me errors.)
The code is given below:
Thanks

restart;
with(DEtools);
with(plots);
dpdexi := 2;
K := 0.2;
epsilon := 0.0001;
epsilon := 0.0001
ode1 := (diff(phi(eta), eta) + epsilon*K*diff(phi(eta), eta)^3)/(1 + epsilon*diff(phi(eta), eta)^2) = dpdexi*eta;
bc1 := phi(0) = 0, phi(1) = 0;
a := 0;
b := 1;
ic1 := bc1[1], D(phi)(a) = alpha;
constraint := lhs(bc1[2]) - rhs(bc1[2]);
constraint = 0;
a0 := 0;
u0 := eval(constraint, phi(b) = PHIb(eval({ic1, ode1}, alpha = a0), phi(eta), b));
a1 := 0.01;
u1 := eval(constraint, phi(b) = PHIb(eval({ic1, ode1}, alpha = a1), phi(eta), b));
while fnormal(u1 - u0) <> 0 do
z := solve(u1 = (u1 - u0)*(a1 - x)/(a1 - a0), x);
a0, a1 := a1, z;
u0, u1 := u1, eval(constraint, u(b) = Ub(eval({ic1, ode1}, alpha = z), u(x), b));
end do;
alpha_opt1 := z;
shoot_sol1 := evalf(dsolve(eval({ic1, ode1}, alpha = alpha_opt1), u(x), implicit));
infolevel[dsolve] := 3;
exact_sol1 := combine(dsolve({bc1, ode1}, u(x)));
infolevel[dsolve] := 0;
plot([rhs(exact_sol1), rhs(shoot_sol1)], x = 0 .. 1, color = [BLACK, RED], thickness = [5, 2], legend = ['exact', 'shooting'], title = "Figure 17.3");
evalf(eval(rhs(shoot_sol1), x = 1));

## Find the sag of sun sails...

Asked by:

Hi..

OK, so my real-life example is I have a 3m gap between the house and the garage which I want to hang a sunshade.
The hanging point on the house is 2.6m high and on the garage 2.1m (above ground).

I have a choice between 2 sun sails, and I want to know -approximately- what sag I can expect from each.

I realise this is not exactly the same as the hanging wire problem i posted before.. but it my attempt anyway. Can anyone improve?

Sails.mw

there is this ref

https://www.mapleprimes.com/questions/147809-Real-Solution-For-Catenary-Differential-Equation

## Units - defining units permanently for future use...

Asked by:

hello how do i define new units of multiple units. so i am able to choose them inside the Choose Unit in the rigth side

because as you can see there are not an option to define this as Unit -> [J/(K*mol)]

instead i have the option to use [m^2*kg/(s^2*K*mol)]

because i seen that you can defijne and install new units i just dont know how to impliment it so they alway remember my new units without i am suposed to initialize it with a command at top of my script

ps i also dont know how to define my new unit an just run that command at top of my script either.

but it would be better if it is permanent installed

i ask because i have several other units that is trublesome in maple (being in chemistry, we dont always use SI units) so molar [M] is also some times trublesome

as mapleprime often ask if we can include code i will do that

write this formula

3/(2)*8.3144621*J*K^(-1)*mol^(-1)

and use the simplify command in the right side and see that the unit is

thx

 First 226 227 228 229 230 231 232 Last Page 228 of 2279
﻿