## dharr

Dr. David Harrington

## 21 Badges

19 years, 300 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

## Social Networks and Content at Maplesoft.com

I am a professor of chemistry at the University of Victoria, BC, Canada, where my research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

## document blocks...

@dondomingo Select View/Markers, then open a new Document with File/New/Document mode. Type plot(x^2) and ctrl-= or alt-enter, which produces the plot on the same line. Then edit/document blocks/toggle input/output display.

(If you use enter, the plot is on the next line and you will have to put the cursor back into the document block before toggling the display)

In general, you get more control over layout in document mode, but if you are more worried about the math, use worksheet mode. You can also hide input in Tables.

## complex...

At least in Maple 2017, only real boundary-value problems can be solved. But since your problem seems to be with fsolve, note you can use the complex option there. Suggest you upload your worksheet with the big green up-arrow, and we can see more clearly what you are trying to do and what the problem is.

## volume element...

@isabelmacpherson  I agree with you - you need the r^2*sin(varphi) as it is part of the volume element. As @nm points out, there are two conventions: you have used the Math convention, with varphi=0..Pi and theta=0..2*Pi.

## initial or boundary conditions...

v(0,0)=1is not acceptable. You need v(zeta,0)=1 for an initial condition (everywhere 1 at time zero) or v(0,t)=1 for a boundary condition (1 at zeta=0 for all time). Similarly for the other conditions. So you need to sort out what you want - I think 6 initial conditions and 2 boundary conditions,

## Heaviside?...

@Maple_lover1 I don't know if matlab has Heaviside functions, but if so, then you can convert your piecewise  expression to Heaviside form using convert(u,Heaviside);

## Elegant...

@vv Very nice! I especially like lhs~(Z) with the set. And nops(Z)=1 captures two cases.

## edited...

@DJJerome1976  Realised for the row swap case, also have to check the row sums are 1, so have edited it.

## Request Maple...

The authors of the paper used Maple, so perhaps you could contact them to get their worksheet,

## methods...

As @Preben Alsholm says, there are no methods for stiff equations, but you can try different methods, see ?dsolve,numeric,bvp. And the page ?dsolve,numeric_bvp,advanced has tips for difficult problems.

## A=r^2...

@vv A:=r^2 works as well. (I played around with replacing the constants with names but didn't suspect the r^2 was the problem.) Not sure why that would be.

## not attached...

Please try attaching the worksheet again (green up arrow)

## sample loop...

@fati1988 As I said earlier I'd do four nested loops with a complicated if statement. This is not the most efficient, but is probably the most readable. But there will be 256 cases in the if statement (only one in the sample below) so really it is better to work out the pattern - perhaps from knowing the derivation which led to it.

QMatrix.mw

```i:=0:
for l from 1 to N_x do
for  p  from 1 to N_y do
i:=i+1;
j:=0:
for l_prim from 1 to N_x do
for  p_prim  from 1 to N_y do
j:=j+1;
if l::even and p::odd and l_prim::odd and p_prim::even then
H[i,j]:=KroneckerDelta[l, l_prim]*KroneckerDelta[p, p_prim+1]
+KroneckerDelta[l, l_prim-1]*KroneckerDelta[p, p_prim-1]
else
H[i,j]:=0;
end if;
end do;
end do;
end do;
end do;
```

## same problem...

@janhardo fixed the system and the (") as before, and it works.

Download CH7B.mw

## DynamicSystems...

@janhardo There is a DynamicSystems package in newer versions of Maple that might be relevant.

## OK...

@acer  OK, I see. I thought that was the plot required. It seems natural to want Nu to actually display as the Greek letter that it is.

 First 41 42 43 44 45 46 47 Last Page 43 of 62
﻿