MaplePrimes Questions

I have a positive surface that I plot3d for bounded x- and y- value ranges. It reaches 1000 but it's mostly flat except almost at the edges of the x- and y-axes. Therefore, I inlcude view=[default,default,0..10] among the options of plot3d so that I can focus on the features of interest.

For coloring I use 'colorscheme'=["zgradient",["LightGray", "Gray", "Green"]]. However, this applies to the whole surface (up to 1000) and NOT exclusively to the viewed part as I would like to. 

Question: how to scale the zgradient so that it only applies to my "view" portion?

Note that I don't want to do this by using the 'markers' options to readjust the color splits manually, as I don't know the exact proportion and I don't want to randomly play around with different triplets until I achieve a visually satisfying result...

We see that this ode (x + y(x))*(1+diff(y(x),x)) = 0  has 2 solutions, One when (x + y(x))=0 and one when (1+diff(y(x),x))=0. Maple gives 3 solutions. They are correct but why?

Also when changing (1+diff(y(x),x)) to (a+diff(y(x),x)) now it gives only two solution.

Why does this happen? Should it not just return 2 solutions in both cases? and more strange one

(x + y(x))^2 *(1+diff(y(x), x))=0; now it gives 4 solutions. But this is no different. We also have 2 solutions. One when (x + y(x))=0 and one when (1+diff(y(x), x))=0. This time the extra two solutions are complex. 

17168

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1754 and is the same as the version installed in this computer, created 2024, June 3, 20:39 hours Pacific Time.`

ode:=(x + y(x))*(a+diff(y(x),x)) = 0;
dsolve(ode);
map(X->odetest(X,ode),[%])

(x+y(x))*(a+diff(y(x), x)) = 0

y(x) = -x, y(x) = -a*x+c__1

[0, 0]

ode:=(x + y(x))*(1+diff(y(x),x)) = 0;
dsolve(ode);
map(X->odetest(X,ode),[%])

(x+y(x))*(1+diff(y(x), x)) = 0

y(x) = -x, y(x) = -x-c__1, y(x) = -x+c__1

[0, 0, 0]

ode:= (x + y(x))^2 *(1+diff(y(x), x))=0;
dsolve(ode);
map(X->odetest(X,ode),[%])

 

(x+y(x))^2*(1+diff(y(x), x)) = 0

y(x) = -x, y(x) = -x+c__1, y(x) = -(1/2)*c__1-((1/2)*I)*3^(1/2)*c__1-x, y(x) = -(1/2)*c__1+((1/2)*I)*3^(1/2)*c__1-x

[0, 0, 0, 0]

 

 

Download why_extra_solution_from_dsolve_june_5_2024.mw

Any idea why this sometimes happens? odeadvisor says ode is quadrature but when asking it to solve it using quadrature sometimes it works and sometimes not.

Am I doing something wrong?

22020

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1754 and is the same as the version installed in this computer, created 2024, June 3, 20:39 hours Pacific Time.`

restart;

18368

Example 1 that does not work

 

ode:=diff(y(x),x)=-1;
DEtools:-odeadvisor(ode);

diff(y(x), x) = -1

[_quadrature]

sol:=dsolve(ode,y(x),['quadrature']);

"sol := "

Example 2 that works

 

ode:=diff(y(x),x)=x;
DEtools:-odeadvisor(ode);

diff(y(x), x) = x

[_quadrature]

sol:=dsolve(ode,y(x),['quadrature']);

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

 

 

Download sometimes_dsolve_works_on_quadrature_june_5_2024.mw

Dear all

I have a data, how can I study this data using N-soft set : Normalized the data, membership function, analyse the risk, ..... compute the risk, interpret the results

Cancer_patient.xlsx

N_soft_set.mw

Thank you for your help

Maybe someone get the code working ?
 

with(plots):
with(VectorCalculus):

# Example 1: Vector Field and Visualization
V := [x, y, z]:
print("Vector Field V:", V):
fieldplot3d([V[1], V[2], V[3]], x = -2..2, y = -2..2, z = -2..2, arrows = slim, title = "Vector Field in 3D"):

