C_R

3622 Reputation

21 Badges

6 years, 124 days

MaplePrimes Activity


These are replies submitted by C_R

In your worksheet solve returns the 3 roots of period_eqn.
One real valued and two complex solutions.

Maybe its clearer this way
 

restartNULL

mu := 398600

398600

(1)

T := 2*3600

7200

(2)

period_eqn := T = 2*Pi*sqrt(a^3/mu)

7200 = (1/19930)*Pi*3986^(1/2)*(a^3)^(1/2)

(3)

sol_a := solve(period_eqn, {a})

{a = 600*23916^(1/3)/Pi^(2/3)}, {a = -300*23916^(1/3)/Pi^(2/3)+(300*I)*3^(1/2)*23916^(1/3)/Pi^(2/3)}, {a = -300*23916^(1/3)/Pi^(2/3)-(300*I)*3^(1/2)*23916^(1/3)/Pi^(2/3)}

(4)

whattype(sol_a)

exprseq

(5)

NULL

NULL


 

Download hw8_reply.mw

@vv 

Not in 2D (what I tried before asking). Thanks

@Axel Vogt 

This is what I meant: the File Explorer of Windows.

Before Windows 8, the File Explorer was termed Windows Explorer.

I will correct this.

@Carl Love 

I could not paste it as 1D. Pasting it in a Codeedit region works and produces a list of all files. 

Thank you for the answer.

 

I could not figure out what "?:=" does. Is that documented?

 

 

@zenterix 

The only documentation I read was the programming guide. To me it is more than a programming guide because it explains for a good extend Maples foundation. Maybe you should ask for a recommendation in a separate thread.

 

@salim-barzani 

Generate a plot for each parameter and then use plots:-display to plot all in once. Additionally you can use the legend option to label the plot, see ?plot,options

@salim-barzani 

I do not have time to look at it. What I see from the screen shots is that the solution does not look strucurally identical

I those situations I would enter the text book solution first and see how it plots. Then I would investigate the own solution.

@nm 

I am not aware of such a setting but I see that it could make sense as a GUI option. Maple has control over the cursor position since it is needed for editing. I assume that the initial cursor setting is unsing a Java default. Only Maplesoft can tell if this is correct.

Rondom jumps of the cursor position is something which should not happen. Maybe it is the cause that I get from time to time a split of 1D input into two lines of an execution group. I.e. enter is working as "shift enter" and creates a new line inside and execution group. I have to use "!" to execute. I never understood  why and when this happens.

@zenterix 
You must do it by hand, because the output of solve is a simplification endpoint of Maple (what Maple considers as "simple"). Compare
 

sqrt(-2*gamma__b^2 + 4*omega__0^2)/2;
(%^2)^(1/2);

 

It did not change with 2024.1. I tested it with 2024.0 which I could install in parallel.

However, a test with Maple 2018 shows that the former Java runtime environement sets the cursor at the start as you remembered.

 

@Carl Love 
This looks promissing, however so far I can only list Maple files in a directory but no subdirectories.

As I understand the help page this should list all *.mw files (but it does not)
 

FileTools:-ListDirectory("C:/", 'select' = "*.mw", 'depth' = 40);

 

@salim-barzani 
Not really for a 3d plot. You have to reformulate your problem. A third parameter is required in your complex expression that can be used in an amination call.

Or if 2d is OK for you, paste this into my reply at the very end

plots:-animate(plot, [map(Re, solnum), x = -50 .. 50], t = -50 .. 50, axes = boxed);
plots:-animate(plot, [map(Im, solnum), x = -50 .. 50], t = -50 .. 50, axes = boxed);


 

@salim-barzani 

Shure:

 

restart;

local gamma:

NULL

Added random values for the parameters theta and gamma

params := {alpha = 2.5, k = 3, w = 2, beta[3] = 3, beta[4] = 1.7,theta=0,gamma=1};

{alpha = 2.5, gamma = 1, k = 3, theta = 0, w = 2, beta[3] = 3, beta[4] = 1.7}

(1)

xi := sqrt(-1/(72*alpha*beta[4]+72*gamma*beta[4]))*(2*alpha*k*t+x)

(-1/(72*alpha*beta[4]+72*gamma*beta[4]))^(1/2)*(2*alpha*k*t+x)

(2)

We perhaps want to plot the magnitude and color it with the phase - so make [mag, phase]

sol1 := [U(xi), -k*x -(9*alpha*k^2*beta[4] + 2*beta[3]^2)/(9*beta[4])*t + theta];

[U((-1/(72*alpha*beta[4]+72*gamma*beta[4]))^(1/2)*(2*alpha*k*t+x)), -k*x-(1/9)*(9*alpha*k^2*beta[4]+2*beta[3]^2)*t/beta[4]+theta]

(3)

Assume some functional form for U(xi)

sol2 := eval(sol1, U(xi) = -beta[3]/(3*beta[4]) + beta[3]*sinh(xi)/(6*beta[4]*cosh(xi)) + beta[3]*cosh(xi)/(6*beta[4]*sinh(xi)));

[-(1/3)*beta[3]/beta[4]+(1/6)*beta[3]*sinh((-1/(72*alpha*beta[4]+72*gamma*beta[4]))^(1/2)*(2*alpha*k*t+x))/(beta[4]*cosh((-1/(72*alpha*beta[4]+72*gamma*beta[4]))^(1/2)*(2*alpha*k*t+x)))+(1/6)*beta[3]*cosh((-1/(72*alpha*beta[4]+72*gamma*beta[4]))^(1/2)*(2*alpha*k*t+x))/(beta[4]*sinh((-1/(72*alpha*beta[4]+72*gamma*beta[4]))^(1/2)*(2*alpha*k*t+x))), -k*x-(1/9)*(9*alpha*k^2*beta[4]+2*beta[3]^2)*t/beta[4]+theta]

