MaplePrimes Questions

The solver seems to have a problem with some sets of boundary conditions. (See attached worksheet.)

Is there a way to get this numerical solution?
 

BC_test.mw

Dear colleagues,

 

how can i plot streamlines and isothermes and also 3D graphes of Nussult number and skin friction coefficient for boundary layer flow problem with Maple? 

Regards

Berham.

MagBVP.mw

MagBVP.docx

maple_event_test.mw

I want to catch the trigger time t[i]

[differentiation of f and greek letter xi in bracket]

Hello,

I was wondering if it is possible to write a 1st order differential equation in differential form?

So,

Instead of writing the diff eq in 

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

is it possible to to write something like

ode: -(x^2+x*y(x))*D(x)+ (1)*D(y(x))=0

?

I've asked about this 5 years ago

 

https://www.mapleprimes.com/questions/203628-Maple-2015-No-Longer-Autoscroll-As

And according to the reply there at the time, this is supposed to have been fixed in Maple 2015.1:

It appears that the scrolling issue has been fixed in the next version of Maple

But ever since then, whenever I use Maple, the worksheet do not auto-scroll as the program runs and prints outout to the screen. I have to keep using the mouse to move the bar down to see the latest prints.

Not only that, the bar itself (on the right side) shrinks in size as more outpout is printed.

It becomes smaller and smaller with time, and becomes very hard to grab it with the mouse since it become so thin.  Once all the output is deleted, the bar become long again.

So I think there is an option to enable autoscrolling somewhere.

But I am not able to find it. I looked at options, display, general and interface and see nothing there to turn it on.

Sometimes I get the feeling that the folks at Maplesoft do not use Maple interface the way we users use it, becuase this is such a basic interface problem and any one who uses Maple interface for more than one day must see these problems all the time.

So how come these are still not fixed?  Here is a screen shot showing the bar on the right after long print out, and showing how it was before.

I use only worksheet mode, not document mode. On windows 10.

 

 

 

 

Trying to get a curve of two data points but the graph is not a curve.

with(Statistics):

``

l1 := plot(X, t = 0 .. 16, thickness = 4, linestyle = dash, color = red):

 

``

Download fitting.mw

## i need to get a curve, but the graph is not displaying a curve fit

 

Problem is here how to define the local variables?

Also the formatting of the code is not ideal

There is a error , but if the local variables are good defined , it could vanish    


 

task 6 newtons method

 Newton's Method (see worksheet)

   
 

Tasks:

CDExercises

(1)  Figure 3.9 shows the convergence of Newton's method to a root  r of  the equation sin x - xcos x = 0. This was for x[0] = 5.5 and `ε` = 0.1e-3, and gives  r = 4.503123428, approximately. Obtain a better approximation, as suggested in the book, by using `ε` = .000001. and altering the above code appropriately. Compare your answer with the approximation to r that you get by using Maple's  fsolve command. How close to zero is  E =| f (r)|  for each of these values of r ?

 

(2) Alter the above code for Newton's method and use it to draw the picture shown in Figure 3.10 in the book.

--------------------------------

 

I make a procedure out of it 

f is function

a.. b endpoints interval x -range

e is the cutoff in the accuracy (tolerance?)

N is number of iterations

 

restart:

with(plots,display):

#
# Parameters - change as necessary
#
  a:= 0.8: b:= 2: N:= 100: e:= 0.0001:
  f:= x->x^2-1:

NewtonM:= proc(f, a, b, N, e)
               local n, tps, x0, E, A, x1, ps, x, j,  pf, pic :  
               uses plots:  
   n:=0: tps:={}:
   x0:=2.0: E:=evalf(abs(f(x0))):
   while ( E>e and n<N ) do
     A[n,1]:=x0;
     A[n,2]:=E;
     x1:=evalf(T(x0));
     E:=abs(f(x1));
     ps:={plot([[x0,0],[x0,f(x0)],[x1,0]],color=black,
                 thickness=2)}:   
     tps:=tps union ps:
     n:=n+1:
     x0:=x1:
   end do:
 
 for j from 0 to n-1 do x[j]=A[j,1],'E'=A[j,2]end do;

 pf:={plot(f(x),x=a..b)}:
 pic:=pf union tps:
 display(pic,tickmarks=[3,3]);