# Example 2: Tangent Vector to a Curve
curve := [cos(t), sin(t), t]:
print("Curve:", curve):
tangent := diff(curve, t):
print("Tangent Vector:", tangent):
plot3d([cos(t), sin(t), t], t = 0..2*Pi, labels = [x, y, z], title = "Curve in 3D"):

# Example 3: Curvature of a Surface
u := 'u': v := 'v':
surface := [u, v, u^2 - v^2]:
print("Surface:", surface):

# Compute the first fundamental form
ru := [diff(surface[1], u), diff(surface[2], u), diff(surface[3], u)]:
rv := [diff(surface[1], v), diff(surface[2], v), diff(surface[3], v)]:
E := ru[1]^2 + ru[2]^2 + ru[3]^2:
F := ru[1]*rv[1] + ru[2]*rv[2] + ru[3]*rv[3]:
G := rv[1]^2 + rv[2]^2 + rv[3]^2:
firstFundamentalForm := Matrix([[E, F], [F, G]]):
print("First Fundamental Form:", firstFundamentalForm):

# Compute the second fundamental form
ruu := [diff(surface[1], u, u), diff(surface[2], u, u), diff(surface[3], u, u)]:
ruv := [diff(surface[1], u, v), diff(surface[2], u, v), diff(surface[3], u, v)]:
rvv := [diff(surface[1], v, v), diff(surface[2], v, v), diff(surface[3], v, v)]:
normal := CrossProduct(ru, rv):
normal := eval(normal / sqrt(normal[1]^2 + normal[2]^2 + normal[3]^2)):
L := ruu[1]*normal[1] + ruu[2]*normal[2] + ruu[3]*normal[3]:
M := ruv[1]*normal[1] + ruv[2]*normal[2] + ruv[3]*normal[3]:
N := rvv[1]*normal[1] + rvv[2]*normal[2] + rvv[3]*normal[3]:
secondFundamentalForm := Matrix([[L, M], [M, N]]):
print("Second Fundamental Form:", secondFundamentalForm):

# Compute the Christoffel symbols
# Ensure DifferentialGeometry package is loaded
with(DifferentialGeometry):
DGsetup([u, v], N):
Gamma := Christoffel(firstFundamentalForm):
print("Christoffel Symbols:", Gamma):

# Visualize the surface
plot3d([u, v, u^2 - v^2], u = -2..2, v = -2..2, labels = [u, v, z], title = "Saddle Surface in 3D"):

 

I was about to convert -1 to exp(I*Pi).

First try by intuition

convert(-1, exp);
                               -1

False intuition. Next try by right click on -1 and consulting the context pannel: -> nothing that rings a bell

Entering a complex number 0.5000000001 + 0.8660254037*I to see if that changes something

-> something but no exponential form
                          

Next: AI assitant

->   OK, I know this. -> refine query

Polar, of course!

convert(-1, polar);
                          polar(1, Pi)

Not what I want. Maybe

convert(convert(-1, polar), exp);
                               -1

Next -> Ask for help in MaplePrimes whether there is a command

In relation to my comment below:
https://www.mapleprimes.com/questions/238277-Robustness-Of-Plotevalsomething#comment301920 (whose my worksheet rho-analysis_mmcdara_Gammapositive_MaPal.mw builds on the Sturm's analysis of @mmcdara)

I would like to better understand how to isolate/pin down the 4 real roots whose existence was confirmed by Sturm's analysis. To do so, @acer suggested to look into RootFinding:-Parametric: rho-analysis_acc(1).mw
Questions:

  1. Why the plot doesn't change if I also include -1<rho and rho<1 among the equations to solve? I understood that regions 1, 4 and 5 have 0 solutions anyway but if I add the constraints on rho I should expect 2 regions instead of 5, right?

  2. I don't understand SampleSolutions(m,2)=0.56 and SampleSolutions(m,3)=0.51 (even after reading help page). How are these numeric values found?

  3. Looking at the big picture, how to reconcile this CellPlot with A) my plot3d of Eq in https://www.mapleprimes.com/questions/238277-Robustness-Of-Plotevalsomething#comment301920 and B) @mmcdara Sturm's analysis. I am having a hard time putting all together.

    Thank you. 

    EDIT: I formulated this question by branching out from my comment 
    https://www.mapleprimes.com/questions/238277-Robustness-Of-Plotevalsomething#comment301920 in the corresponding thread. If inappropriate, please help me migrate this question as appropriate. 

