Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hello friends,


I try to write a loop in Maple.


The equation is f (x) = x + 3


x is a variable and should be from 50 to 70 with dx = 5 can be used in the function, so that f (x) is to be determined.

How can I write such a loop?

Hi,

I have a problem solving two equations.  They are as follows:

s := 1/(273.16+50); s1 := 1/(273.16+145); s3 := 1/(273.16+250); s2 := 1/(273.16+197.5); gamma0 := 0.1e-3; gamma1 := .5; gamma2 := 0.15e-2; beta := -3800:

c := 300; n := 200; tau1 := 99; tau2 := 120;


Delta := solve(1-exp(-(gam0*tau1+(1/2)*gam1*tau1^2)*exp(beta*s1)) = 1-exp(-(gam0*a+(1/2)*gam1*a^2)*exp(beta*s2)), a);
a := Delta[1];


Theta := solve(1-exp(-(gam0*(a+tau2-tau1)+(1/2)*gam1*(a+tau2-tau1)^2)*exp(beta*s2)) = 1-exp(-(gam0*b+(1/2)*gam1*b^2)*exp(beta*s3)), b);
b := Theta[1];

n1 := int((gam1*t+gam0)*exp(beta*s1)*exp(-(gam0*t+(1/2)*gam1*t^2)*exp(beta*s1)), t = 0 .. tau1);
n22 := (n-n1)*(int((gam1*t+gam0)*exp(beta*s2)*exp(-(gam0*t+(1/2)*gam1*t^2)*exp(beta*s2)), t = a1 .. a1+tau2-tau1));
n2 := eval(n22, a1 = a);
n33 := (n-n1-n2)*(Int((gam1*t+gam0)*exp(beta*s3)*exp(-(gam0*t+(1/2)*gam1*t^2)*exp(beta*s3)), t = b1 .. c));
n3 := eval(n33, a1 = a);
n4 := n-n1-n2-n3;

g1 := -n1*(Int((1/(gam1*t+gam0)-t*exp(beta*s1))*(gamma2*t^2+gamma1*t+gamma0)*exp(beta*s1)*exp(-(gamma0*t+(1/2)*gamma1*t^2+(1/3)*gamma2*t^3)*exp(beta*s1)), t = 0 .. tau1))-n2*(Int((1/(gam0+gam1*(a+t-tau1))-(a+t-tau1)*exp(beta*s2))*(gamma0+gamma1*(a+t-tau1)+gamma2*(a+t-tau1)^2)*exp(beta*s2)*exp(-(gamma0*(a+t-tau1)+(1/2)*gamma1*(a+t-tau1)^2+(1/3)*gamma2*(a+t-tau1)^3)*exp(beta*s2)), t = tau1 .. tau2))-n3*(Int((1/(gam0+gam1*(b+t-tau2))-(b+t-tau2)*exp(s3))*(gamma0+gamma1*(b+t-tau2)+gamma2*(b+t-tau2)^2)*exp(beta*s3)*exp(-(gamma0*(b+t-tau2)+(1/2)*gamma1*(b+t-tau2)^2+(1/3)*gamma2*(b+t-tau2)^3)*exp(beta*s3)), t = tau2 .. c))+(n-n1-n2-n3)*(1/(gam0+gam1*(b+c-tau2))-(b+c-tau2)*exp(s3))*(gamma0+gamma1*(b+c-tau2)+gamma2*(b+c-tau2)^2)*exp(beta*s3)*exp(-(gamma0*(b+c-tau2)+(1/2)*gamma1*(b+c-tau2)^2+(1/3)*gamma2*(b+c-tau2)^3)*exp(beta*s3));

g2 := -n1*(Int((t/(gam1*t+gam0)-(1/2)*t^2*exp(beta*s1))*(gamma2*t^2+gamma1*t+gamma0)*exp(beta*s1)*exp(-(gamma0*t+(1/2)*gamma1*t^2+(1/3)*gamma2*t^3)*exp(beta*s1)), t = 0 .. tau1))-n2*(Int(((a+t-tau1)/(gam0+gam1*(a+t-tau1))-(1/2)*(a+t-tau1)^2*exp(beta*s2))*(gamma0+gamma1*(a+t-tau1)+gamma2*(a+t-tau1)^2)*exp(beta*s2)*exp(-(gamma0*(a+t-tau1)+(1/2)*gamma1*(a+t-tau1)^2+(1/3)*gamma2*(a+t-tau1)^3)*exp(beta*s2)), t = tau1 .. tau2))-n3*(Int(((b+t-tau2)/(gam0+gam1*(b+t-tau2))-(1/2)*(b+t-tau2)^2*exp(s3))*(gamma0+gamma1*(b+t-tau2)+gamma2*(b+t-tau2)^2)*exp(beta*s3)*exp(-(gamma0*(b+t-tau2)+(1/2)*gamma1*(b+t-tau2)^2+(1/3)*gamma2*(b+t-tau2)^3)*exp(beta*s3)), t = tau2 .. c))+(n-n1-n2-n3)*((b+c-tau2)/(gam0+gam1*(b+c-tau2))-(1/2)*(b+c-tau2)^2*exp(s3))*(gamma0+gamma1*(b+c-tau2)+gamma2*(b+c-tau2)^2)*exp(beta*s3)*exp(-(gamma0*(b+c-tau2)+(1/2)*gamma1*(b+c-tau2)^2+(1/3)*gamma2*(b+c-tau2)^3)*exp(beta*s3));


