## How to transfer code to matlab?...

Asked by:

restart: with(plots):
bisect:=proc(f, intbeg::numeric, intend::numeric, ss::float, del::float)
local Num_points,limit1,approx,i,x1,x2,a,b,flag1,pet,A,B,NewApprox,CheckIt,newDelta,
interval_begin,interval_end,step_size,delta, y_approx, y_A, y_New;

interval_begin:=intbeg:
interval_end:=intend:
step_size:=ss:
delta:=del:
Num_points:=0:
print([x,y]);
limit1:=200:

for i from interval_begin by step_size to interval_end do
x1:=i:
x2:=i+step_size:
if x1=0 then x1:=-10^(-5)fi:
if x2=0 then x2:=-10^(-5)fi:
a := evalf( f(x1) ):
b := evalf( f(x2) ):
if a=0 then a:=-10^(-5)fi:
if b=0 then b:=-10^(-5)fi:
flag1:=0:

if evalf(a*b) <= 0 then
approx := (x1+x2)/2:
y_approx := evalf( f(approx) ):
if abs(y_approx) < delta then
print([approx, y_approx]):
Num_points:=Num_points+1:
else
pet:=0:
A:=x1:
B:=x2:
while pet=0 do
NewApprox:=(A+B)/2:
y_A := evalf( f(A) );
y_New := evalf( f(NewApprox) );
CheckIt := y_A * y_New:
newDelta:=abs( y_A - y_New ):
flag1:=flag1+1:

if newDelta <= delta then
print([NewApprox, y_New]):
pet:=1:
Num_points:=Num_points+1:
elif CheckIt > 0 then
A:=NewApprox;
else
B:=NewApprox;
fi:

if flag1 > limit1 then
pet:=1:
print(`*** Exceeds limits****`);
fi:
od:
fi:
fi:

od:

print(`Number of Roots Found = `,Num_points):
plot(f(x), x=interval_begin..interval_end, color=red, thickness=1);

end:

## How to export a numerical solution of dsolve prope...

Asked by:

I'm working on several worksheets where I solve numerical DE's. I would like to compare the solutions by plotting in one graph So I though it would be nice to have a seperate worksheet for this.

My approach:

Statements from my original sheets:
> solution:=dsolve({ODES,ICS},maxfun=0,numeric,range=0..10,output=listprocedure):
> X__br:=eval(xbr(t),solution):

I can plot these variables in my original sheet with plot(X__br(t),t=0..10).
However, when I transfer it to a different sheet by:

> save X__br, "filename.mpl"

And then load it into a new sheet by
> read("D:/.../filename.mpl");

There seems to be no possible way to plot the X__br(t) anymore. How can I solve this?
My error when I try plot(X__br(t),t=0..10) is:

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

## Just one detail: how to get the power write in a t...

Asked by:

Hi,

Just a detail : How to get the power write in title ( without displaying the symbol ^ ) ?

Thanks

PDFColorTitle.mw

## How do I change the color of the title of my graph...

Asked by:

Hi,

How do I change the color of the title of my graph? Thanks

PDFColorTitle.mw

## Behaviour of print~...

Asked by:

Hi,

Could you explain me where the third output comes from?

print~([a, b]);
a
b
[ ]

Thanks in advance

## integration by parts...

Asked by:

How I can perform integration by parts, with respect to the x[0..1],y[0..1],t

 >
 >
 >
 >
 >

Download PART.mw

## Trying to evaluate a function at multiple points a...

Asked by:

Hi,

I cannot thank you enough for the help.

I figure that there is a way to write a bunch of lines on a DE plot using some sort of command? I figure that it has to do with the sequence feature of maple.  What I am trying to do is show a bunch of lines in a DE plot that does y(n)=-1 where n is an integer ranging from -5 to 5.  I'll link my worksheet. Differential_Equation_slope_field.mw

## how to debug a procedure...

Asked by:

Hello,

I have a large module of procedures. A procedure thet I know takes a long time to execute the result. I would like to know at what stage of the procedure the calculation takes time.

## 3 little annoying things ....

Asked by:

1)  Copy/paste problem .

Looks like Maple is not able to copy/paste the output
from a summation command . Look at my example .
I have to use the  " lprint " command .
2)   Mysterious small box character .

Suppose I want to edit a command . I want to replace a character with a left bracket
(or right bracket or left accolade but strangely not the right accolade).
I put the cursor on the character and type the left bracket (or right...) .
The left bracket ( or right ...)  is inserted . Now when I try to delete the character,
a small box appear . The  character I am trying to delete is shifting to the right .
Like  I said , just a little annoying .

3)  Open file problem .

The first file I open in Maple with the  ctrl-o command , the "open file window" appears in
the center of the screen . All the others files I am opening , the "open file window"  show up
in the bottom left corner , top center or top right corner ... randomly .
Very annoying on a 27" screen . For this last one ,I am not shure  if it is a Maple 2018 problem
or a Windows 10 64 bits problem . I have few programs in my computer .
When I use Microsoft Paint or Wordpad ,I don't see this problem .

