## can you help me regarding my ode problem...

Dear sir

In my ode problem i do not know that how to set range (eta) from -2 to 2 please can  you help me.

## Repeat program and save outputs...

How to hum program repeat several times and save what data result from each time it runs?

## What is wrong with my program?...

Hello everyone!

Prime:= proc (a, b)

local i, p, r;

p := ();

r :=() ;

for i from a to b do

if isprime(i) then p := p union (i) end if;

if type(sqrt(p[i]-1), integer) then r := r union (p[i]) end if;

end do

end proc;

Prime(1, 10)

My English is not very good. I don't know what erros I get in my program. Thank everyone

## Prime Number Example/Euclid...

I am trying to take a list of prime numbers that I already generated with the following:

L4:=NULL:

for i from 2 to 50 do

if nops(ifactor(i))=1 then L4:=L4,i end if:

end do;

[L4]

This gives me the primes bewteen 2-50, [2,3,5,7,11,13,17,23,29,31,37,43,47].  I want to write something that takes the products of my list like this

2*3=6

2*3*5=30

2*3*5*7=210

and so on through the whole list.  Any ideas?  I figured out how to take the product of 2*3, 2*5, 2*7 and so on, but I cant figure how to make it do 2*3, 2*3*7 and so on.

I am doing a presentation on Euclids infinite prime proof and thought it would be cool to write a maple program that will show his proof for a certain amount of prime numbers.

Thanks,  Matt

## Review code from .mla file...

Hi all,

I google and found a program using C# connect with Maple. The Maple file is mla file - a pakage library type of Maple. I want to review data structure and all interfaces funtions to understand the way to implement this features.

Regards,

Quan Nguyen

## Why doesn't it output?...

I solve the problem on computational geometry: "A cube of side one contains two cubes of sides a and b having non-overlapping interiors. How to prove the inequality a+b≤1?" To this end I use the DirectSearch package , namely,