end proc:

maplemint(NewtonM);

Procedure NewtonM( f, a, b, N, e )
  These names were used as global names but were not declared:  black, color,
      thickness, tickmarks
  These local variables were used but never assigned a value:  x

 

NewtonM(x->x^2-1,0.8,2,100,0.0001);

Error, (in NewtonM) cannot determine if this expression is true or false: 0.1e-3 < abs(T(2.0)^2-1)

 

 


 

Download exc_set_3_task_6.mw

Hi. I am trying to solve a system of differential equations but I am having trouble understanding what I do wrong. I am a novice Maple user.

>with(PDEtools): with(LinearAlgebra): with(DifferentialGeometry): with(VectorCalculus): with(DEtools):

>_Omega_d := 1-_Omega_r

>eq1 := h1(z)*h2(z)+h2(z)*h3(z)+h1(z)*h3(z)-3*(_Omega_d*((1+z)^3)+_Omega_r*((1+z)^4)) = 0

>eq2 := h2(z)^2+h3(z)^2+h2(z)*h3(z)-1/3*(1+z)*(h2(z)*(diff(h2(z), z))+h3(z)*(diff(h3(z), z)))+_Omega_r*((1+z)^4) = 0

>eq3 := h1(z)^2+h3(z)^2+h1(z)*h3(z)-1/3*(1+z)*(h1(z)*(diff(h1(z), z))+h3(z)*(diff(h3(z), z)))+_Omega_r*((1+z)^4) = 0

>eq4 := h2(z)^2+h1(z)^2+h2(z)*h1(z)-1/3*(1+z)*(h2(z)*(diff(h2(z), z))+h1(z)*(diff(h1(z), z)))+_Omega_r*((1+z)^4) = 0

>sys := {eq2, eq3, eq4}

Equations eq1 - eq4 are my equations, but since eq1 does not have a differentiated function, I leave it out of the system, otherwise I get an error that states that I have more functions than variables.

>sys1 := subs(_Omega_r = 10^(-15), sys)

>ics := {h1(0.1e-3) = 1, h2(0.1e-3) = 1, h3(0.1e-3) = 1, (D(h2))(0.1e-3) = 4.500015, (D(h3))(0.1e-3) = 4.500015, (diff(h1(z), z))(0.1e-4) = 4.500015}

ics are my inititial conditions.

>pdsolve(sys1 union ics, {h1(z), h2(z), h3(z)}, type = numeric, generalsolution)

But when I run this, I get an error that says "Error, (in pdsolve/sys) found the independent variables {z} also present in the names of the functions of the system {}".

I have tried numerous different methods to solve this, and I get stuck every time. If anyone has any advice, I would appreciate it. I am trying to get solutions for h1(z), h2(z), h3(z) (to ultimately plot these functions versus z), if possible.

 

Hi, I want to use Maple to derive the eigenvectors of a 3x3 matrix A. I can obtian the 3 eigenvalues correctly by using eigenvalues(A), and the results are "u, -a+u, a+u". But after inputing eigenvectors(A), I can only get "[-a+u, 1, {r}], [a+u, 1, {r}], [u, 1, {r}]". All the 3 eigenvectors are written as {r}, I dont know why...and how can I tranform {r} into visiable results? 

I would be very appreciate if anyone could give me some help!

Hi,

I am trying to find q(t) from this 

ode1:=-diff(q(t), t) - 1.851851852*10^(-7)*q(t)*(2.042885233*10^10 - 3.517396152*10^18*(0.00001474262739*cos((1000*sqrt(1122)*t)/33) + 0.00001474262739*sin((1000*sqrt(1122)*t)/33))^2) + 9.259259260*10^(-7);

