C_R

3537 Reputation

21 Badges

6 years, 60 days

MaplePrimes Activity


These are answers submitted by C_R

Try to put the solve command into brakets. This way simplify gets all 3 solutions. 

(At the moment, I do not have Maple runnig to test this)

complexplot3d as you have used it cannot plot two surfaces (two complex expressions) descirbed with two parameters. You might wanted to do this

plots:-complexplot3d([Re(solnum[1]),Im(solnum[2])], x = -50.. 50, t = -50..50);

where the first expression represents the real part and the second the imaginary part.

Otherwise you can use one of

plot3d(map(Re, solnum), x = -50 .. 50, t = -50 .. 50);
plot3d(map(Im, solnum), x = -50 .. 50, t = -50 .. 50);
plot3d(map(abs, solnum), x = -50 .. 50, t = -50 .. 50);
plot3d(map(argument, solnum), x = -50 .. 50, t = -50 .. 50);

or you replace the parameters x and t by a complex parameter. For example

subs(x = Re(z), t = Im(z), solnum);
plots:-complexplot3d(%[1], z = -50 - 50*I .. 50 + 50*I);

 

Because it's not equal. Only if you square it.
 

is(sqrt(-2) = sqrt(2)*I);
is(sqrt(-2) = -I*sqrt(2));
                              true

                             false

 

One keyelement to understand the behaviour of Maple are double brackets ()(). This is very important but sparsely documented. You will probably not find it in the help system. You need ()() for function composition. See ?operators,functional and ?examples,functionaloperators.

The later explains differences between 1D and 2D.

(1.5) above not really explains why in your expression (4) the independed varaible x is dropped. I assume that sin^-1 is not interpreted as an operator/function and therefore the argument is dropped.

For more on ()() see acers answers here.

Concerning @@-1:

It makes Maples output for negative and postive exponents consistend.


 

I do not see the equaltiy you are claiming.
Assuming b real leads to roots for x that depend on beta

Only x=Pi/2 establishes equality, which makes B__0=-beta^5. 

The first call to TestDimension is ambigeous and allows many valid combination of dimensions. The second input does not (read the output backward) because x was replaced by 2.

From the help page:

In some situations, there is some ambiguity in how units are assigned, for example in the expression
                      "5*Unit('kg') + x*y"

if no extra information is given. In such a case, Maple will give the fully general value if you ask for
                     "output = dimensions"

This output is sometimes hard to understand, but it is explained in the text above.

I addition to acer answer:
In Units:-Standard Maple assumes that x is unitfree and therefore returns in the error message `1` for the unit of x.

In Unit:-Simple Maple does not assume anything (edit:) for the whole session for 5 * Unit(m) +x. The unit of x is left open and no dimensional checks are performed (edit: between inputs). unless x is assigned to a value.

Edit: Assigning x to a value with unit, does not allways trigger consistency checks
 

restart;with(Units:-Simple):
6*Unit('s') + x;
x:=2*Unit(m);
%%;
eval(%);
simplify(%);
                         6 Unit(s) + x

                         x := 2 Unit(m)

                     6 Unit(s) + 2 Unit(m)

                     6 Unit(s) + 2 Unit(m)

Error, (in Units:-Simple:-+) the following expressions imply incompatible dimensions: 6*Units:-Unit(s)+2*Units:-Unit(m)

 

What is currently not possible in Maple is explictily assuming that x is of a certain dimension. With that assumption Maple could check if operands of a sum are of the same dimension or collect a common factor from sums containing units.

To sure if this answers fully your question but if you in integrate the lefthand side of expression (2) over r and add an integration constant you will get an equivalent result as shown in DESol.

restart;with(PDETools):declare(omega(r),prime=r)

omega(r)*`will now be displayed as`*omega

 

`derivatives with respect to`*r*`of functions of one variable will now be displayed with '`

(1)

(-48*Pi*ln(r)*Q^3*r^2 + 6*M*r^2 - 3*r^3)*diff(diff(diff(omega(r), r), r), r) + (-96*Pi*Q^3*r - 6*r^2)*diff(diff(omega(r), r), r) + (96*Pi*Q^3*ln(r) + 192*Pi*Q^3 - 12*M + 12*r)*diff(omega(r), r) + 6*omega(r) = 0

