MaplePrimes Questions

Please, how do plot the contour plot of im(qq) vs Re(qq) from the list below: 

qq= [2.106333379+.6286420119*I, 2.106333379-.6286420119*I, 4.654463885, 7.843624703, 10.99193295, 14.13546782, 17.27782732, 20.41978346, 23.56157073, 26.70327712, 29.84494078, 32.98658013, 36.12820481, 39.26982019, 42.41142944, 45.55303453, 48.69463669, 51.83623675, 54.97783528, 58.11943264, 61.26102914]

How does one compute the location of the minimum algebraically (rather than numerically) of the following expression:
F:=((z^2+(z^2+2*z+2)^(1/2)*(z^2+1)^(1/2)+z+1)^(1/2)*(-z^2+(z^2-2*z+2)^(1/2)*(z^2+1)^(1/2)+z-1)^(1/2)-(z^2+(z^2-2*z+2)^(1/2)*(z^2+1)^(1/2)-z+1)^(1/2)*(-z^2+(z^2+2*z+2)^(1/2)*(z^2+1)^(1/2)-z-1)^(1/2)+2*z)/(2*z^2+2);

Write a Maple procedures called “biggest4” and “smallest4” to find
a) the biggest
b) the smallest
of the given numbers  a = -1/3, b = 0, c = 7/3, d = -2

i guess i need to use end proc for programing but i dont understand:

I have set of graphs say with names

Graph1,Graph2,..., Graph50.

1) I want to print all these using a single for.

2) I want to check the Isomorphic property of which two are all Isomorphic pairwise using a for loop say 

Or if any other methods kind help with suitable advice.

i need to use two different methods to solve the initial value problem. I tried but didnt find the answer 

y" + 4y' + 4y = sin(x), y(0) = 1 , y'(0) = 0

y" + 4*diff(y(x), x) + 4*y(x) = sin(x)

dsys1 := {diff(y(x), x, x) + diff(y(x), x) + 4*y(x) = sin(x), y(0) = 1, D(y)(0) = 0};
dsol1 := dsolve(dsys1, numeric, method = gear);
dsol1(0);

 y = ax^3 + bx^2 + cx + d this is curve and is passing through the points (−1,−4),(1,0),(2,0),(3,−4).
1) Find the values of 𝑎,𝑏,𝑐 and 𝑑.
2) Plot the curve and the points given on the same axis.

I tried solving with derivative of the curve but i didnt find the exact values.

I need to make my base class local variable static, so that when extending the class, the subclass will share these variable and use their current values as set by the base class. If I do not make them static, then the base class when extended, will get fresh instance of these variable, losing their original values, which is not what I want.

To do this, one must make the base class variables static

This works, but now I do not know the syntax where to put the type on the variable. 

I can't write   local m::integer::static; nor local m::static::integer;

I could only write local m::static; but this means I lost the ability to have a type on the variable and lost some of the type checking which is nice to have in Maple. From Maple help:

 

Here is example

restart;

base_class:=module()
  option object;
  local n::static;  #I want this type to ::integer also. But do not know how

  export set_n::static:=proc(_self,n::integer,$)
     _self:-n := n;
  end proc;
  
  export process::static:=proc(_self,$)
    local o;
    o:=Object(sub_class);
    o:-process();
  end proc;
end module;    

sub_class:=module()
   option object(base_class);
   process:=proc(_self,$)
      print("in sub class. _self:-n = ",_self:-n);
   end proc;
end module;

o:=Object(base_class);
o:-set_n(10);
o:-process()


            "in sub class. _self:-n = ", 10

The above is all working OK. I just would like to make n in the base class of type ::integer as well as ::static

Is there a syntax for doing this?

 

Could any one please guide me how to show this solution by using Newton Raphson method. I need to show this solution step by step as shown in example.

Hi Community, I have solved the some basic expression by using built in command to get solution. Now i am interested to view the solution stp by step to show  my students of grade 10.

restart

t := x^6+2*x^5-3*x+2+(2*x^6-4*x+8)

3*x^6+2*x^5-7*x+10

(1)

p := 2*x^2-x-10

2*x^2-x-10

(2)

factor(p)

(x+2)*(2*x-5)

(3)

s := 2*x^2-x-10

2*x^2-x-10

(4)

solve(s = 0, {x})

{x = 5/2}, {x = -2}

(5)

sqrt(x-4) = 4

(x-4)^(1/2) = 4

(6)