I don't know if somebody else can confirm those annoying things . If I am not the only one
then I am hoping the next updates or versions will fix that .

Thanks !

## How to create and solve 100 equations at the same ...

Asked by:

Here is the code I've wrote for third order polynomial .

I want to extend it for 100th order polynomial without writing the somehow same things 100 times !

what should I do ?

( I've done same thing in PHP with sprintf , there we could define variables like x{i} = ... , and so we could make a lot of variable with a for loop )

Thanks in advance .

Here is the code in *.mw format :

## Pythagora table which don't work...

Asked by:

with(plottools):with(plots): display(seq(seq(display(polygon([[i,j],[i,j+1],[i+1,j+1],[i+1,j]], color=`if``((j)::odd,ColorTools:-Color=magenta))), textplot([1+.5,j+.5,fprintf("%d",i*j)])),i=1..10), j=1..10),axes=none);

## pdsolve issue with heat PDE. map expects 2 or mo...

Asked by:

Hello Maple experts:

Using Maple 2018.2.1 on windows, with Physics package version 301.

There is some strange issue in parsing somewhere.  This works

```r:='r'; u:='u'; t:='t';theta:='theta';k:='k';
k:=1/25;
pde := diff(u(r,theta,t),t)=k*(diff(u(r,theta,t),r\$2) + 1/r*diff(u(r,theta,t),r)+1/r^2*diff(u(r,theta,t),theta\$2));
bc1:= eval(diff(u(r,theta,t),r),r=1)=0;
bc2:= u(r,0,t)=0, u(r,Pi,t)=0;
ic := u(r,theta,0)=(r-1/3*r^3)*sin(theta);
sol:=pdsolve([pde, bc1, bc2, ic], u(r, theta, t),HINT = boundedseries(r = [0]));
```

No problem with the above, pdsolve gives solution. Now if I change k from 1/25 to 1, it gives parsing error in map

```k:=1;
pde := diff(u(r,theta,t),t)=k*(diff(u(r,theta,t),r\$2) + 1/r*diff(u(r,theta,t),r)+1/r^2*diff(u(r,theta,t),theta\$2));
bc1:= eval(diff(u(r,theta,t),r),r=1)=0;
bc2:= u(r,0,t)=0, u(r,Pi,t)=0;
ic  := u(r,theta,0)=(r-1/3*r^3)*sin(theta);
sol := pdsolve([pde, bc1, bc2, ic], u(r, theta, t),HINT = boundedseries(r = [0]));
```

Error, (in assuming) invalid input: map expects 2 or more arguments, but received 1

any K value less than one works.

Now I change K from 1 to 2, the error goes away. But no solution. Which is OK.

Why does the map error shows up when k=1 only? Same error shows up if K is missing all togother, as in

```r:='r'; u:='u'; t:='t';theta:='theta';k:='k';
pde := diff(u(r,theta,t),t)=diff(u(r,theta,t),r\$2) + 1/r*diff(u(r,theta,t),r)+1/r^2*diff(u(r,theta,t),theta\$2);
bc1:= eval(diff(u(r,theta,t),r),r=1)=0;
bc2:= u(r,0,t)=0, u(r,Pi,t)=0;
ic  := u(r,theta,0)=(r-1/3*r^3)*sin(theta);
sol := pdsolve([pde, bc1, bc2, ic], u(r, theta, t),HINT = boundedseries(r = [0]));
```

Error, (in assuming) invalid input: map expects 2 or more arguments, but received 1

## How do I create my own Heaviside function?...

Asked by:

Hi

I want to create a Heaviside function called MyStep() which will behave exactly like the built in Heaviside with one exception: for MyStep(0) it will return 1 instead of undefined.

MyStep(t) = 0, 0<t

MyStep(t) = 1, else

Thanks

## Nontrivial solution for large matrix...

Asked by:

Hi

I got an square matrix (70×70) from MATLAB (please download attached text file 1.txt). Following codes are used in MAPLE, but an unknown error is occurred. It seems that matrix is divided in two submatrices. Please hint me or run the codes to obtain fiirst three minimum real positive roots of the determinant.

Thank you for taking your time

Maple codes

Digits:=150:

M:=parse(FileTools[Text][ReadFile]("1.txt")):

LinearAlgebra:-Determinant(M):

fsolve(%,P=0..0.5)*100;

## try to set up a table in a maplet...

Asked by:

Good morning everyone

I'm sorry if I'm asking a simple question, but I would like to create a maplet from a maple code I written.

My first problem is I would like to now how to create a table like in excel, to be fill up by the user of the maplet.

Basically, the maplet will consist of enter two parameters who define the number of colums and row needed for the table,

Then fill up this table, which gonna be plot, and then a button to fit this curve using an equation. And the starting value in order to fit the curve will also be set up by the user.

Thanks you in advance if you can help me to set up this table in the maplet.

cheers!

 First 570 571 572 573 574 575 576 Last Page 572 of 2281
﻿