I tried to solve a hogher order ODE system to reduce first order ODE sytem. In this case I have assume a initial conditions as a variable. (sse the attachment, Conver_to_first_order.mw).

I got an error in specification of initial value...

How can I solve this problem in RKF45 method with shooting technique.

Here, I have assume f=x[1], f'=x[2]. f''=x[3], f'''=x[3]' and theta=x[4], theta'=x[5], theta''=x[5]'

I try to dot product 2 vector that contain time derivative

the answer should be v . u_rho = rhodot

but Maple doesn't give me a proper answer. What should i do?

kind regard

restart;

with(LinearAlgebra);

with(Typesetting);
Settings(typesetprime = true);
Settings(typesetdot = true);

v := <diff(rho(t), t)*cos(theta(t)) - rho(t)*diff(theta(t), t)*sin(theta(t)), diff(rho(t), t)*sin(theta(t)) + rho(t)*diff(theta(t), t)*cos(theta(t)), diff(z(t), t)>

u_rho := <cos(theta(t)), sin(theta(t)), 0>

v . u_rho

Any one could find why Maple 2024 gives Error, (in evalf/int) invalid arguments on this ode? Why is it even calling evalf in first place as this is all symbolic.

Also reported to Maplesof just in case.

25504

restart;

25504

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1752 and is the same as the version installed in this computer, created 2024, May 31, 18:17 hours Pacific Time.`

ode:=diff(y(x), x)^3 = (x - 2)^2;
ic:=y(2)=1;
Student:-ODEs:-ODESteps([ode,ic]);

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

y(2) = 1

Error, (in evalf/int) invalid arguments

dsolve([ode,ic])

y(x) = 1+(1/5)*(3*x-6)*RootOf(_Z^3-x^2+4*x-4)

DEtools:-odeadvisor(ode)

[_quadrature]

 

 

Download odetest_internal_error_evalf_int_june_3_2024.mw

Probably I am missing the obvious. In the attached worksheet the for statement gives me all results as desired but if I try to put this in a procedure I only get the last value. Could someone help me out. Thank you  ProcQuestion.mw

I wanted to do 

map(X->odetest(X,ode) assuming x>0,[sol]) 

where sol are the solutions I wanted to test. The above does not work as is. After some trial and errors, I found this works

map(X->[odetest(X,ode) assuming x>0],[sol]) 

I am not sure why. But it works. Is this the above the correct way to add assuming to a command inside Map? Or is there a different way or better way to do this?

I want to stick to the map command as above and nothing else such as ~ or some other ones. I find map more clear to use for me.

Here is worksheet.

9592

restart;

9592

ode:=x = diff(y(x), x)*sqrt(1 + diff(y(x), x)^2);

x = (diff(y(x), x))*(1+(diff(y(x), x))^2)^(1/2)

sol:=dsolve(ode);
map(X->[odetest(X,ode) assuming x>0],[sol])

y(x) = ((1/32)*I)*2^(1/2)*(-(256/3)*Pi^(1/2)*2^(1/2)*x^3*cosh((3/2)*arcsinh(2*x))-8*Pi^(1/2)*2^(1/2)*(-(64/3)*x^4-(8/3)*x^2+2/3)*sinh((3/2)*arcsinh(2*x))/(4*x^2+1)^(1/2))/Pi^(1/2)+c__1, y(x) = -((1/32)*I)*2^(1/2)*(-(256/3)*Pi^(1/2)*2^(1/2)*x^3*cosh((3/2)*arcsinh(2*x))-8*Pi^(1/2)*2^(1/2)*(-(64/3)*x^4-(8/3)*x^2+2/3)*sinh((3/2)*arcsinh(2*x))/(4*x^2+1)^(1/2))/Pi^(1/2)+c__1, y(x) = Int(-(1/2)*(-2+2*(4*x^2+1)^(1/2))^(1/2), x)+c__1, y(x) = Int((1/2)*(-2+2*(4*x^2+1)^(1/2))^(1/2), x)+c__1

[[(1/2)*(2*x*(4*x^2+1)^(1/2)+(-8*x^2*cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+16*x^3*sinh((3/2)*arcsinh(2*x))-cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+4*sinh((3/2)*arcsinh(2*x))*x)*(-2+2*(4*x^2+1)^(1/2))^(1/2))/(4*x^2+1)^(1/2)], [-(1/2)*(-2*x*(4*x^2+1)^(1/2)+(-8*x^2*cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+16*x^3*sinh((3/2)*arcsinh(2*x))-cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+4*sinh((3/2)*arcsinh(2*x))*x)*(-2+2*(4*x^2+1)^(1/2))^(1/2))/(4*x^2+1)^(1/2)], [2*x], [0]]

for item in [sol] do
    odetest(item,ode) assuming x>0;
od;

(1/2)*(2*x*(4*x^2+1)^(1/2)+(-8*x^2*cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+16*x^3*sinh((3/2)*arcsinh(2*x))-cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+4*sinh((3/2)*arcsinh(2*x))*x)*(-2+2*(4*x^2+1)^(1/2))^(1/2))/(4*x^2+1)^(1/2)

-(1/2)*(-2*x*(4*x^2+1)^(1/2)+(-8*x^2*cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+16*x^3*sinh((3/2)*arcsinh(2*x))-cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+4*sinh((3/2)*arcsinh(2*x))*x)*(-2+2*(4*x^2+1)^(1/2))^(1/2))/(4*x^2+1)^(1/2)

2*x

0

 

 

Download how_to_use_map_with_assuming.mw

These  are good example(s)  why I think Maple's simplify needs to be improved. 

Example 1

Given an expression which is zero for nonnegative x, one would expect simplify to simplify it to zero when told that x is positive. 

But nothing I tried with simplify worked. combine  figured it out.

But why? Is this not the job of simplify? 

The expression is 

e:=x-1/4*(-2+2*(4*x^2+1)^(1/2))^(1/2)*(2+2*(4*x^2+1)^(1/2))^(1/2);

Here is worksheet

``

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

restart;

28000

e:=x-1/4*(-2+2*(4*x^2+1)^(1/2))^(1/2)*(2+2*(4*x^2+1)^(1/2))^(1/2);

x-(1/4)*(-2+2*(4*x^2+1)^(1/2))^(1/2)*(2+2*(4*x^2+1)^(1/2))^(1/2)

coulditbe(e=0);

true

#we see it is zero for x>=0
plot(e,x=-3..3)

simplify(e) assuming x>=0;

x-(1/4)*(-2+2*(4*x^2+1)^(1/2))^(1/2)*(2+2*(4*x^2+1)^(1/2))^(1/2)

simplify(e,size) assuming x>=0;

x-(1/4)*(-2+2*(4*x^2+1)^(1/2))^(1/2)*(2+2*(4*x^2+1)^(1/2))^(1/2)

expand(e) assuming x>=0;

x-(1/4)*(-2+2*(4*x^2+1)^(1/2))^(1/2)*(2+2*(4*x^2+1)^(1/2))^(1/2)

simplify(e,sqrt) assuming x>=0;

x-(1/4)*(-2+2*(4*x^2+1)^(1/2))^(1/2)*(2+2*(4*x^2+1)^(1/2))^(1/2)

simplify(e,symbolic) assuming x>=0;

x-(1/4)*(-2+2*(4*x^2+1)^(1/2))^(1/2)*(2+2*(4*x^2+1)^(1/2))^(1/2)

combine(e) assuming x>=0;

0


Compare some other software on this same problem

It should be as simple as the above in Maple.

A user should not have to try 100 different commands in Maple to find which works.

simplify should have done it in first place. What Am I overlooking here?

Maple 2024

Download why_simplify_do_not_work_example.mw

EXAMPLE 2

In this example the expression is zero for x<0. Here nothing worked for me. This is challenge for Maple experts here to find the command to simplify this to zero. 

I know it is zero for x<0.

e := -1/2*(-2*x*sqrt(4*x^2 + 1) + (16*x^3*sinh(3/2*arcsinh(2*x)) - 8*x^2*cosh(3/2*arcsinh(2*x))*sqrt(4*x^2 + 1) + 4*sinh(3/2*arcsinh(2*x))*x - cosh(3/2*arcsinh(2*x))*sqrt(4*x^2 + 1))*sqrt(-2 + 2*sqrt(4*x^2 + 1)))/sqrt(4*x^2 + 1)


 

24064

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1752 and is the same as the version installed in this computer, created 2024, May 31, 18:17 hours Pacific Time.`