Here are some comments to it. The cube of side a is centered at (x_1,y_1,z_1) and rotated by the angles phi_1, psi_1, theta_1 (see http://uk.wikipedia.org/wiki/%D0%95%D0%B9%D0%BB%D0%B5%D1%80%D0%BE%D0%B2%D1%96_%D0%BA%D1%83%D1%82%D0%B8 ) and the cube of side b is centered at (x_2,y_2,z_2) and rotated by the angles phi_2, psi_2, theta_2. The procedure

calculates the distance between these cubes, for example,

st := time(); dist(.2, .9, .2, .2, .2, .7, .7, .7, 0, 0, 0, 0, 0, 0); time()-st;

[HFloat(5.453016092898238e-11), [s1 = HFloat(0.2646161775314957),

s2 = HFloat(0.2828503247068887),

s3 = HFloat(0.29444713116943216),

t1 = HFloat(0.2646161774916062),

t2 = HFloat(0.28285032471998384),

t3 = HFloat(0.2944471311346344)], 2527]
191.133
Unfortunately, my code (which is syntactically correct) is spinning on my wondercomp during 10 hours without any output. I don't understand it at all. Your advices are welcome.

twocubes.mw

## How not display "memory used..." ?...

Hi,

When I run a maple program which take a long time (in command line), I have this kind of message every second:

"memory used=43867.3MB, alloc=147.3MB, time=856.28"

Does there exist any way to avoid this display ?

## How to obtain obtain coefficient values of the ODE...

Hello, everybody!

If it is convenient for you, I wish you can help me review the following program. Thank you very much in advance. I want to obtain the coefficient values of c0, n, s0, ks, h1, h2, kp, A, B for the ODE system.

restart;
cdm_ode := diff(y1(t), t) = c0*(y6(t)*(1-y3(t))/(s0*(1-y4(t)*(1-y5(t)))))^n/(1-y2(t)), diff(y2(t), t) = ks*y2(t)^(1/3)*(1-y2(t)), diff(y3(t), t) = h1*(1-y3(t)/h2)*c0*(y6(t)*(1-y3(t))/(s0*(1-y4(t)*(1-y5(t)))))^n/(sigma*(1-y2(t))), diff(y4(t), t) = (1/3)*kp*(1-y4(t))^4, diff(y5(t), t) = A*B*y1(t)^(B-1)*c0*(y6(t)*(1-y3(t))/(s0*(1-y4(t)*(1-y5(t)))))^n/(1-y2(t)), diff(y6(t), t) = y6(t)*c0*(y6(t)*(1-y3(t))/(s0*(1-y4(t)*(1-y5(t)))))^n/(1-y2(t));

tol_t := 3600;

sol := dsolve([cdm_ode, y1(0) = 0, y2(0) = 0, y3(0) = 0, y4(0) = 0, y5(0) = 0, y6(0) = 175], numeric, range = 0 .. tol_t, output = listprocedure, parameters = [c0, n, sigma, s0, ks, h1, h2, kp, A, B]);

err := proc (c0, n, s0, ks, h1, h2, kp, A, B) local st1, st2, sv1, sv2, sv; sol(parameters = [c0, n, 175, s0, ks, h1, h2, kp, A, B]); st1 := subs(sol, y1(t)); sv1 := [st1(1), st1(100), st1(210), st1(2500), st1(2800), st1(3000)]; sol(parameters = [5.7/10^6, 10.186, 175, 200, 1/20000000, 10000, .269, 1.5/10^7, 1.5, 2]); st2 := subs(sol, y1(t)); sv2 := [st2(1), st2(100), st2(210), st2(2500), st2(2800), st2(3000)]; sv := add((sv1[i]-sv2[i])^2, i = 1 .. 6); sv end proc;

with(GlobalOptimization);
GlobalSolve(err, c0 = 0 .. 1, n = 1 .. 20, s0 = 150 .. 250, ks = 0 .. 1, h1 = 100 .. 15000, h2 = 0 .. .5, kp = 0 .. 1, A = .5 .. 2, B = 1 .. 5);

Error, (in GlobalOptimization:-GlobalSolve) `InertForms` does not evaluate to a module

## Hybrid function...

Hi all.

In the following program, i have normalized bernstein polynomials using gram- schmidt orthogonalization process and want to hybrid them with block pulse functions so that i have:

why the program is wrong?? where of it doesn't work properly?

best wishes

OHB.mws

Ph.D Candidate

Applied Mathematics Department

## bifurcation diagram...

Hi,

I have a non linear ode with sinosoial term, (sin(x)).

How can we Analyse the system and plot the bifurcation diagram:

x'=r*x-sin(x);

Thank you very much for your help.

## Spacial Matrix Prodution...

Hi all

I have a mathematical problem and I asked it in various sites but the answers till yet are not correct.

Assume that we have:

T[m]:=t->t^m:
b[n,m]:=unapply(piecewise(t>=(n-1)*tj/N and t<n*tj/N, T[m](N*t-(n-1)*tj), 0), t):

where n,N,tj are known constants. furthermore assume that we want to comute the following integral:

for following approximations:

I have written the following code but it seems to be incorrect:

V1:=Vector([seq(seq(b[n,m](t),m=0..1),n=1..3)]);
V:=evalf(V1.Transpose(V1));

the original program is :

taaylor.mws

I will be so grateful if any one can help me to solve it by maple

Ph.D Candidate

Applied Mathematics Department

## founding the error in program...

hi all.

I have wrore the following program for optimization with bernstein and block pulse hybrid functions.

the program have some errors which i can't understand.

Bernestien1.mws

 > restart:
 > alias(C=binomial): with(LinearAlgebra): macro(LA= LinearAlgebra):
 > HybrFunc:=proc(N, M,  tj)               # N=Number of subintervals,  M=Number of functions in subintervals   local B, n, m; global b; for n from 1 to N do for m from 0 to M-1 do B := (i,m,t) -> C(m,i)*(1-t)^(m-i)*t^i: b[n,m]:=unapply(piecewise(t>=(n-1)*tj/N and tb[n,m](t)): #convert(%,vector); end proc: HybrFunc(3, 3, 1);                                        # End Of Definition   g2(t):=t;            #*exp(t-1):                      # Any other function can be replaced here      g1(t):=add(add(c[n,m]*b[n,m](t), m=0..2), n=1..3); Optimization[Minimize](sqrt(int((g2(t)-g1(t))^2, t=0.. 1))); assign(op(%[2])); plot([g2(t),g1(t)], t=0..1, 0..5, color=[blue,red],thickness=[1,3],discont, scaling=constrained);
 Error, (in Optimization:-NLPSolve) complex value encountered Error, invalid left hand side in assignment (1)

I'll be so grateful if any one can help me.

Ph.D Candidate

Applied Mathematics Department

Maple

Take a look at this link.

## Writing out a problem set in on the computer...

For solving problem sets, I have a pdf template I created for myself that has a header with a blank for the class name, TA, professor, date, etc. In addition to this header, I had a margin on the left to scribble questions I had and to holepunch.

I used to print out the template and write on the template and turn in that as my pset.

I am nowthinking of doing everything on the computer. Writing out all of the problem set on the computer. Combining stuff from maple, combining handwritten stuff from the computer using a digitizer. However I want to write it all on top of the my template that I created, which is a pdf file. I can turn the pdf into an image file if need be.

What would be the easiest way to do what I want? To open a program that automatically sets that pdf as the template and easily lets me handwrite stuff I want and paste in maple code?

Right now if I tried my idea, I would basically be constantly copying and pasting stuff from maple and my digitizer drawn pictures/equations into one file and it would be very clumsy.

Basically there are problems that I do partially on maple and I just want to unify all my work into one easy, printable file.

 1 2 3 4 5 Page 1 of 5
﻿