MaplePrimes Questions

Hi senior, i am trying to customize the range for horizontal axis means in my case y axis but got error, also trying to give different color for outcomes. Please help in this regards.

Axis_Help.mw

Is it possible to use a vector in the piecewise fuction? I have tried the following and other stuff but the the error below

timestep := <seq(1 .. 100)>;
piecewise(`<`~(30, timestep), 1);
Error, (in PiecewiseTools:-Is) wrong kind of parameters in piecewise
 

I have a time vector and would like to create a u(t), unit step fuction to "turn on" a function at a certain time. e.g.

output(t)=u(t)*f(t)

Where u(t)=1 for t>turn_on_time and 0 otherwise.

TIA for help

What  the  error "could not store"means and how can fix it? a peace of file attached.

  Could you please give maple code for Shooting Method/Kellor box Method or any numerical method except RK Method to this system of Differential Equations.

SMMS.mw

In a recent answer I posted, I had a relation of the form

I*Int(f(x), x) = something - 2*I*Int(f(x), x)

and I wanted to isolate the term Int(f(x), x).
The function isolate failed to do it and I was forced to use some workaround to do the "isolation".

Trying to understand what happened here, it seems that isolate fails when the term to isolate is multiplied by the imaginary unit
Here are a few examples

expr := I*(Int(x^2*ln(-x+sqrt(x^2-1)), x)) = g(x) -(2*I)*(Int(x^2*ln(-x+sqrt(x^2-1)), x))

I*(Int(x^2*ln(-x+(x^2-1)^(1/2)), x)) = g(x)-(2*I)*(Int(x^2*ln(-x+(x^2-1)^(1/2)), x))

(1)

# no isolation

isolate(expr, lhs(expr))

I*(Int(x^2*ln(-x+(x^2-1)^(1/2)), x)) = g(x)-(2*I)*(Int(x^2*ln(-x+(x^2-1)^(1/2)), x))

(2)

# isolation

expr_1 := expand(expr / I)
isolate(expr_1, lhs(expr_1))

Int(x^2*ln(-x+(x^2-1)^(1/2)), x) = -((1/3)*I)*g(x)

(3)

# no isolation neither, so the problem is not related to "Int"

expr := I*diff(h(x), x) = g(x) -2*I*diff(h(x), x):
isolate(expr, lhs(expr))

I*(diff(h(x), x)) = g(x)-(2*I)*(diff(h(x), x))

(4)

# no isolation neither, so the problem comes from "I"

expr := I*A = g(x) -2*I*A:
isolate(expr, lhs(expr))

I*A = g(x)-(2*I)*A

(5)

# isolation (of course)

expr := c*A = g(x) -2*c*A:
isolate(expr, lhs(expr))

c*A = (1/3)*g(x)

(6)

 

Download Isolation.mw

I guess this is a known behavior, but why it is so?
Is there a way to force the "isolation" without using a trick like in result (3)

Thanks in advance

Hello community, I am new in this forum and sorry if the following seems rudimentary:

I am replicating a distribution function using Statistics[Distribution] as defined here:

Vose Software's Beta Subjective

I have tested numerically and the function works for this initial values: Min := 3; Mlikely := 8; Avg := 9; Max := 18;

But failed to complete with these values (which I tested works in another software) Min := 1000; Mlikely := 1400; Avg := 1500; Max := 2100;

What puzzles me is the inconsistency of handling the functions (be aware that the server kernel could be slow at times). I hope I don't have to give up and continue my custom distribution project in another software.

Here is the document: 

NULL

The Beta Subjective Distribution

 

 

restart

 

with(Statistics)

NULL

Min := 3; Mlikely := 8; Avg := 9; Max := 18

18

(1)

NULL

Mid := (Min+Max)*(1/2)

21/2

(2)

alpha := 2*(Avg-Min)*(Mid-Mlikely)/((Avg-Mlikely)*(Max-Min))

2

(3)

beta := alpha*(Max-Avg)/(Avg-Min)

3

(4)

NULLNULLNULLNULL

NULL

f := simplify(piecewise(Min <= x and x <= Max, (x-Min)^(alpha-1)*(Max-x)^(beta-1)/(Beta(alpha, beta)*(Max-Min)^(alpha+beta-1)), 0))

piecewise(x < 3, 0, x <= 18, (4/16875)*(x-3)*(-18+x)^2, 18 < x, 0)

(5)

NULL

NULL

MD := Distribution(PDF = unapply(f, x), Conditions = [`and`(Min < Mlikely and Mlikely < Max and Min < Avg and Avg < Max and Mlikely <> Avg, piecewise(Avg < Mlikely, Mlikely > Mid, Mid > Mlikely))])