e:=-1/2*(-2*x*sqrt(4*x^2 + 1) + (16*x^3*sinh(3/2*arcsinh(2*x)) - 8*x^2*cosh(3/2*arcsinh(2*x))*sqrt(4*x^2 + 1) + 4*sinh(3/2*arcsinh(2*x))*x - cosh(3/2*arcsinh(2*x))*sqrt(4*x^2 + 1))*sqrt(-2 + 2*sqrt(4*x^2 + 1)))/sqrt(4*x^2 + 1);

-(1/2)*(-2*x*(4*x^2+1)^(1/2)+(16*x^3*sinh((3/2)*arcsinh(2*x))-8*x^2*cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+4*sinh((3/2)*arcsinh(2*x))*x-cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2))*(-2+2*(4*x^2+1)^(1/2))^(1/2))/(4*x^2+1)^(1/2)

plot(e,x=-10..3);

coulditbe(e=0)

true

simplify(e) assuming x<0;

-8*((cosh((3/2)*arcsinh(2*x))*(-(1/2)*x^2-1/16)*(4*x^2+1)^(1/2)+sinh((3/2)*arcsinh(2*x))*x*(x^2+1/4))*(-2+2*(4*x^2+1)^(1/2))^(1/2)-(1/8)*x*(4*x^2+1)^(1/2))/(4*x^2+1)^(1/2)

