Maple 17 Questions and Posts

These are Posts and Questions associated with the product, Maple 17

Dear,

I have this code generating a piecewise function:

> with(CurveFitting);

> points := [[0, 1], [1, 2.5], [3, 2.3], [4.2, 5], [5, 3.5], [5.8, 4.2], [7, 7], [8, 10]];

> splcurve := Spline(points, v);

In this particular case I have seven distinct polynomials. Someone knows how could I get one specific polynomial, for example, the one exactly before v < 4.2? 

In other terms:

I'd like to define a new function, say 'f', that is exactly the polynomial just before v < 4.2 (e.g, something like f:=(splcurve, v < 4.2)). Do exists this possibility? (I have been looking for it elsewhere but without success!!)

Thanks in advance! Best regards!

 

 

****** My question *****

for k from 0 to n do    # n is any integer.

func := f(x):             # func is any funciton of x.

D := diff(func, x$k);   # The maple don't allow to uses k but I want to diff k-th order in each k-loop.

end do;                    # How to diff func for k-th times in each k-loop.

Not sure exactly how i could achieve this but:

how do i determine the value of k for which the graphs p(x) = x^2+2x+3 and q(x) = k+5x-7x^2 enclose an area of exactly 36?

I have to do it in maple and using i guess area under the curve.

Thanks

Hi there,

I'm trying to get the values from the output of a dsolve command.

I have a system of differential equations:

de1 := diff(V(t), t) = V(t)-(1/3)*V(t)^3-W(t)+Ie;
de2 := diff(W(t), t) = 0.8e-1*(V(t)+.7-.8*W(t))

For a range of the independent variable t and for some given values of the parameter Ie, I would like to get the value of the dependent variable V, as well as its minimum/maximum values for each Ie.

Can anybody suggest a solution please?

 

This is the worksheet: MaplePrimes_dsolve_min-max.mw

 

Thanks,

jon

How can I link the axes in two or more separate plots so that when I zoom in one, the others are also zoomed. Also when I want to link the 'x' or the 'y' axis only.

Thank you

Dear mapleprimes users,

I have a problem with this function:

B is the length of my array

A := Array(1..B,0);

for i from 1 to B do
p = nextprime(i)

a = primroot(p)

A[i] := A[i] + convert((Usage(mlog(b,a,p,method=indcalc), output=[cputime,output],quiet)[1],decimal,15))
end do;

A;

My idea is to create an array A with all the CPUtimes from the 1st prime til the Bth prime, and then plot it.

But my problem is that I get an error; Illegal use of an object as a name.

