MaplePrimes Questions

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

When running "C:\Program Files\Maple 2023\bin.X86_64_WINDOWS\cmaple.exe" on my application which makes plots and export them to ps, sometimes I get an exception

              "cannot locate postscript AFM files"

This happens on some plots. Not all. The strange thing, using the same exact run, but from the worksheet, it works fine and I get the .ps generated with no such error. This only happens when running from the command line. It happens here


try
   plotsetup(ps, plotoutput="plot.ps",plotoptions=noborder);
   print(p1);   
   plotsetup(default):
catch:
   print(StringTools:-FormatMessage( lastexception[2..-1] ));
end try;

where p1 above is a plot that was generated earlier OK with no error. I made sure there is no font settings on the plot or any extra options that might cause a problem.

I am not able to make MWE as this problem only shows deep inside my application and only when calling Maple from command line and only shows up on very few plots for some reason I do not understand.  When I made a small .mpl with same code used to make the plot, and run it from command line, the error do not show up. It only shows up when running the whole application from the command line. 

My question is: How does Maple find these postscript AFM files? It looks like the postscript driver used by command like Maple is older than the one used by the frontend/GUI and this is why this error only shows from the command line. Has anyone seen such a Maple error before? 

I have no idea where to find these AFM postscript files it says it can't find and what to do now. I am on windows 10.

Any suggestion what to lookfor and anything else I can do to help me find the cause of this?

If it is any help, here is the MWE I tried to reproduce this with. But this generated no error. Call this foo.mpl

foo:=proc()
local p1,ode,y,x;
   ode:=3*y(x)+x*diff(y(x),x) = 2*x^5;
   p1 := DEtools:-phaseportrait(ode,y(x),x=-1..5,[y(2)=1],y=-1000..1000):
   try
      plotsetup(ps, plotoutput=cat("C:/tmp/plot.ps"),plotoptions=noborder);
      print(p1);   # also tried without "display"
      plotsetup(default):
   catch:
      print(StringTools:-FormatMessage( lastexception[2..-1] ));
      print("Exception");
   end try;
end proc;

foo();

Then run 

 

C:\tmp>"C:\Program Files\Maple 2023\bin.X86_64_WINDOWS\cmaple.exe"  foo.mpl

No error. The error only shows in my large application.

                             "cannot locate postscript AFM files"

Will keep trying to make a MWE, but for 3 hrs now, no luck yet.

Update

I've added 

if lasterrorlocus<>'lasterrorlocus' then
                     print(lasterrorlocus);
                     showsource();
end if; 

Inside the catch, which print the exact location of the exception generated. It is at print(p1) as you see

again, same code runs with no problem from the worksheet. This only shows when running from command line. Will keep trying to make MWE...

When translating Maple expression with special math functions, Maple does not use the same familar name shown in worksheet, but replaces these special functions with one letter. 

This makes it very hard when looking at the equations in latex and the pdf to know what these special functions are. 

Is there an option to keep the same name used in Maple but use the \operatorname{name} in the latex generated? This will go a long way to improve the output and make one understand what they are looking at.

Here are examples below. Notice as side note, that Maple does not translate pochhammer at all. Is this a bug? It only gave its arguments in the latex. 

I think everyone will agree that reading BesselJ in the equation is more clear than reading J and reading hypergeom is more clear than and reading  MeijerG is more clear than and so on as one does not have to guess what these letters mean when looking at the final output in pdf.  
 

1384004

restart;

1384004

expr:=BesselJ(1,x);
latex(expr)

BesselJ(1, x)

J_{1}\! \left(x \right)

expr:=hypergeom( [],[],z );
latex(expr)

hypergeom([], [], z)

{}_{0}^{}{\moversetsp{}{\mundersetsp{}{F_{0}^{}}}}\! \left(;;z \right)

expr:=pochhammer(3/10, n);
latex(expr)

pochhammer(3/10, n)

\left(\frac{3}{10}\right)_{n}

expr:=MeijerG([[1, 1, 1, 1], []],[[], [4, 3, 2, 2]],Pi);
latex(expr)

MeijerG([[1, 1, 1, 1], []], [[], [4, 3, 2, 2]], Pi)

G_{4,4}^{0,4}\! \left(\pi \bigg| {\mstack{1,1,1,1}{4,3,2,2}}\right)

 


It should not be hard to provide an option for latex() in Maple (say Keep_special_function_math_names:=true) and keep default as is now.

Then all what Maple needs to do is simply generate \operatorname{BesselJ} instead of and \operatorname{hypergeom} instead of and \operatorname{pochhammer} and so on for any special function that does not have any standard Latex known notation. Even if one can argue that somewhere somehow someone should know that F is hypergeom and one should know that J means BesselJ and so on for dozens of other single letters used, I think it is much more clear to the reader to see the full name of the function as it shows in Maple worksheet.

The rest of the arguments remain the same exactly as shown by Maple on the screen and no need to make any changes there. It is only the name of the function which is the problem.

This only applies for all the special math function names ofcourse.

Any chance of making such changes to Maple's latex()? I tried to make the changes by post-processing the latex as string using patterns and string replace, but this was breaking things as it is not possible to just simply change letter J to BesselJ for example, as the letter J can be anything else in the latex. I think the best solution is to do this at the source, when the latex is generated by Maple.

Version 2023 on windows.

Download latex_math_functions.mw