solve(sqrt(x-4) = 4, {x})

{x = 20}

(7)

s := (x^2-9)/(x^2-2*x-15)

(x^2-9)/(x^2-2*x-15)

(8)

simplify(%)

(x-3)/(x-5)

(9)

(3*x^2-5*x)*(4*x^2+7*x+4)

(3*x^2-5*x)*(4*x^2+7*x+4)

(10)

expand(%)

12*x^4+x^3-23*x^2-20*x

(11)

``

Solving a system of equations:

x+2*y = 4

x+2*y = 4

(12)

3*x+4*y = 6

3*x+4*y = 6

(13)

solve({x+2*y = 4, 3*x+4*y = 6}, {x, y})

{x = -2, y = 3}

(14)

abs(3*x+3) = 12

3*abs(x+1) = 12

(15)

``

solve(abs(3*x+3) = 12, {x})

{x = 3}, {x = -5}

(16)

``

Download Help_to_view_solution_step_by_step.mw

Perhaps someone knows this. So I came across something recently and I can't recall if it was in this forum (which I can't find)

It was a value using some combinations of the constants e and Pi where the answer was very close to a whole number x.99939 or something.  The only thing I can remember is that it was exp(Pi)*...  I thought it was an answer written by Joe Riel where someone would use that to verify if the floating points... well I can't recall. 

Would anyone have an idea?

Do you know why increasing the number of applications of trapezoidal rule results infinity and imaginary part?

I want get result for Romberg Integration Method with 6 Applications of Trapezoidal Rule.

restart

with(Student[NumericalAnalysis]):

``