(4)

insert numerical values

solnum :=eval(sol2, params);

[-.5882352940+(.2941176471*I)*sin(.7247137946*t+0.4831425297e-1*x)/cos(.7247137946*t+0.4831425297e-1*x)-(.2941176471*I)*cos(.7247137946*t+0.4831425297e-1*x)/sin(.7247137946*t+0.4831425297e-1*x), -3*x-23.67647059*t]

(5)

#plots:-complexplot3d(solnum, x = -50.. 50, t = -50..50);

P := Array(1 .. 2); P[1] := plot3d(map(Re, solnum), x = -50 .. 50, t = -50 .. 50, title = Re); P[2] := plot3d(map(Im, solnum), x = -50 .. 50, t = -50 .. 50, title = Im); plots:-display(P)

 

 

 

 

 

 

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

[-.5882352940+(.2941176471*I)*sin(.7247137946*Im(z)+0.4831425297e-1*Re(z))/cos(.7247137946*Im(z)+0.4831425297e-1*Re(z))-(.2941176471*I)*cos(.7247137946*Im(z)+0.4831425297e-1*Re(z))/sin(.7247137946*Im(z)+0.4831425297e-1*Re(z)), -3*Re(z)-23.67647059*Im(z)]

 

 

NULL

 

Download complexplot3d_reply.mw

I have never seen this before but I remember that you run Maple with modified kernelopts settings form default values.
When exactly do you get this message? After having executed input involving kernelopts?

@salim-barzani 

The sheer amount of libraries you load makes me uneasy. So I have done it by hand just excluded that packages do not work well together. This does not seem to be the case.
Could it be that you B__0 has an error of sign in the second or third summand?


 

I*G(x)^3*conjugate(G(x))^2+(2*I)*G(x)^2*(diff(G(x), x))+(2*I)*(diff(G(x), x))*G(x)*conjugate(G(x))

I*G(x)^3*conjugate(G(x))^2+(2*I)*G(x)^2*(diff(G(x), x))+(2*I)*(diff(G(x), x))*G(x)*conjugate(G(x))

(1)

Let's make the expression a bit simpler to investigate the summands

simplify((I*G(x)^3*conjugate(G(x))^2+(2*I)*G(x)^2*(diff(G(x), x))+(2*I)*(diff(G(x), x))*G(x)*conjugate(G(x)))/(I))

G(x)*abs(G(x))^4+2*(diff(G(x), x))*abs(G(x))^2+2*G(x)^2*(diff(G(x), x))

(2)

G(x) = beta*exp(I*x)

G(x) = beta*exp(I*x)

(3)

conjugate(G(x)) = beta*exp(-I*x)

conjugate(G(x)) = beta*exp(-I*x)

(4)

(G(x) = beta*exp(I*x))+(conjugate(G(x)) = beta*exp(-I*x))

G(x)+conjugate(G(x)) = beta*exp(x*I)+beta*exp(-I*x)

(5)

simplify(%)

2*Re(G(x)) = 2*beta*cos(x)

(6)

This matches my definition of conjugate.
First summand:

subs(G(x) = beta*exp(I*x), conjugate(G(x)) = beta*exp(-I*x), I*G(x)^3*conjugate(G(x))^2+(2*I)*G(x)^2*(diff(G(x), x))+(2*I)*(diff(G(x), x))*G(x)*conjugate(G(x)))

I*beta^3*(exp(x*I))^3*conjugate(beta*exp(x*I))^2+(2*I)*beta^2*(exp(x*I))^2*(diff(beta*exp(x*I), x))+(2*I)*(diff(beta*exp(x*I), x))*beta*exp(x*I)*conjugate(beta*exp(x*I))

(7)

(G(x) = beta*exp(I*x))^3

G(x)^3 = beta^3*(exp(x*I))^3

(8)

(conjugate(G(x)) = beta*exp(-I*x))^2

conjugate(G(x))^2 = beta^2*(exp(-I*x))^2

(9)

(G(x)^3 = beta^3*(exp(I*x))^3)*(conjugate(G(x))^2 = beta^2*(exp(-I*x))^2)

G(x)^3*conjugate(G(x))^2 = beta^5*(exp(x*I))^3*(exp(-I*x))^2

(10)

simplify(G(x)^3*conjugate(G(x))^2 = beta^5*(exp(I*x))^3*(exp(-I*x))^2)

G(x)*abs(G(x))^4 = beta^5*exp(x*I)

(11)

This is what you are looking for
Second summand

diff(G(x) = beta*exp(I*x), x)

diff(G(x), x) = I*beta*exp(x*I)

(12)

(G(x) = beta*exp(I*x))^2

G(x)^2 = beta^2*(exp(x*I))^2

(13)

2*(diff(G(x), x) = I*beta*exp(I*x))*(G(x)^2 = beta^2*(exp(I*x))^2)

2*G(x)^2*(diff(G(x), x)) = (2*I)*beta^3*(exp(x*I))^3

(14)

This is not what you are looking for. Let'y see if the thrid summand chancel this
Thrid summand:

simplify(2*(G(x) = beta*exp(I*x))*(conjugate(G(x)) = beta*exp(-I*x))*(diff(G(x), x) = I*beta*exp(I*x)))

2*(diff(G(x), x))*abs(G(x))^2 = (2*I)*beta^3*exp(x*I)

(15)

Same as the second summand. Could it be that you B__0 has an error of sign in the second or third summand?

NULL

NULL


 

Download simplify_by_hand.mw

First 25 26 27 28 29 30 31 Last Page 27 of 72