(-48*Pi*ln(r)*Q^3*r^2+6*M*r^2-3*r^3)*(diff(diff(diff(omega(r), r), r), r))+(-96*Pi*Q^3*r-6*r^2)*(diff(diff(omega(r), r), r))+(96*Pi*Q^3*ln(r)+192*Pi*Q^3-12*M+12*r)*(diff(omega(r), r))+6*omega(r) = 0

(2)

dsolve({(2)},omega(r))

{omega(r) = DESol({diff(diff(_Y(r), r), r)-(-32*Pi*ln(r)*Q^3*r+16*Pi*Q^3*r+4*M*r-r^2)*(diff(_Y(r), r))/(r^2*(-16*Pi*Q^3*ln(r)+2*M-r))-(-48*Pi*Q^3-2*r)*_Y(r)/(r^2*(-16*Pi*Q^3*ln(r)+2*M-r))+c__1/(r^2*(-16*Pi*Q^3*ln(r)+2*M-r))}, {_Y(r)})}

(3)

int(lhs((2)),r)

3*(48*Pi*Q^3+2*r)*omega(r)+3*(32*Pi*ln(r)*Q^3*r-16*Pi*Q^3*r-4*M*r+r^2)*(diff(omega(r), r))+3*(-16*Pi*ln(r)*Q^3*r^2+2*M*r^2-r^3)*(diff(diff(omega(r), r), r))

(4)

coeff((4),diff(omega(r), r, r))

-48*Pi*ln(r)*Q^3*r^2+6*M*r^2-3*r^3

(5)

add(simplify([(op((4)),c__1)/~(5)]))

(48*Pi*Q^3+2*r)*omega(r)/(r^2*(-16*Pi*Q^3*ln(r)+2*M-r))-(-32*Pi*Q^3*ln(r)+16*Pi*Q^3+4*M-r)*(diff(omega(r), r))/(r*(-16*Pi*Q^3*ln(r)+2*M-r))+diff(diff(omega(r), r), r)+(1/6)*c__1/(r^2*(-8*Pi*Q^3*ln(r)+M-(1/2)*r))

(6)
 

 

Download DESol_Question_reply.mw

The problem with the integral is that ln(V), where V is a physical quantity,  does not evaluate to numerical values.
Here is why Maple can only provide an answer if n and m are and the integration variable are assumed dimensionless:
 

Original problem without units

`assuming`([int(n/V, V = V__1 .. V__2)], [V__1 > 0, V__2 > 0])

-ln(V__1)*n+ln(V__2)*n

(1)

Replacing this by a dimensionless expression

`assuming`([int(n/v, v = v__1 .. v__2)], [v__1 > 0, v__2 > 0])

-ln(v__1)*n+ln(v__2)*n

(2)

were v is a dimensionless value. The unit of the physical quantity V is unit_V  thus defining V as

V = v*unit_V

V = v*unit_V

(3)

Substituting now the integration ranges into the solution (2)

subs(v__1 = n*Unit('m'^3)/unit_V, v__2 = m*Unit('m'^3)/unit_V, -ln(v__1)*n+ln(v__2)*n)

-ln(n*Units:-Unit(m^3)/unit_V)*n+ln(m*Units:-Unit(m^3)/unit_V)*n

(4)

Since

unit_V = Unit('m'^3)

unit_V = Units:-Unit(m^3)

(5)

We get the same output as Maple provides

subs(unit_V = Units:-Unit(m^3), -ln(n*Units:-Unit(m^3)/unit_V)*n+ln(m*Units:-Unit(m^3)/unit_V)*n)

-ln(n)*n+ln(m)*n

(6)

Edit: variant without auxiliary variable unit_V

 

v__1 = V__1*%/Unit('m'^3), v__2 = V__2*%/Unit('m'^3)

v__1 = `%/`(V__1, Units:-Unit(m^3)), v__2 = `%/`(V__2, Units:-Unit(m^3))

(7)

V__1 = n*Unit('m'^3), V__2 = m*Unit('m'^3)

V__1 = n*Units:-Unit(m^3), V__2 = m*Units:-Unit(m^3)

(8)