fff := (eta__1^2-1.)^2*(zeta__1^2-1.)^2*(-5.6584306313*10^(-8)*eta__1^4*zeta__1^4-1.0454641424*10^(-8)*eta__1*zeta__1^4+5.6161016651*10^(-9)*eta__1^3*zeta__1^4+1.0615594865*10^(-8)*eta__1^5*zeta__1^4+5.4851856568*10^(-9)*eta__1^3*zeta__1^2-1.4132765167*10^(-8)*eta__1^5*zeta__1^2-7.8157365683*10^(-7)*zeta__1*eta__1^4+2.9373057668*10^(-8)*eta__1^5*zeta__1^5-7.032574429*10^(-8)*eta__1^3*zeta__1^5-5.2577413654*10^(-8)*eta__1^5*zeta__1^3+2.3272955826*10^(-8)*eta__1^5*zeta__1+1.5782217112*10^(-7)*eta__1^3*zeta__1^3+2.1771522925*10^(-8)*eta__1*zeta__1^5-8.3051507888*10^(-8)*eta__1^3*zeta__1-2.2997952126*10^(-8)*eta__1*zeta__1^3+0.22608138853e-5*eta__1^4-0.53519692056e-5*eta__1^2+0.62041471332e-4+0.54946587424e-4*zeta__1^2-0.10412827312e-5*zeta__1^4-0.53422910417e-5*zeta__1^3+0.12053033309e-3*zeta__1-4.5961086182*10^(-8)*eta__1^2*zeta__1^4-1.6404108106*10^(-7)*zeta__1^2*eta__1-1.5606093643*10^(-7)*zeta__1*eta__1^2-4.168658171*10^(-7)*zeta__1*eta__1-0.5430102455e-5*eta__1^2*zeta__1^5+0.87015148204e-5*eta__1^2*zeta__1^3+0.25592467903e-5*eta__1^4*zeta__1^5-0.4071733639e-5*eta__1^4*zeta__1^3-0.44664222239e-5*eta__1^4*zeta__1^2+0.84495460425e-5*eta__1^2*zeta__1^2+7.5007400675*10^(-7)*zeta__1^5-6.6427826628*10^(-9)*eta__1^3+3.5821686059*10^(-9)*eta__1^5-2.4361928132*10^(-7)*eta__1)/(-0.32350168299e-2*eta__1^5-0.40854298828e-3*zeta__1^8-0.57170204466e-1*eta__1^8+.26989142602*zeta__1^7+.34307133883*eta__1^6+.14111119517*eta__1^4-0.48267577378e-1*zeta__1^9-1.082755589*eta__1^2-1.3163499567*zeta__1^2+0.75042415188e-3*eta__1^7-0.40463518464e-2*zeta__1^6+.66506159208*zeta__1^4+.58641863992*zeta__1^3-0.18089939414e-3*eta__1^9-.60151130424*zeta__1^5+0.49423587807e-2*eta__1^3-0.22768667085e-2*eta__1-.20653118433*zeta__1-.15635457174*eta__1^8*zeta__1+.64029273264*eta__1^8*zeta__1^3-1.8403657443*eta__1^6*zeta__1^7-0.48478855017e-1*eta__1^8*zeta__1^4-0.22007436935e-2*eta__1^2*zeta__1^8+0.56271163518e-2*eta__1^4*zeta__1^8-.22701198791*eta__1^6*zeta__1^6-0.18753531811e-2*eta__1*zeta__1^9+0.63616448215e-2*eta__1^3*zeta__1^9-0.70972300998e-2*eta__1^5*zeta__1^9+0.26109384594e-2*eta__1^7*zeta__1^9+0.37597513815e-2*eta__1^9*zeta__1^7-.81152175007*eta__1^8*zeta__1^5+.32758358916*eta__1^8*zeta__1^7+.60516338422*eta__1^6*zeta__1-2.7777061884*eta__1^6*zeta__1^3+3.8764153863*eta__1^6*zeta__1^5+0.14976271107e-3*eta__1*zeta__1^8+0.64408301026e-3*eta__1^3*zeta__1^8-0.17374541537e-2*eta__1^5*zeta__1^8+0.9436084324e-3*eta__1^7*zeta__1^8-0.95617026598e-3*eta__1*zeta__1^6-0.79980551762e-3*eta__1^3*zeta__1^6-0.43427014208e-2*eta__1^7*zeta__1^6+0.52833995188e-2*eta__1^5*zeta__1^6-0.39563328597e-2*eta__1^7*zeta__1^2-0.30978282387e-2*zeta__1*eta__1+3.4563944947*eta__1^2*zeta__1^5-2.669958003*eta__1^2*zeta__1^3-5.9197768267*eta__1^4*zeta__1^5+4.2209528188*eta__1^4*zeta__1^3+.1920464905*eta__1^4*zeta__1^2+1.9334990569*eta__1^2*zeta__1^2+0.66050016962e-2*eta__1^7*zeta__1^4+.80614880365*eta__1^6*zeta__1^4-.9191903249*eta__1^6*zeta__1^2-1.724981418*zeta__1^7*eta__1^2+2.9678721471*zeta__1^7*eta__1^4-.94779423754*zeta__1*eta__1^4+.46301464814*zeta__1^6*eta__1^4-.22761063366*zeta__1^6*eta__1^2-0.85894534062e-2*eta__1^5*zeta__1^4+0.8278524871e-2*eta__1^5*zeta__1^2+0.46097207851e-2*eta__1^3*zeta__1^4-0.93963570584e-2*eta__1^3*zeta__1^2-0.81381430978e-3*eta__1*zeta__1^4-.62093209055*eta__1^2*zeta__1^4-.80179945016*eta__1^4*zeta__1^4+.70551660939*zeta__1*eta__1^2+0.38970885732e-2*zeta__1^2*eta__1+0.10746052526e-1*eta__1*zeta__1^7-0.40389225121e-1*eta__1^3*zeta__1^7+0.52300044044e-1*eta__1^5*zeta__1^7+.10999473421*eta__1^8*zeta__1^2-0.45528793761e-1*eta__1^7*zeta__1^3+0.57167454208e-1*eta__1^7*zeta__1^5+0.11770764739e-2*eta__1^9*zeta__1^2-0.18114547653e-2*eta__1^9*zeta__1^4+0.81527768559e-3*eta__1^9*zeta__1^6+0.13191002642e-1*eta__1*zeta__1^3+0.14324735033e-1*eta__1^3*zeta__1-0.18963873748e-1*eta__1*zeta__1^5-0.56315405543e-1*eta__1^3*zeta__1^3-0.21374958034e-1*eta__1^5*zeta__1+0.7601825081e-1*eta__1^3*zeta__1^5+.65574325943+0.80855499912e-1*eta__1^5*zeta__1^3-.10468335582*eta__1^5*zeta__1^5-0.26416622831e-1*eta__1^7*zeta__1^7-0.20189726843e-2*eta__1^9*zeta__1+0.77976967502e-2*eta__1^9*zeta__1^3-0.95384754473e-2*eta__1^9*zeta__1^5+.13649316215*eta__1^6*zeta__1^9+.23302831691*eta__1^2*zeta__1^9-.32125390168*eta__1^4*zeta__1^9+0.12167023924e-1*eta__1^7*zeta__1-0.301782967e-2*eta__1^6*zeta__1^8-0.43456747248e-2*eta__1^8*zeta__1^6):