_m2352873740384

(6)

NULL

NULL

NULL

NULL

NULL

X := RandomVariable(MD)

_R

(7)

NULL

evalf(Mean(X))NULL

9.

(8)

NULL

NULL

evalf(Mode(X))

{8.}

(9)

evalf(Quantile(X, .25))

HFloat(6.645331256340534)

(10)

NULL

A := Sample(X, 10^5)

Mean(A)

HFloat(8.989513601786443)

(11)

Mode(A)

HFloat(8.399525182283146)

(12)

Variance(A)

HFloat(9.029923294780689)

(13)

Skewness(A)

HFloat(0.29817612117709397)

(14)

Kurtosis(A)

HFloat(2.3706624578773154)

(15)

Quantile(A, .25)

HFloat(6.63427086578336)

(16)

NULL

Download Distribution-Beta-Subjective.mw

I need to create a matrix with 4 dimensions, but I don't know how I can do this. The variable that I need to store could be written in this form:

>S[i,j,k,l];

I don't want to write this with a subscript, but like a matrix. 

Hello there, 

This is another issue, associated with substitution. In the following Maple expressions, I tried to substitutte the denominator of 'eq_K1_m4' in order to make it as 'eq_K1_m4_desired', but did not get any success (yet). 

Therefore, would you have a look at this issue to see if the intended goal can be achieved?

restart;

with(LinearAlgebra):

with(DynamicSystems):

interface(imaginaryunit=j):

eq_K1_m4 := K__1 = E__q0*(R__T*E__B*sin(delta) + X__Td*E__B*cos(delta))/(L__aqs*L__l + L__aqs*X__E + L__aqs*L__ads_p + L__l^2 + 2*L__l*X__E + L__l*L__ads_p + R__E^2 + 2*R__E*R__a + R__a^2 + X__E^2 + X__E*L__ads_p) + (X__q - X__dp)*i__q0*(X__Tq*E__B*sin(delta) - R__T*E__B*cos(delta))/(L__aqs*L__l + L__aqs*X__E + L__aqs*L__ads_p + L__l^2 + 2*L__l*X__E + L__l*L__ads_p + R__E^2 + 2*R__E*R__a + R__a^2 + X__E^2 + X__E*L__ads_p);

K__1 = E__q0*(R__T*E__B*sin(delta)+X__Td*E__B*cos(delta))/(L__aqs*L__l+L__aqs*X__E+L__aqs*L__ads_p+L__l^2+2*L__l*X__E+L__l*L__ads_p+R__E^2+2*R__E*R__a+R__a^2+X__E^2+X__E*L__ads_p)+(X__q-X__dp)*i__q0*(X__Tq*E__B*sin(delta)-R__T*E__B*cos(delta))/(L__aqs*L__l+L__aqs*X__E+L__aqs*L__ads_p+L__l^2+2*L__l*X__E+L__l*L__ads_p+R__E^2+2*R__E*R__a+R__a^2+X__E^2+X__E*L__ads_p)

(1)

eq_K1_m4_desired := K__1 = E__q0*(R__T*E__B*sin(delta) + X__Td*E__B*cos(delta))/Dx + (X__q - X__dp)*i__q0*(X__Tq*E__B*sin(delta) - R__T*E__B*cos(delta))/Dx;

K__1 = E__q0*(R__T*E__B*sin(delta)+X__Td*E__B*cos(delta))/Dx+(X__q-X__dp)*i__q0*(X__Tq*E__B*sin(delta)-R__T*E__B*cos(delta))/Dx

(2)

eq_Dx := Dx = L__aqs*L__l + L__aqs*X__E + L__aqs*L__ads_p + L__l^2 + 2*L__l*X__E + L__l*L__ads_p + R__E^2 + 2*R__E*R__a + R__a^2 + X__E^2 + X__E*L__ads_p;

Dx = L__aqs*L__l+L__aqs*X__E+L__aqs*L__ads_p+L__l^2+2*L__l*X__E+L__l*L__ads_p+R__E^2+2*R__E*R__a+R__a^2+X__E^2+X__E*L__ads_p

(3)

denom(op(1, rhs(eq_K1_m4))) - rhs(eq_Dx); # checking to see if the denominator expression is the same as the expression of Dx

0

(4)

denom(op(2, rhs(eq_K1_m4))) - rhs(eq_Dx); # checking to see if the denominator expression is the same as the expression of Dx

0

(5)

# 1