subs(V__1 = n*Units:-Unit(m^3), V__2 = m*Units:-Unit(m^3), [v__1 = `%/`(V__1, Units:-Unit(m^3)), v__2 = `%/`(V__2, Units:-Unit(m^3))])[]

v__1 = `%/`(n*Units:-Unit(m^3), Units:-Unit(m^3)), v__2 = `%/`(m*Units:-Unit(m^3), Units:-Unit(m^3))

(9)

value(subs(%, -ln(v__1)*n+ln(v__2)*n))

-ln(n)*n+ln(m)*n

(10)

NULL


Updated worksheet: Download Units_Int_reply_2.mw

Former worksheet: Download Units_Int_reply.mw

Assumptions on names having a unit such as

       assuming V::[m^3]

would be of great value for mixed expression containing names/symbols and units since Maple could detect conflicts and errors

In you code: Have you tried to remove these brackets?

If working without a Unit package (which is already quite powerfull in combination with simplify and convert) is accepable, try

Maple 2024, by the way, simplifies also with Units:-Simple loaded

Solving by hand an explicit solution can be derived

sol:=dsolve(ode);
subs(x=a,y(a)=b,%):
map(tan,%);
solve(%,{c__1});
simplify(subs(%[1],sol));

This solution is too complex for odetest. However, when arctan(y,x) is converted to arctan the IC is correctly reproduced.
 

Try removing the square bracket in D1. Square brackets are used in Maple to create a list.

For inequalties you might need assumptions as well depending on the expression.

I have tried to verify G1 with odetest which worked for + but not for -

y(x) = -sqrt(-epsilon)*tanh((x+lambda)*sqrt(-epsilon)):
odetest(%,ode);

                /         /                         (1/2)\\
      2 epsilon \-1 + cosh\2 (x + lambda) (-epsilon)     //
    - -----------------------------------------------------
                    /                         (1/2)\       
            1 + cosh\2 (x + lambda) (-epsilon)     /       

So maybe the list is incorrect in some details.

Here are other solutions (without lambda) that can be obtained straight out of the library using the option method.  Anything else, I am afraid, requires advanced skills and/or manipulation by hand. Were you looking for something like that?

restart;kernelopts(version);
with(DEtools):
ode := diff(y(x), x) = epsilon - y(x)^2;
                                  

sol := dsolve(ode);
                 
    

P := particularsol(ode);

`Maple 2024.1, X86 64 WINDOWS, Jun 25 2024, Build ID 1835466`

 

diff(y(x), x) = epsilon-y(x)^2

 

y(x) = tanh(epsilon^(1/2)*(c__1+x))*epsilon^(1/2)

 

y(x) = epsilon^(1/2), y(x) = -epsilon^(1/2), arctanh(y(x)/epsilon^(1/2))-x*epsilon^(1/2)+c__1 = 0

(1)

indices(`dsolve/methods`)

[1], [2, nonlinear], [1, high_degree], [2, "linear_homogeneous other"], [2, "linear_homogeneous all methods"], [2, "hypergeometric"], [3, linear_homogeneous], [2, "special_functions"], [2, linear_homogeneous], [1, "special"], [high, linear_homogeneous], [high, linear_nonhomogeneous], [3, linear_nonhomogeneous], [2, "linear_homogeneous as given"], [2, linear_nonhomogeneous], [high, nonlinear], [high, "development"], [1, semiclass], [2, "development"], [2, "linear_homogeneous in Normal Form"], [1, extra], [3, nonlinear], [3, "development"], [1, "development"]

(2)

NULL

[entries(`dsolve/methods`[1])];
seq([%[i],dsolve(ode,%[i])],i=1..nops(%));

[[quadrature], [linear], [Bernoulli], [separable], [inverse_linear], [homogeneous], [Chini], [lin_sym], [exact], [Abel], [pot_sym]]

 

[[quadrature], -c__1+x-arctanh(y(x)/epsilon^(1/2))/epsilon^(1/2) = 0], [[linear]], [[Bernoulli]], [[separable], y(x) = tanh(epsilon^(1/2)*(c__1+x))*epsilon^(1/2)], [[inverse_linear], y(x) = -tanh(c__1*epsilon^(1/2)-x*epsilon^(1/2))*epsilon^(1/2)], [[homogeneous]], [[Chini], y(x) = I*tan(-I*x*epsilon^(1/2)+c__1)*epsilon^(1/2)], [[lin_sym], y(x) = tanh(epsilon^(1/2)*(c__1+x))*epsilon^(1/2)], [[exact], y(x) = tanh(c__1*epsilon^(1/2)+x*epsilon^(1/2))*epsilon^(1/2)], [[Abel]], [[pot_sym]]