plot3d(sqrt(fff), zeta__1 = -1 .. 1, eta__1 = -1 .. 1, color = green)

 

``

Quadrature(Quadrature(sqrt(fff), zeta__1 = -1 .. 1, method = romberg[3]), eta__1 = -1 .. 1, method = romberg[3])

0.2745463666e-1+0.*I

(1)

Student:-NumericalAnalysis:-Quadrature(Student:-NumericalAnalysis:-Quadrature(sqrt(fff), zeta__1 = -1 .. 1, method = romberg[4]), eta__1 = -1 .. 1, method = romberg[4])

0.3314502549e-1+0.*I

(2)

Student:-NumericalAnalysis:-Quadrature(Student:-NumericalAnalysis:-Quadrature(sqrt(fff), zeta__1 = -1 .. 1, method = romberg[5]), eta__1 = -1 .. 1, method = romberg[5])

0.3621732017e-1+0.*I

(3)

Student:-NumericalAnalysis:-Quadrature(Student:-NumericalAnalysis:-Quadrature(sqrt(fff), zeta__1 = -1 .. 1, method = romberg[6]), eta__1 = -1 .. 1, method = romberg[6])

Float(undefined)+Float(undefined)*I

(4)

``

Download question.mw

Hi,

One of my areas of expertise is in Designer Filters EMC. Could any professional that already uses MapleFlow for EMC and Electromagnetism, help me about the main functions of this amazing software?

Thanks.

Leandro Zamaro

A small annoyance, when some code is copied from mapleprimes and pasted into Maple (the standard windows copy-paste ctrl+c   ctrl+v) and executed.  The code doesn't execute properly. 

For example

cprint:=proc(s,c)
nprintf("#mo(%A,mathcolor=\"%A\")",s,c):
end proc:

cprint("this is green",green);#prints green

cprint("this is green",red);#prints red

copying and pasting the above code in Maple and executing results in the following output

                                              

Not sure why?

Hello,

I'm working through a manual to improve my use of Maple commands.  In particular, earlier today I used/entered the circle command in the Geometry package.  I used that command circle successfully.  Later in the day I went to do the circle command again and I kept getting the message as shown below.  Same command, different result.  So I haven't been able to complete my tutorial.  I'd love to know what I'm doing wrong here.  The other time it worked perfectly.   Hope you can help, thanks Dave.

The suggested solution in the answer https://mapleprimes.com/questions/234325-Use-Of-self--Inside-Object-Constructor  worked OK in the setup shown in that question.

But it does not work when putting the constructor inside overload

Here is an example where it works (i.e. by removing the type from _self as suggested in the above answer)

restart;

person:=module()
    option object;
    local name::string:="";

    #notice no _self::person, just _self
    export ModuleCopy::static:= proc( _self, proto::person, the_name::string, $ )            
           name:= the_name;
    end proc;

end module;


p:=Object(person,"me")

The above works. But since I have different constructors, once I put the above inside overload, using the same exact syntax, now the error comes back

restart;

person:=module()
    option object;
    local name::string:="";

    export ModuleCopy::static:= overload( 
    [
       proc( _self, proto::person, the_name::string, $ ) option overload;           
           name:= the_name;
      end proc
    ]);

end module;
             

p:=Object(person,"me")

Error, static procedure `ModuleCopy` refers to non-static local or export `name::string` in surrounding scope

I did not expect that using overload will cause any change to how it behaves. Is this a bug?

Below is worksheet also.

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

restart;

person:=module()
    option object;
    local name::string:="";

    export ModuleCopy::static:= proc( _self, proto::person, the_name::string, $ )            
           name:= the_name;
    end proc;

end module;

_m2950059551392

p:=Object(person,"me")

_m2950172920000

restart;

person:=module()
    option object;
    local name::string:="";

    export ModuleCopy::static:= overload(
    [
       proc( _self, proto::person, the_name::string, $ ) option overload;           
           name:= the_name;
      end proc
    ]);

end module;

_m2950059551392

p:=Object(person,"me")

Error, static procedure `ModuleCopy` refers to non-static local or export `name::string` in surrounding scope

 

Download OO_version.mw

5 6 7 8 9 10 11 Last Page 7 of 2132