map2(applyrule, eq_Dx, eq_K1_m4); # did not work.

K__1 = E__q0*(R__T*E__B*sin(delta)+X__Td*E__B*cos(delta))/(L__aqs*L__l+L__aqs*X__E+L__aqs*L__ads_p+L__l^2+2*L__l*X__E+L__l*L__ads_p+R__E^2+2*R__E*R__a+R__a^2+X__E^2+X__E*L__ads_p)+(X__q-X__dp)*i__q0*(X__Tq*E__B*sin(delta)-R__T*E__B*cos(delta))/(L__aqs*L__l+L__aqs*X__E+L__aqs*L__ads_p+L__l^2+2*L__l*X__E+L__l*L__ads_p+R__E^2+2*R__E*R__a+R__a^2+X__E^2+X__E*L__ads_p)

(6)

# 2

subs(eq_Dx, eq_K1_m4); # did not work.

K__1 = E__q0*(R__T*E__B*sin(delta)+X__Td*E__B*cos(delta))/(L__aqs*L__l+L__aqs*X__E+L__aqs*L__ads_p+L__l^2+2*L__l*X__E+L__l*L__ads_p+R__E^2+2*R__E*R__a+R__a^2+X__E^2+X__E*L__ads_p)+(X__q-X__dp)*i__q0*(X__Tq*E__B*sin(delta)-R__T*E__B*cos(delta))/(L__aqs*L__l+L__aqs*X__E+L__aqs*L__ads_p+L__l^2+2*L__l*X__E+L__l*L__ads_p+R__E^2+2*R__E*R__a+R__a^2+X__E^2+X__E*L__ads_p)

(7)

# 3

simplify(eq_K1_m4, {Dx = L__aqs*L__l + L__aqs*X__E + L__aqs*L__ads_p + L__l^2 + 2*L__l*X__E + L__l*L__ads_p + R__E^2 + 2*R__E*R__a + R__a^2 + X__E^2 + X__E*L__ads_p}, [Dx]); # did not work.

K__1 = -E__B*((-R__T*(-X__q+X__dp)*i__q0-E__q0*X__Td)*cos(delta)+sin(delta)*(X__Tq*(-X__q+X__dp)*i__q0-R__T*E__q0))/(L__l^2+(L__aqs+L__ads_p+2*X__E)*L__l+X__E^2+(L__aqs+L__ads_p)*X__E+L__aqs*L__ads_p+(R__E+R__a)^2)

(8)

# 4

algsubs(eq_Dx, eq_K1_m4); # did not work.

K__1 = E__q0*(R__T*E__B*sin(delta)+X__Td*E__B*cos(delta))/(L__aqs*L__l+L__aqs*X__E+L__aqs*L__ads_p+L__l^2+2*L__l*X__E+L__l*L__ads_p+R__E^2+2*R__E*R__a+R__a^2+X__E^2+X__E*L__ads_p)+(X__q-X__dp)*i__q0*(X__Tq*E__B*sin(delta)-R__T*E__B*cos(delta))/(L__aqs*L__l+L__aqs*X__E+L__aqs*L__ads_p+L__l^2+2*L__l*X__E+L__l*L__ads_p+R__E^2+2*R__E*R__a+R__a^2+X__E^2+X__E*L__ads_p)

(9)

# 5

applyrule(L__aqs*L__l + L__aqs*X__E + L__aqs*L__ads_p + L__l^2 + 2*L__l*X__E + L__l*L__ads_p + R__E^2 + 2*R__E*R__a + R__a^2 + X__E^2 + X__E*L__ads_p = Dx, eq_K1_m4); # did not work.

K__1 = E__q0*(R__T*E__B*sin(delta)+X__Td*E__B*cos(delta))/(L__aqs*L__l+L__aqs*X__E+L__aqs*L__ads_p+L__l^2+2*L__l*X__E+L__l*L__ads_p+R__E^2+2*R__E*R__a+R__a^2+X__E^2+X__E*L__ads_p)+(X__q-X__dp)*i__q0*(X__Tq*E__B*sin(delta)-R__T*E__B*cos(delta))/(L__aqs*L__l+L__aqs*X__E+L__aqs*L__ads_p+L__l^2+2*L__l*X__E+L__l*L__ads_p+R__E^2+2*R__E*R__a+R__a^2+X__E^2+X__E*L__ads_p)

(10)

 

Download Q20230606.mw

I am surprised Maple could not do this integral. Any ideas how to make it do it?

restart;
integrand:=(ln(-x + sqrt(x^2 - 1))*x + sqrt(x^2 - 1))*x*sqrt(-x^2 + 1)/sqrt(x^2 - 1);
int(integrand,x)