with initial condition

ics := q(0) = 2.45*10^(-12)

using

dsolve({ode1,ics})

but I cannot get the full solution. Is there any way I could find q(t)?

Thanks,

Baharm31

This is the source:

ode1.mw

 

 

 

Whay the command:  123! + 1 takes significantly more time than 123! only??? Moreover time(123!+1) and time(123!) are very similar and fast.

I am using Worksheet GUI.

I do not understand what I am doing wrong. I have an Object, with private variable call hint. This private variable can be seen only by other proc's inside the object as expected.

Now inside one of those other proc's, I nested a small local proc inside it.

What I want is to access the object private variable from inside this small local proc nested inside.

But not able to. I tried different combinations and nothing is working.  Here is one of many attempts. 

restart;
module my_class()
   option object;
   local hint::string:="X"; #private variable to the object
 
   export foo::static:=proc(o::my_class) #can be seen from outside
      local boo; #local proc inside proc foo

      boo:=proc(o::my_class) #local proc
          print("inside boo()");
          print(o:-hint);
      end proc;

      print("in foo(), calling local proc boo()");
      print("hint is ",o:-hint); #works OK
      o:-foo:-boo(o); #tried also o:-boo(o) and boo(o)
   end proc;
end module;

called it as

o:=Object(my_class);
o:-foo(o)

Error, (in my_class:-foo) module `my_class` does not export `boo`
 

Also tried different combinations but so far nothing worked. For example, I tried making the nested proc static, but that did not help:

restart;
module my_class()
   option object;
   local hint::string:="X"; #private variable to the object
 
   export foo::static:=proc(o::my_class) #can be seen from outside
      local boo; #local proc inside proc foo

      boo::static:=proc(o::my_class) #local proc, static
          print("inside boo()");
          print(o:-hint);
      end proc;

      print("in foo(), calling local proc boo()");
      print("hint is ",o:-hint); #works OK
      boo(o);
   end proc;
end module;

o:=Object(my_class);
o:-foo(o)

Error, (in boo) module `my_class` does not export `hint`
 

But this error do not show up, when I made boo local to the object itself (vs. local to the proc). As follows, where the nested boo() proc is moved one level higher.

restart;
module my_class()
   option object;
   local hint::string:="X"; #private variable to the object
 
   export foo::static:=proc(o::my_class) #can be seen from outside     
      print("in foo(), calling local proc boo()");
      print("hint is ",o:-hint); #works OK
      o:-boo(o);
   end proc;

   local boo:=proc(o::my_class) #local proc to the object
      print("inside boo()");
      print(o:-hint);
   end proc;
end module;

now

o:=Object(my_class);
o:-foo(o)

works. No problem and no error.

How does one call a local proc to an object? Similar to how one does it in normal non-object proc's? 

Are local proc's inside object proc's allowed? Or for an Object, only one level of nesting is allowed?

Maple 2020.1

 

 

 

In Maple, an expression of type `*` can have many operands. I need to break it to product of two operands only.

For example given, expr:=A*B*C, I want first_part to be A and second_part to B*C

The way I do it now is clumsy.

I first check if expression is of type `*`, then use first_part :=op(1,expr) to find the first term, then divide the expression by that first term to find the second part. second_part:=expr/first_part

second_part:=op(2..nops(expr)) does not exaclty works, since it gives me B,C instead of B*C.

What would be a good way to do this? Notice that expr:=-A is actually a `*`, where first_part:=-1 and second_part:=A. Which is OK.

restart;
expr         := A*B*C;
first_part   := op(1,expr);
second_part  := expr/first_part;

How to draw a circle transfomed by orthogonal affinity to oblique line and k ration ? Thank you.

First 413 414 415 416 417 418 419 Last Page 415 of 2308