ps. removed the list to make the question shorter as requested.

 

Let's put aside the drawbacks of using goto for now. Below is the program I wrote. When I run it, it seems to execute, but the Maple interface displays the message "System error,,at top level". Does this trigger an internal warning in Maple?

for i to 4 do
    for j to 4 do
         print([i,j]):
        if i = 2 and j = 3 then
             goto(al):
        end if:
    end do:
end do:
al;

                             [1, 1]

                             [1, 2]

                             [1, 3]

                             [1, 4]

                             [2, 1]

                             [2, 2]

                             [2, 3]

                  System error, , at top level

                               al

I have the following code below:

eq := -((2*(alpha[3]+alpha[2]))*((1/2)*cos(Theta(z, t))^2-(1/2)*sin(Theta(z, t))^2)+(alpha[3]-alpha[2])*(sin(Theta(z, t))^2+cos(Theta(z, t))^2))*(diff(U(z, t), z))-(alpha[3]-alpha[2])*(2*sin(Theta(z, t))^2*(diff(Theta(z, t), t))+2*cos(Theta(z, t))^2*(diff(Theta(z, t), t)))+(diff(Theta(z, t), z, z))*k

simplify(subs(simplify(coeff(eq, diff(U(z, t), z))) = t1, eq))

Please, why is maple not assigning t1 to the coefficient of diff(U(z, t), z)) in the expression? 

The example below is an attempt to solve a boundary value problem (BVP) without manually replacing terms in expressions and some questions where there might be room for improvement. (Only the first integration step is shown to keep it short)

My objective is to have clean Maple input with minimal manual interventions or low-level manipulations (such as using op and similar commands).

NULL

ode := diff(phi(s), s, s)+K*cos(phi(s)) = 0

diff(diff(phi(s), s), s)+K*cos(phi(s)) = 0

(1)

NULL

map(int, ode, s)

int(diff(diff(phi(s), s), s)+K*cos(phi(s)), s) = 0

(2)

Student[ODEs]:-Integrate(ode, phi(s))

Error, (in assuming) when calling 'Student:-ODEs:-Integrate'. Received: 'The given ODE, diff(diff(phi(s),s),s)+K*cos(phi(s)) = 0, is not exact'

 

...not a clue for me


Since I know the result: Multiplying by diff(phi(x), x) to make integration work.  Q1: Are there other ways to integrate a single step without a priori knowledge?

(diff(phi(s), s))*ode

(diff(phi(s), s))*(diff(diff(phi(s), s), s)+K*cos(phi(s))) = 0

(3)

NULL

int(lhs((diff(phi(s), s))*(diff(diff(phi(s), s), s)+K*cos(phi(s))) = 0), s)+c__1 = 0

(1/2)*(diff(phi(s), s))^2+K*sin(phi(s))+c__1 = 0

(4)

Boundary condition for s = L 

Eval(diff(phi(s), s), s = L) = `&phi;'`[0]

Eval(diff(phi(s), s), s = L) = `&phi;'`[0]

(5)

(4) evaluated at the boundary

expand(map(Eval, (1/2)*(diff(phi(s), s))^2+K*sin(phi(s))+c__1 = 0, s = L))

Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)

(6)

Q2: How to simplify expression (6) with (5) using Maple commands to get this expression for the integration constant

``

c__1 = -(1/2)*`&phi;'`[0]^2-K*sin(Eval(phi(s), s = L))

c__1 = -(1/2)*`&phi;'`[0]^2-K*sin(Eval(phi(s), s = L))

(7)

Some attempts

algsubs(Eval(diff(phi(s), s), s = L) = `&phi;'`[0], Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)); applyrule(Eval(diff(phi(s), s), s = L) = `&phi;'`[0], Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)); simplify(Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L), {Eval(diff(phi(s), s), s = L) = `&phi;'`[0]}); Physics:-Substitute(Eval(diff(phi(s), s), s = L) = `&phi;'`[0], Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L))

Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)

 

Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)

 

Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)

 

Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)

(8)

``

map(`^`, Eval(diff(phi(s), s), s = L) = `&phi;'`[0], 2)

(Eval(diff(phi(s), s), s = L))^2 = `&phi;'`[0]^2

(9)

Doing it manually

isolate(subs({Eval(0, s = L) = 0, Eval((1/2)*(diff(phi(s), s))^2, {s = L}) = (1/2)*`&phi;'`[0]^2}, Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)), c__1)

c__1 = -(1/2)*`&phi;'`[0]^2-(Eval(K*sin(phi(s)), {s = L}))

(10)

or

isolate(algsubs(value(Eval(diff(phi(s), s), s = L) = `&phi;'`[0]), value(Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L))), c__1)

c__1 = -(1/2)*`&phi;'`[0]^2-K*sin(phi(L))

(11)

subs(phi(L) = Eval(phi(s), s = L), c__1 = -(1/2)*`&phi;'`[0]^2-(Eval(K*sin(phi(s)), {s = L})))

c__1 = -(1/2)*`&phi;'`[0]^2-(Eval(K*sin(phi(s)), {s = L}))

(12)

Q3: Are there ways to prevent commands evaluating Eval(phi(s), s = L)to phi(L)which might suggest incorrectly a new independent variable?

Q4: In (6), why is s = L sometimes in brackets {} ?

``

Download BVP_with_questions.mw
First 193 194 195 196 197 198 199 Last Page 195 of 2428