MaplePrimes Questions

In this worksheet the solve command almost immediately gives up and DirectSearch[SolveEquations] is erratic.

For some triangle/inellipse points of tangency the latter provides a nonsense answer and for others it produces an almost correct solution.

Is there a set of conditions which determine the possibility of an inellipse within a triangle?

Inellipse.mw

A responder will have to establish a connection to the DirectSearch package.

Hi, 

Here is my first attempt to work with Embedded Components.
I loaded the "Bezier curve" example ("how to drag points") and the "Linear Regression" one ("how to add points") from the MathApps, merge the codes and modified them in order to draw a polygon with an arbitrary number of sides.

After many unsuccessful attempts I begin to understand the mogic behind Embedded Components (I'm familiar with Maplets and I'm sure this didn't help me).
For now , I am able to define points, drag them, and erase everything. A small step for Mankind but a huge step for me.

What I would like to do now is to erase some points.
The basic code is 

# Plot1 is the PlotComponent
# The list of the points is pt
#
# x0 and y0 are the co-ordinates of the point to remove from pt
# _removing is the number of the point in pt closest to (x0, y0)
#
# Update is the procedure which does the plot in Plot1

Remove := proc()
     x0 := DO(%Plot1( "clickx" ) );
     y0 := DO(%Plot1( "clicky" ) );
     d := map(n -> add((pt[n]-~[x0, y0])^~2), [$1..nops(pt)]):
     _removing := sort(d, output=permutation)[1];
     subsop(_removing=NULL, pt);
     Update();
end proc;

Unfortunately I don't understand well enough the logic of  Embedded Components to make this work

Can you help me fix this?
TIA

sketch.mw

PS: In procedure Update I define two plots named fond (=background) and grille (=grid): grille is a workaround to "toggle gridlines" or 'gridlines'=true for none of these options work for me (Maple 2015.2, Mac OSX Mojave)

Hi,

I have have been trying to creat a slider and use the value as a "variable" to vary the sin function..

I tried many things and can't seem to get iit to work...any suggestions woul be appreciated..I am still brand new to Maple

I have searched Application center..and spend hours trying to get this right...I am attacing my worksheet

Thanks for your help!

Frank

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/CreatingSlider.mw .
 

Download CreatingSlider.mw

Just in case the worksheet won't work I am attaching a jpeg

To my knowledge, I think it should return 'true'. But in this case and many other similar cases, it returns 'false'. Sometimes after rebooting my laptop it gives 'true'. This made me crazy. Please help!

X

Y

z

19.8

12

1.62

24.7

14

1.2

26

16

1.25

35.1

20

0.84

37.8

20.83

0.74

10.8

9

3.98

16.1

12

2.46

38.3

18

0.52

24.5

16

1.42

15.8

11

2.35

28.2

17.8

1.19

56.8

27

0.37

25.4

17

1.34

29.3

18.1

1.12

 

How to plot the (x,y,z) points on 3d plot like first point is (19.8,12,1.62) like that in order

and connect all the ponts above as a line

 

Kind help your help will be acknowleged

IN FIBONACCI RABBIT PROBLEM, SUPPOSE ONLY 3/4 (PROPORTION) OF FEMALES BECOME PREGNANT THEN HOW TO DETERMINE THE ANNUAL RATE OF INCREASE IN RABBITS?

restart:
with(plots):
kernelopts(version);
 

How do I setup solve to find only the real and imaginary part of Zeta to be both positive and the real part of Zeta to be the smallest positive value? For example: real part = 1.348412872 and imaginary part = 0.04230725448.

Acceleration ratio (db) and phase (deg). Convert ratio to linear and phase to radian. 
dat := <14.52407334|-162.1310124>:
A := 10^(dat[1]/20.):
phi := dat[2]*Pi/180.:
R:= 0.3036:
Characteristic equation Eqn 5
f := (Zeta,A,phi) -> cos(Zeta) - R * Zeta * sin(Zeta) - exp(-phi * I)/A:

soln := [solve(f(Zeta,A,phi), Zeta)]:
 

Tests.mw

Hi MaplePrimes team,

 

I am aware that Maple is not designed for CAD and I am not here for you to help me build any advanced system like the example below.

 

Figure 1: Trimmed surface of fuselage to create airplane windows.

 

Here I my problem. Even using the adaptmesh option, creating serious trimmed surfaces requires large numbers of grids like for example [3000, 3000] and even beyond, which makes a mesh unnecessary on most of the surface and especially where we don’t need high resolution.

While if we limit the display volume with the Maple’s view command (view = [x1..x2, y1..y2, z1..z2]), the edges are always smooth regardless of the coordinates system or the type of mesh of the surface to be treated.

 

And so, the reason I’m writing this message is to ask you why creating trimmed surface with plot3d surface wouldn’t use Maple view’s algorithm to get smooth edges?

 

Future Alternative Solution:

I also take this opportunity to ask you when would it be possible to update the Maple’s grid option such that the point space will variable in term of surface variable. For example:

plot3d(<x(s,t), y(s,t), z(s,t)>, s = s1..s2, t = t1..t2, grid = [m(s,t), n(s,t)] )

 

I am sure that this solution, which for me does not seem to be difficult to implement, could be an alternative to enrich the mesh where we really need it and therefore a better control. What do you think?

 

Thank you in advance.

 

Best.

 

Guy.

Hello everybody – It looks like there is a bug in the numerical evaluation of (multiple) Zeta function. Take for instance, Zeta(3, 0.5) which is approximately 8.4144. Maple gives approximaterly -96.0033. Is there a bug somewhere?

Thank you

Textbook gives this nice short implicit solution for this ode

As

But Maple does not give an implicit solution

restart;
ode:=diff(y(x),x) = 2*(2*y(x)-x)/(x+y(x));
ic:=y(0)=2;
sol:=dsolve([ode,ic],'implicit')

Removing implicit gives very complicated solution as it tries to solve for y(x).

book_sol:=(x-y(x))^2-1/2*(y(x)-2*x)^3=0;
odetest(book_sol,[ode,ic])

Any suggestion or a trick or a different approach to make Maple generate the same solution given in the textbook?

ps. manually, it is possible to obtain the same solution as book as follows

restart;
ode:=diff(y(x),x) = 2*(2*y(x)-x)/(x+y(x));
ic:=y(0)=2;
sol:=dsolve(ode,'implicit');
sol:=simplify(exp(lhs(sol))=exp(rhs(sol)));
the_constant:=solve(sol,_C1);
the_constant:=eval(the_constant,[y(x)=2,x=0]);
sol:=eval(sol,_C1=the_constant);
odetest((lhs-rhs)(sol)=0,[ode,ic])

 

edit june 14,2021

I found a direct way to get an implicit solution which is close enough to book solution. It is by using Lie symmetry method

restart;
ode:=diff(y(x),x) = 2*(2*y(x)-x)/(x+y(x));
ic:=y(0)=2;
sol:=dsolve([ode,ic], y(x),'implicit','Lie');

Another variant which gives book solution but requires one extra step

restart;
ode:=diff(y(x),x) = 2*(2*y(x)-x)/(x+y(x));
ic:=y(0)=2;
sol:=dsolve([ode,ic], y(x),'implicit','Lie',way=all,fat);
simplify(exp( (lhs-rhs)(sol)))=1

ps. corrected above now, thanks to comment below by Carl.

Maple 2021.1

 

 

 

Hi, I need to count elements in an indexed set. The below commands gives 3, as it doesn't take the powers into consideration (u[1,2,2]^3). Desired output is 5, meaning to count 1 three times.
       

with(ListTools):
>C:=x*u[]*u[1,2,2]^3*u[1,1,2];
>indx_set:=(`[]`@ op)~(indets(C, indexed));
indx_set := {[], [1, 1, 2], [1, 2, 2]}
>indx_set:=Flatten(convert(indx_set,list));
 indx_set := [1, 1, 2, 1, 2, 2]
>indx1:=[SearchAll(1,indx_set)];
[1, 2, 4]
>num:=nops(indx1);
3

Thanks

Hello there, 

Would you allow me to ask this one question?

What is the difference between 'map' and '~(element-wise operation)'?

The following worksheet snipped shows an example:



Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/Q20210612.mw .
 

I thought that both operations were the same, but seemingly they are not. 

Best Regards, 

In Kwon Park 

Download Q20210612.mw

In worksheet mode, when typing only the first 3 letters of the command piecewise, the command completion popup shows and I can hit TAB to have it automatically complete which is nice since I always makes typos tying this command

  >pie

When when I wanted to get help on the same command, I have to type 5 letters now before the popup shows to help me complete the command

 >?piece

Why is that? I would have expected the same 3 letters to be enough, as I assume Maple is smart enough to notice this.

Here is a movie to illustrate. This is Maple 2021.1 on windows 10

   

Hi!

Assume we have the following mappings:

 

f[1] := proc (x) options operator, arrow; piecewise(0 <= t and t <= 1/2, (1/2)*x(2*t), 1/2 < t and t <= 1, (1/2)*x(2*t-1)+1/2) end proc

 

f[2] := proc (x) options operator, arrow; t*x(t) end proc

 

 Note that the argument are mappings (i.e, x(t) is a continuous function defined on [0,1]). Given an array with values in {1,2}, for instance [1,1,2],and a function h (say, h:=t->t) How can we define the composition mapping f[1]f[1]f[2](h)?

In general, I want to plot the composition mapping f[i1]f[i2]...f[iN](h), i1,i2,...,iN being 1 or 2 and h a given continuous function defined on [0,1]

 

Many thanks in advance for your comments.

 

 

I have a list of objects. Each object contains many fields, one of these fields happened to be a solution to an ode.

At the end of solving the ODE, I'd like to remove all objects which contain the same solution. 

I can not do the normal trick in Maple to remove duplicates from a list, which is to convert the list to a set and let Maple automatically remove duplicates because in this case each entry in the list is an object of many fields and hence each object is always different. 

I only want to remove the objects from the list which has the same specific field.

Currently what I do is the following:   Do a first scan, and loop over all entries in the list to find the duplicates. Each time I find a duplicate solution, mark a field in the object as it is being duplicate.

Then do another scan at the end, to build a new list, which only adds those objects not marked as duplicates.

It works, but was wondering if Maple or someone might have better suggestion or more elegent way to do this.

In this MWE I am using a list and adding objects to it making it grow dynamically. I know it would be better to use Array, but for now I'd like to stick to a list, since the number of solutions is normally small. May be in the future I will change the list to Array to avoid building a list dynamically.

This example code builds a list of 5 objects

restart;
ode_solution_type:=module()
    option object;
    export sol:=NULL; #only ONE solution here.  
    export stuff;
    export mark_to_delete:=false;
end module:

SOL::list:=[]:  #where to keep the objects

for n from 1 to 5 do
    tmp:=Object(ode_solution_type);
    
    if n=3 then
        tmp:-sol:=y(x)=1;
    else
       tmp:-sol:=y(x)=0;
    fi;
    tmp:-stuff:=rand();
    SOL:=[op(SOL),tmp];
od:

In the above, I made 4 objects to have same solution which is y(x)=0 and one different. The goal is to remove all objects from the list which has duplicate solutions and keep only one copy.

for n from 1 to numelems(SOL) do
    print("sol ", n , "  is ", SOL[n]:-sol);  
od:

And this is how currently I remove the duplicates

for n from 1 to numelems(SOL) do
    for m from n+1 to numelems(SOL) do
        if is(SOL[n]:-sol=SOL[m]:-sol) and not SOL[m]:-mark_to_delete then
           print("found duplicate at ",m);
           SOL[m]:-mark_to_delete:=true;
        fi;
    od;    
od:

#now make new pass to keep the non- duplicates
new_SOL::list:=[]:
for n from 1 to numelems(SOL) do
    if not SOL[n]:-mark_to_delete then
       new_SOL:=[op(new_SOL),SOL[n]];
    fi;    
od:

checking:

for n from 1 to numelems(new_SOL) do
    print("sol ", n , "  is ", new_SOL[n]:-sol);  
od:

Does there exist a better option in Maple (while still using a list?) to remove objects in list which have the same specific field?

Could you suggest a better method?

First 385 386 387 388 389 390 391 Last Page 387 of 2416