solve({g1 = 0, g2 = 0}, {gam0, gam1});

Warning, solutions may have been lost.

What do I do wrong?

Thanks for advice in advance.

 

Hi there,

I am trying to maximize a function given a set of values to a parameter in the function. The function is an differential equation belonging to a system of two differential equations.

I have a for loop to state different values to the parameter.

Maple yields the error:

Error, (in Optimization:-NLPSolve) cannot evaluate the solution further right of 0.17757507e-4, probably a singularity

When trying to maximize the function.

Supposed that I was doing something wrong in the loop, if I reproduce the contents of the loop outside, and set a value for the parameter. If I plot the solution of the ordinary differential equation, I can see where the maximum lies.

Having plot it, the Optimizamtion:-Maximize works as expected.

However, omitting the plot has a weird effect: I only get the same result depending on the bounds I set for the Maximization:

de1 := diff(A(t), t) = r*m*(1-g)*A(t)-piecewise(t < 8, r*A(t), t >= 8, (r+k)*A(t));
de2 := diff(G(t), t) = r*m*g*A(t)-l*G(t);

ics := A(0) = 25.0, G(0) = 0.;
num := dsolve({de1, de2, ics}, {A(t), G(t)}, type = numeric, output = listprocedure, parameters = [g]);

num(parameters = [g = .15]);
val := eval(G(t), num);

# odeplot(val, [t, G(t)], t = 0 .. 100);


Maximize(val);
Error, (in Optimization:-NLPSolve) cannot evaluate the solution further right of 0.17757507e-4, probably a singularity

val2 := Maximize(val);

Error, (in Optimization:-NLPSolve) cannot evaluate the solution further right of 0.17757507e-4, probably a singularity

val3 := Maximize(val(t), t = 0 .. 60);

  [10267.824035766165, [t = 8.25727747134303]]

val4 := Maximize(val(t), t = 0 .. 100);

[6.863211343195069e-9, [t = 59.84184367042171]]

 

The right answer is [10267.824035766165, [t = 8.25727747134303]]: Why do I get two different answers even if in that range there is only one relative maximum?

I ignore whether the way I am specifying the arguments for the Maximize function is correct. val is a procedure.

 

What am I missing?

Attached is the worksheet: MaplePrimes_malaria_param_variation_2.mw

 

Thanks,

jon

Good day everyone, could you please help use Gauss Elimination method for these system of equations. See the worksheet here F1.mw

Thanks.

restart; with(linalg); with(stats); with(plots); with(Statistics); with(LinearAlgebra); 


s := 1/(273.16+50); s1 := 1/(273.16+145); s3 := 1/(273.16+250); s2 := 1/(273.16+197.5); gamma0 := 0.1e-3; gamma1 := .5; gamma2 := 0.15e-2; beta := -3800;
c := 300; n := 200; tau1 := 99; tau2 := 120;

Delta := solve(1-exp(-(gam0*tau1+(1/2)*gam1*tau1^2)*exp(beta*s1)) = 1-exp(-(gam0*a+(1/2)*gam1*a^2)*exp(beta*s2)), a);
a := Delta[1];


Theta := solve(1-exp(-(gam0*(a+tau2-tau1)+(1/2)*gam1*(a+tau2-tau1)^2)*exp(beta*s2)) = 1-exp(-(gam0*b+(1/2)*gam1*b^2)*exp(beta*s3)), b);
b := Theta[1];

n1 := n*(int((gam1*t+gam0)*exp(beta*s1)*exp(-(gam0*t+(1/2)*gam1*t^2)*exp(beta*s1)), t = 0 .. tau1));
200. - 200. exp(-0.01119474511 gam0 - 0.5541398828 gam1)
n2 := (n-n1)*(int((gam1*t+gam0)*exp(beta*s2)*exp(-(gam0*t+(1/2)*gam1*t^2)*exp(beta*s2)), t = a .. a+tau2-tau1));

g1 := -n1(gam0, gam1)*(int((1/(gam1*t+gam0)-t*exp(beta*s1))*(gamma2*t^2+gamma1*t+gamma0)*exp(beta*s1)*exp(-(gamma0*t+(1/2)*gamma1*t^2+(1/3)*gamma2*t^3)*exp(beta*s1)), t = 0 .. tau1))-evalf(n2(gam0, gam1)*(int((1/(gam0+gam1*(a+t-tau1))-(a+t-tau1)*exp(beta*s2))*(gamma0+gamma1*(a+t-tau1)+gamma2*(a+t-tau1)^2)*exp(beta*s2)*exp(-(gamma0*(a+t-tau1)+(1/2)*gamma1*(a+t-tau1)^2+(1/3)*gamma2*(a+t-tau1)^3)*exp(beta*s2)), t = tau1 .. tau2)))