For reference, another software gives

ClearAll[x]
integrand = (Log[-x + Sqrt[x^2 - 1]]*x + Sqrt[x^2 - 1])*x*Sqrt[-x^2 + 1]/Sqrt[x^2 - 1]
Integrate[integrand, x]

Which I verified to be correct.

Any workarounds? I tried assuming x>0 for example. Not sure what else to try now. I am sure with some pre-processing Maple can do it. 

Maple 2023

Please help me to solve this error.   or

Can you give the maple code for Shooting method/ Kellor Box Method for this problem.

mvp-1.mw

I was unsure if this should be a post or a question, or how to word it properly as I feel the attached file is the best way to see my issue. 

 However, when doing a computation involing the D_ specifically D_[mu](F[~mu,~nu]) where is a tensor, Maple is putting in strange "variables" into the output of my expression. I set the spacetime variables myself to tau,x,y,z and in the output there is combinations which appear as x(tau),y(tau) which has completely baffled me. 

Any ideas/help would be greatly appreciated. 

EinsteinPert.mw

EDIT: The problem is resolved when the Physics[Vectors] package is removed and replaced by VectorCalculus for the Lapacian. Still curious as why the Physics[Vectors] package causes this issue. (I of course could just brute force the Laplacian but I thought I would use the power of Maple for this).

How do I label the curves in Maple graph.

Please, I need commands to tweak my maple 18 graph.

Hi,
I want to have the value of the following two integrals numerically for any arbitrary value of kc  and kh. (Physically the answers of the integrals should be real.)
Is it possible to obtain the analytical solution of these integrals with Meple, in terms of parameters kc, kh, deltac, deltah and sigma ?
Thanks

1.mw

I have some ODE system contains unknown variables with  boundary conditions  (see the attachment). How to solve these system and find the vales of unknown variables.

In this problem, the boundary conditions tends to 0, when x tends to infinity.  BVP_with_parameters.mw
 

restart

eq1 := f(x) = x+a[1]*x^2-(1/48)*sqrt(2)*a[1]*x^4-(1/120)*a[1]^2*sqrt(2)*x^5;

h(x) = -0.3535533905e-3*x^5*a[2]*a[1]*a[3]-0.3333333334e-9*x^5*a[3]*a[2]^4+0.4166666668e-7*x^4*a[2]*a[3]^3-0.3333333334e-9*x^5*a[2]^2*a[3]^3-0.5000000000e-9*x^5*a[3]^2*a[2]^3+0.1250000000e-6*x^4*a[3]*a[2]^3-0.8333333336e-10*x^5*a[2]*a[3]^4+0.1250000000e-6*x^4*a[3]^2*a[2]^2-0.8333333336e-10*x^5*a[2]^5+0.4166666668e-7*x^4*a[2]^4+a[3]*x-0.1473139128e-1*x^4*a[1]*a[3]+0.2946278254e-1*x^4*a[1]*a[2]-0.3240906080e-3*x^5*a[1]*a[2]^2+0.2798964342e-5*x^5*a[2]*a[3]^2+0.4714045206e-5*x^5*a[3]*a[2]^2-0.6629126071e-3*x^4*a[3]*a[2]+0.7812499998e-3*x^5*a[3]-0.2946278254e-1*x^3*a[3]-0.5892556508e-3*x^4*a[2]^2+0.1915080866e-5*x^5*a[2]^3+0.5892556509e-1*x^3*a[2]-0.4687500000e-2*x^5*a[2]+0.5000000000e-2*a[2]^2*x^2-0.1666666667e-4*x^3*a[2]^3+0.5000000000e-2*a[2]*x^2*a[3]-0.3333333334e-4*x^3*a[3]*a[2]^2-0.1666666667e-4*x^3*a[2]*a[3]^2+1.

(1)

bcs := f(0) = 0, (D(f))(0) = 1, f(10) = 0, g(0) = 1, g(10) = 0, h(0) = 1, h(10) = 0;

f(0) = 0, (D(f))(0) = 1, f(10) = 0, g(0) = 1, g(10) = 0, h(0) = 1, h(10) = 0

(2)

sol := dsolve([{f(x), g(x), h(x)}, bcs], numeric)

Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations

 

``

 

Greetings! I have solved a nonlinear equation by Newton iterative method. Now i want to plot basins of attraction. Being a beginner, I have no clue how to plot it? Its totally different rom other simple plotting commands. Need help in this regard.Thank

1 2 3 4 5 6 7 Last Page 2 of 2237