I don`t know what to do could you help me?

 

Thanks!

 

 

How can this error be corrected '' error, (in fsolve) fsolve cannot solve on 0=0 ''. See the worksheet p4.mw

Thanks.

Hi there,

I've been trying to find an equivalent to MATLAB's unique command in Maple, but I had no success.

I've seen that Maple would return the elements that are either repeated (FindRepetitions) or not repeated (MakeUnique), but not the indices within the original list.

Is there way to do that?

Thanks,

jon

Hi, I installed Maple 17 a while back and was able to work all the commands but recently I reinstalled it
I tried a command which gave me an error that I never got before

>rightsum:=RiemannSum(1/x^2,x=50..75,partition=25,method=right,output=plot);


Error, (in Student:-Calculus1:-RiemannSum) external linking: error loading external library statshw.dll: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

When I tried to reinstall the only issue was that it had trouble installing Visual C++ 2005 redistribute however I already have it on my computer and I don't intend to uninstall it since it took a long time to actually get my other programs to have it working. Is there anyhting I can do to fix this error? (Plotting other stuff seems to work fine except for Riemann Sums)

Hi there,

I'm trying to simulate an stochastic SIR model following the Gillespie algorithm, as described here [1].

 

When trying to update each process' probabilities, it looks like Maple is not updating their values. Although each element of the lists S, I and R is updated the ai lists are not updated.

For example, for a given index i

a2[i]:= m*S[i]:

takes the same value for every i, regardless of the value of S[i].

Can anybody tell why this is happening or what's wrong with the worksheet? This is the attempt: MaplePrimes_SIR_model_simulation_Gillespie_algorithm.mw

 

On the other hand, I tried making things more clear through a couple of procedures. However, when it comes to the point where a random number with an exponential distirbution is computed:

Rexp := RandomVariable(Exponential(mu)):

it looks like Maple is unable to evaluate mu. But having a look at the Variables explorer, it has a defined value, indeed.

So what's wrong in the worksheet? Thi is the attempt: MaplePrimes_SIR_model_simulation_Gillespie_algorithm.mw

 

Thanks,

jon

[1] http://www.biosym.uzh.ch/modules/models/ETHZ/StochasticSimulation/sir_stoch.xhtml

Hi, all

I use INT to calculate multiple integration as below. It runs more than 20 hours without results. I wander is there any problem in my codes.

restart;
A := sin(k*Pi*(x-h*cos(theta))/a)*sin(l*Pi*(y-h*sin(theta))/b)*sin(k[0]*h)*sin(k*Pi*x/a)*sin(l*Pi*y/b);

W := evalf[5](int(int(int(int(A, h = 0 .. (x-a)/cos(theta)), theta = Pi+arctan((b-y)/(a-x)) .. 3*Pi*(1/2)), x = 0 .. a), y = 0 .. b, numeric))

 

Thanks

I am trying to define a new typt and I am beating my head against the wall...

What I have working:

TypeTools:-AddType(Element,'record(l,R)');
 
This defines a type which I can then use in type(xpr,Element) to be false or true depending on whether xpr is a record containing (at least) entries l and R or not.

Now I want to define a type ExpandedLine that is a Vector of Element (Element in the sense above). In fact, in the context of my application I am willing to settle for ExpandedLine being a Vector of record.

Tried various approaches (and making sure Vector is in uneval quotes in the AddType statement) like:

TypeTools:-AddType(ExpandedLine,'Vector'(record));

and variations but no luck.

Any help is appreciated.

Mac Dude

 

Hello everyone,

I have nonlinear partial differential equations (see the attached file) need to be solved:

https://drive.google.com/file/d/0B14...ew?usp=sharing

With initial condition: h(x, y) = K1 (constant), dh/dx = K2 (constant); dh/dy = K3 (constant); And h(x,y) is function of (x,y) other factors are constant. Could anyone tell me how to solve these equations by using numerical method? Do you know any library in c/ c++ language that can solve these equations??

I have tried with Maple 17 and the response is: "Error, (in pdsolve/info) first argument is not a differential equation". Whole of my input:

 

with(PDEtools); declare(U1(x, y), U2(x, y), U3(x, y));

PDEs = [diff(U1(x, y), y) = U2(x, y),

diff(U1(x, y), x) = U3(x, y),

(diff(U2(x, y), y))*((L-U1(x, y))^2+(D2+tan(alpha)*(L+U1(x, y)))^2)+.5*U2(x, y)*(2*tan(alpha)*U1(x, y)-D2) = 0,

(diff(U3(x, y), x))*((L-U1(x, y))^2+D1^2*cos(alpha+2*U2(x, y))^2)+.5*U3(x, y)*D1*cos(alpha+2*U2(x, y))+.5*D1*sin(alpha+2*U2(x, y))*(L-U1(x, y)) = 0];

 

[ d d / d
PDEs = [--- U1(x, y) = U2(x, y), --- U1(x, y) = U3(x, y), |--- U2(
[ dy dx \ dy

\ / 2 2\
x, y)| \(L - U1(x, y)) + (D2 + tan(alpha) (L + U1(x, y))) /
/

/ d
+ 0.5 U2(x, y) (2 tan(alpha) U1(x, y) - D2) = 0, |--- U3(x, y)
\ dx

\ / 2 2 2\
| \(L - U1(x, y)) + D1 cos(alpha + 2 U2(x, y)) /
/

+ 0.5 U3(x, y) D1 cos(alpha + 2 U2(x, y))

]
+ 0.5 D1 sin(alpha + 2 U2(x, y)) (L - U1(x, y)) = 0]
]

pdsolve(PDEs);
Error, (in pdsolve/info) first argument is not a differential equation

 


I will be very appreciated with your help!!!

First 24 25 26 27 28 29 30 Last Page 26 of 58