g2 := -n1*(int((t/(gam1*t+gam0)-(1/2)*t^2*exp(beta*s1))*(gamma2*t^2+gamma1*t+gamma0)*exp(beta*s1)*exp(-(gamma0*t+(1/2)*gamma1*t^2+(1/3)*gamma2*t^3)*exp(beta*s1)), t = 0 .. tau1))-evalf(n2*(int(((a+t-tau1)/(gam0+gam1*(a+t-tau1))-(1/2)*(a+t-tau1)^2*exp(beta*s2))*(gamma0+gamma1*(a+t-tau1)+gamma2*(a+t-tau1)^2)*exp(beta*s2)*exp(-(gamma0*(a+t-tau1)+(1/2)*gamma1*(a+t-tau1)^2+(1/3)*gamma2*(a+t-tau1)^3)*exp(beta*s2)), t = tau1 .. tau2)))

solve({g1 = 0, g2 = 0}, {gam0, gam1})

I want to find the answer of gam0 and gam1. It takes me 20 hours until now...and still evaluating...

Please Help ..

I can't directly copy Maple code into messages but have to insert into Word first, apply some changes that for better readability and copy it from there via Word-paste. Is there a direct way?

there is a solution of equation,so the equation can be divided by the solution,but because the equation is complex,it can't be simplify by the soution,can anyone give me some help?thanks a lot.

a curve has residual p if it is linked, in a complete intersection, to a curve with residual p-1

0 residual if is a complete intersection of two surfaces

do complete intersection means two surfaces totally overlapped?

why they are not the same one if complete intersection?

Hi there,

this may be a common task but did not find any helpful hint nor an answer: is there any way to combine to arrays A and B into another one element-wise, i.e.:
C = [[A[1],B[1]], [A[2],B[2]],...,[A[N],B[N]]]
without doing a for loop?


Thanks,
jon

1. if parametric equations are
x0 = a^4, x1=a^3*b, x2=a^2*b^2, x3=a*b^3, x4=b^4

how to find ideal below

e12 = x0*x2-x1^2
e13 = x0*x3-x1*x2
e14 = x0*x4-x1*x3
e23 = x1*x3-x2^2
e24 = x1*x4-x2*x3
e34 = x2*x4-x3^2

2.
if let y_i = x_i/x0 for i = 1..4
how to find above parametrically by below equations
y1 = b
y2 = b^2
y3 = b^3
y4 = b^4

the functions about vector field plot is so terrible,

is there any method to get it beautiful, like mathematica or matlab?

more options is needed for arrow's position, length, angle and color.

is there a plan for it?

And, the scalar field plot in 2d is better than vector field plot, but in 3d, isosurface plot are still need to be enhanced.

If possible, the plots in Plotting Guide are all need improve.

f := x^2+y-z=0

f2:= y^2 +z-x = 0

after shift , solution shift too, can it be said it is invariant in parameter shift?

if not, any example to show a function which is invariant in parameter shift?

> solve(f);
/ 2 \
{ x = x, y = -x + z, z = z }
\ /
> f2 := y^2+z-x;
2
y + z - x
> solve(f2);
/ 2 \
{ x = y + z, y = y, z = z }
\ /
> f;
2
x + y - z = 0

Hello Maple


I am preparing for an examination in Calculus, but my worksheet in Maple 18 doesn't cooperate. 

A lot of my studypartners use Maple 16 and they have no problems. 


I meet the following error: 

- Error, (in solve) invalid input: hastype expects 2 arguments, but received 1


I'm totally sure, that I'm typing correctly, because I write just the same as my studypartners. 
So is it an error, which only is seen in Maple 18 and can I do anything to solve the problem?

Kind regards
Anders Kristensen

PS: I can't figure out how to add a picture

Hi there,

I would like to have an operator (in this case, the natural logarithm) applied to a list/array of points defined as:

ydata := [0.572594976618e-1, 0.327865007249e-1, 0.280821589546e-1, 0.114365745192e-1, 0.578537931608e-2, 0.139154661062e-2, 0.641467839994e-3, 0.18013801847e-3];

How can I apply Maple's ln() operator to the whole array (i.e. avoid to apply it to ydata [1], ydata [2], etc.)?

Thank you,

jon

 

Hello friends!

I 'm a student and I don't know a lot about Maple, so I would be really grateful if anyone could help me.

I want to solve a system of two equations and I have two unknowns, which are k and εα. However I don't know what I am doing wrong and I can't solve it.

I have attached my file.

Thank you very much in advance!agogos_2.mw

 

First 184 185 186 187 188 189 190 Last Page 186 of 2097