simplify(e,symbolic) assuming x<0;

-8*((cosh((3/2)*arcsinh(2*x))*(-(1/2)*x^2-1/16)*(4*x^2+1)^(1/2)+sinh((3/2)*arcsinh(2*x))*x*(x^2+1/4))*(-2+2*(4*x^2+1)^(1/2))^(1/2)-(1/8)*x*(4*x^2+1)^(1/2))/(4*x^2+1)^(1/2)

combine(e) assuming x<0;

-(1/2)*(-2*x*(4*x^2+1)^(1/2)+(16*x^3*sinh((3/2)*arcsinh(2*x))-8*x^2*cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+4*sinh((3/2)*arcsinh(2*x))*x-cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2))*(-2+2*(4*x^2+1)^(1/2))^(1/2))/(4*x^2+1)^(1/2)

simplify(e,arctrig) assuming x<0;

-8*((cosh((3/2)*arcsinh(2*x))*(-(1/2)*x^2-1/16)*(4*x^2+1)^(1/2)+sinh((3/2)*arcsinh(2*x))*x*(x^2+1/4))*(-2+2*(4*x^2+1)^(1/2))^(1/2)-(1/8)*x*(4*x^2+1)^(1/2))/(4*x^2+1)^(1/2)

simplify(e,sqrt) assuming x<0;

-8*((cosh((3/2)*arcsinh(2*x))*(-(1/2)*x^2-1/16)*(4*x^2+1)^(1/2)+sinh((3/2)*arcsinh(2*x))*x*(x^2+1/4))*(-2+2*(4*x^2+1)^(1/2))^(1/2)-(1/8)*x*(4*x^2+1)^(1/2))/(4*x^2+1)^(1/2)