(3)

[entries(`dsolve/methods`[1,high_degree])];
seq([%[i],dsolve(ode,%[i])],i=1..nops(%));

[[WeierstrassP], [WeierstrassPPrime], [JacobiSN], [linearizable_by_differentiation], [missing], [dAlembert], [homogeneous_B], [sym_implicit]]

 

[[WeierstrassP]], [[WeierstrassPPrime]], [[JacobiSN]], [[linearizable_by_differentiation]], [[missing], y(x) = -epsilon^(1/2), y(x) = epsilon^(1/2), y(x) = -tanh(c__1*epsilon^(1/2)-x*epsilon^(1/2))*epsilon^(1/2)], [[dAlembert], y(x) = epsilon^(1/2), [x(_T) = arctanh((-_T+epsilon)^(1/2)/epsilon^(1/2))/epsilon^(1/2)+c__1, y(_T) = (-_T+epsilon)^(1/2)], y(x) = -epsilon^(1/2), [x(_T) = -arctanh((-_T+epsilon)^(1/2)/epsilon^(1/2))/epsilon^(1/2)+c__1, y(_T) = -(-_T+epsilon)^(1/2)]], [[homogeneous_B]], [[sym_implicit]]

(4)

[entries(`dsolve/methods`[1,semiclass])];
seq([%[i],dsolve(ode,%[i])],i=1..nops(%));

[[Riccati], [inverse_Riccati], [equivalent_to_Abel], [linearizable], [linearizable_by_differentiation]]

 

[[Riccati], y(x) = (1/2)*tan(-(1/2)*x*(-4*epsilon)^(1/2)+(1/2)*c__1*(-4*epsilon)^(1/2))*(-4*epsilon)^(1/2)], [[inverse_Riccati]], [[equivalent_to_Abel]], [[linearizable]], [[linearizable_by_differentiation]]

(5)

[entries(`dsolve/methods`[1,extra])];
seq([%[i],dsolve(ode,%[i])],i=1..nops(%));

[[inverse_Riccati], [Abel_AIL], [`sym_pat/[F(x)*G(y),0]`], [`sym_pat/[F(x),G(x)]`], [`sym_pat/[F(x),G(y)]`], [`sym_pat/[F(x)+G(y),0]`], [`sym_pat/[F(x),G(x)*y+H(x)]`], [sym_pat], [exp_sym]]

 

[[inverse_Riccati]], [[Abel_AIL]], [[`sym_pat/[F(x)*G(y),0]`], y(x) = -tanh(c__1*epsilon^(1/2)-x*epsilon^(1/2))*epsilon^(1/2)], [[`sym_pat/[F(x),G(x)]`], y(x) = tanh(epsilon^(1/2)*(c__1+x))*epsilon^(1/2)], [[`sym_pat/[F(x),G(y)]`]], [[`sym_pat/[F(x)+G(y),0]`], y(x) = tanh(c__1*epsilon^(1/2)+x*epsilon^(1/2))*epsilon^(1/2)], [[`sym_pat/[F(x),G(x)*y+H(x)]`], y(x) = tanh(epsilon^(1/2)*(c__1+x))*epsilon^(1/2)], [[sym_pat], y(x) = -tanh(c__1*epsilon^(1/2)-x*epsilon^(1/2))*epsilon^(1/2)], [[exp_sym]]

(6)

NULL

Download dsolve_methods.mw

I cannot run your worksheet because

with(Syrup);
Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received Syrup

However, what I see in your assumptions is too restrictive. Instead of "and" try comma
 

assumptions := 0 < `&omega;0p`, 0 < `&omega;0s`, 0 < Lp, 0 < Ls, 0 < k, 0 < Rp, 0 < Rs, 0 < omega, 0 < L, 0 < Idc, 0 < Vbat

 

3 4 5 6 7 8 9 Last Page 5 of 17