simplify(normal(e),sqrt) assuming x<0;

-8*((cosh((3/2)*arcsinh(2*x))*(-(1/2)*x^2-1/16)*(4*x^2+1)^(1/2)+sinh((3/2)*arcsinh(2*x))*x*(x^2+1/4))*(-2+2*(4*x^2+1)^(1/2))^(1/2)-(1/8)*x*(4*x^2+1)^(1/2))/(4*x^2+1)^(1/2)

simplify(normal(e, expanded)) assuming x<0;

-8*((cosh((3/2)*arcsinh(2*x))*(-(1/2)*x^2-1/16)*(4*x^2+1)^(1/2)+sinh((3/2)*arcsinh(2*x))*x*(x^2+1/4))*(-2+2*(4*x^2+1)^(1/2))^(1/2)-(1/8)*x*(4*x^2+1)^(1/2))/(4*x^2+1)^(1/2)

simplify(radnormal(e)) assuming x<0;

(1/8)*((4*x^2+(4*x^2+1)^(1/2)+1)*(-2+2*(4*x^2+1)^(1/2))-64*x*((1/2)*cosh((3/2)*arcsinh(2*x))*(-1/8-x^2)*(4*x^2+1)^(1/2)+sinh((3/2)*arcsinh(2*x))*x*(x^2+1/4))*(-2+2*(4*x^2+1)^(1/2))^(1/2))/((4*x^2+1)^(1/2)*x)

simplify(evala(e)) assuming x<0;

-8*((cosh((3/2)*arcsinh(2*x))*(-(1/2)*x^2-1/16)*(4*x^2+1)^(1/2)+sinh((3/2)*arcsinh(2*x))*x*(x^2+1/4))*(-2+2*(4*x^2+1)^(1/2))^(1/2)-(1/8)*x*(4*x^2+1)^(1/2))/(4*x^2+1)^(1/2)

 


Using some other software gives

I'd like to find command to do the same in Maple. i.e. simplify it to zero. What else to try?

 

Download why_simplify_do_not_work_example_2.mw

I think I found another problem with odetest.  When solution is implicit, it fails to verify the solution against the ode when adding the IC. (not everytime, but in some cases).

But it does verify the solution against the ode when IC is not given. I give 3 examples.  Also at bottom is worksheet of all of this.

Example 1

restart;

ode:=diff(y(x), x) = sin(y(x));
ic:=y(0)=Pi/2;
mysol:=ln(tan(y(x)/2))=x;

It says solution satisfies the ode itself OK

odetest(mysol,ode);

gives 0

But adding IC now gives

odetest(mysol,[ode,ic]);

Which I am having hard time reading. Is it now saying the solution does not satisfy the ode or the IC? Both are supposed to be zero.

Are these not supposed to be in same order given? so it looks like if we go left to right, it is saying the solution do not satisfy the ode now but it does satisfy the IC. Right?

But before it said the solution satisfies the ode.

Also, we can see the IC is satisfied. Let do it by hand

eval(mysol,[y(x)=Pi/2,x=0])

              0 = 0

So why does it say solution satisfies the ode first, then when adding the IC, now it changed its mind?

Also, solving for y(x) from the implicit solution, now it verifies it OK  with the IC also:

ode:=diff(y(x), x) = sin(y(x));
ic:=y(0)=Pi/2;
mysol:=ln(tan(y(x)/2))=x;
mysol_explicit:=solve(mysol,y(x));
odetest(y(x)=mysol_explicit,[ode,ic])

          [0, 0]

You see. Same solution. But different result from odetest depending if it is implicit or explicit.

Is this supposed to happen or is this a bug in odetest I should report? odetest is supposed to handle both explicit and implicit solutions. I know my solutions are correct. I just use odetest for verification. I also plotted my solution against maple's solutions and they are exact match. 

Example 2

ode:=diff(y(x),x)=1+y(x)^2;
mysol:=arctan(y(x))=x;
ic:=y(0)=0;
odetest(mysol,ode);
odetest(mysol,[ode,ic]);

Gives 0 for the first call to odetest but gives [diff(y(x), x) - 1 - y(x)^2, 0] for the second call.

Changing the solution to explicit. now it verifies it

mysol_explicit:=solve(mysol,y(x));
odetest(y(x)=mysol_explicit,[ode,ic]);

Now it gives [0,0]

Example 3

ode:=diff(y(x), x) - 2*y(x) = 2*sqrt(y(x));
ic:=y(0)=1;
mysol:=ln(sqrt(y(x))+1)=x+ln(2);
odetest(mysol,ode);
odetest(mysol,[ode,ic]) assuming positive;

Gives for the first call but  [diff(y(x), x) - 2*y(x) - 2*sqrt(y(x)), 0] but when using explicit it now verifies OK

mysol_explicit:=solve(mysol,y(x));
odetest(y(x)=mysol_explicit,[ode,ic]) assuming positive;

           [0, 0]

Maple 2024 on windows 10

23112

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1751 and is the same as the version installed in this computer, created 2024, May 31, 18:17 hours Pacific Time.`

Example 1

 

restart;

18420

ode:=diff(y(x), x) = sin(y(x));
ic:=y(0)=Pi/2;
mysol:=ln(tan(y(x)/2))=x;
odetest(mysol,ode);

diff(y(x), x) = sin(y(x))

y(0) = (1/2)*Pi

ln(tan((1/2)*y(x))) = x

0

odetest(mysol,[ode,ic]);

[diff(y(x), x)-sin(y(x)), 0]

mysol:=ln(tan(y(x)/2))=x;
mysol_explicit:=solve(mysol,y(x));
odetest(y(x)=mysol_explicit,[ode,ic]);

ln(tan((1/2)*y(x))) = x

2*arctan(exp(x))

[0, 0]

Example 2

 

ode:=diff(y(x),x)=1+y(x)^2;
mysol:=arctan(y(x))=x;
ic:=y(0)=0;
odetest(mysol,ode);

diff(y(x), x) = 1+y(x)^2

arctan(y(x)) = x

y(0) = 0

0

odetest(mysol,[ode,ic]);

[diff(y(x), x)-1-y(x)^2, 0]

mysol_explicit:=solve(mysol,y(x));
odetest(y(x)=mysol_explicit,[ode,ic]);

tan(x)

[0, 0]

Example 3

 

ode:=diff(y(x), x) - 2*y(x) = 2*sqrt(y(x));
ic:=y(0)=1;
mysol:=ln(sqrt(y(x))+1)=x+ln(2);
odetest(mysol,ode);

diff(y(x), x)-2*y(x) = 2*y(x)^(1/2)

y(0) = 1

ln(y(x)^(1/2)+1) = x+ln(2)

0

odetest(mysol,[ode,ic]) assuming positive;

[diff(y(x), x)-2*y(x)-2*y(x)^(1/2), 0]

mysol_explicit:=solve(mysol,y(x));
odetest(y(x)=mysol_explicit,[ode,ic]) assuming positive;

(2*exp(x)-1)^2

[0, 0]

 

 

Download odetest_implicit_problem_june_2_2024.mw

Simple question. I hope it has simple answer. I have always thought that what int() returns should match exactly what "default" result shows when using int() with the option _RETURNVERBOSE 

I mean exact match. But this below shows that int() result underwent some simplification as it is not the same as default.

restart;

integrand:=sin(x)/(sin(x) + 1);
maple_result_1 :=int(integrand,x);
maple_result_2 := int(integrand,x,'method'=':-_RETURNVERBOSE')[1]

Ofcourse maple_result_2 can be made the same as maple_result_1

simplify(rhs(maple_result_2)) assuming 0<x and x<Pi;

But this is beside the point. Why is "default" is not excatly the same as int() result?  It seems that int() does something more after obtaining the :"default" result as shown.

Should default not match exactly result from int() ?

Maple 2024.

 

First 99 100 101 102 103 104 105 Last Page 101 of 2426