Maple 16 Questions and Posts Maple 16 Questions and Posts Feed

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

I plot a curve with "plot" command, how to export the figure to .emf format file?

Hi, the title isn't great as I didn't know how to describe this really. I need to solve the following equation for b:

y = (1-exp(-x*b))/(1-exp(-50*b))

When I put a value for y in, this is fine and fsolve gives me a numeric real solution. However, even when using RealDomain, it does not give me a real solution if I leave y as it is, and instead gives a 'RootOf' solution, which I don't really understand. This is the same whether using solve or isolate:

b=-(1/50)RootOf(_Zx-50ln(-y+ye^(_Z)+1))

I have the values of x and y for multiple data points and can put them in an nx1 matrix. Is there a way to replace x and y with matrices (with real numbers in) and solve for each set of points for b (ie there would be n values of b)? Obviously I could go through and put in each value of x and y but this would take ages, so was just wondering if there's a quick way to do this.

I have tried by simply putting matrices instead of the letter but get the error:

Error, invalid input: exp expects its 1st argument, x, to be of type algebraic, but received Vector(50, {(1) = -50*b, (2) = -49*b,...

Thanks for your time

James

I suppose you would have to programme this, because I couldn't find anything relating to vector spaces in my Maplesoft Linear Algebra tutor or package.

My question really is, you have a problem like, the set of all pairs of real numbers of the form (1,x) with the operations (1,y)+(1,y')=(1,y+y') and k(1,y)=(1,ky) 

( ^ taken straight out of my homework haha)

and you run through the 10 vecctor space axioms to determine whether it fails and it not a vector space, or it passes all and it is a vector space.

 

Is there a way to do this in Maplesoft?

 

Hell

I write this code and didn't work , I have some erorrs as

Warning, The use of global variables in numerical ODE problems is deprecated, and will be removed in a future release. Use the 'parameters' argument instead (see ?dsolve,numeric,parameters)
Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up

also I have question " How I can change the scale of plot"

parameters := [z = 0, Omega = 2.2758, tau = 13.8, T2 = 200, omega0 = 1, r = .7071, s = 2.2758, H = 1.05457173*10^(-34), omega = .5, k = 1666666.667, Delta = 1.7758]

 

sys1 := {diff(u(t), t) = s*v(t)-u(t)/T2, diff(v(t), t) = -s*u(t)-2*Omega*exp(-r^2/omega0^2-t^2*1.177^2/tau^2)*cos(kz-`ωt`)*w(t)-v(t)/T2, diff(w(t), t) = 2*Omega*exp(-r^2/omega0^2-t^2*1.177^2/tau^2)*cos(kz-`ωt`)*v(t)}; ICs1 := {u(-20) = 0, v(-20) = 0, w(-20) = -1}

 

ans1 := dsolve(`union`(eval(sys1, parameters), ICs1), numeric, output = listprocedure); plots:-odeplot(ans1, [[t, u(t)], [t, v(t)], [t, w(t)]], t = -20 .. 20, legend = [w, v, u])

 

U := eval(u(t), ans1); F := eval(((-2*10^33*Omega*H*r*U(t))*(1/omega0^2))*exp(-r^2/omega0^2-t^2*1.177^2/tau^2)*cos(kz-`ωt`), parameters)

 

plot(F, t = -20 .. 20)

Hi,

Please help me in solving system consist the three differential equations with three unknowns. I did already a few attempts, but I can not finish. Once in the final result was got RootOf and do not know what to do. I tried also numerically. I very very ask for some suggestions: ( 

with the boundary condition

parameters A,B,C are constans

 

1)

qa1 := A1*(diff(Tg(x), x, x))+A2*(diff(Tg(x), x))+(A3+A4)*Tg+A3*Tz+A4*Tw = 0;

eqa2 := B1*(diff(Tw(x), x, x))+B2*(diff(Tw(x), x))+(B3+B4)*Tw+B3*Tz+B4*Tg = 0;

eqa3 := C1*(diff(Tz(x), x, x))+(C3+C4)*Tz+C3*Tg+C4*Tw = 0

2)

On paper, the system of three equations with three unknowns I changed to system of two equations with two unknowns but still nothing. 

A[1] := 2, 

eqa1 := A[1]*C[1]*(diff(z(x), x, x, x, x))/C[3]+A[2]*C[1]*(diff(z(x), x, x, x))/C[3]+(A[1]*C[3]+A[1]*C[4]+A[3]*C[1]+A[4]*C[1])*(diff(z(x), x, x))/C[3]+(A[1]*C[3]+A[1]*C[4])*(diff(z(x), x))/C[3]+(A[3]*C[3]+A[3]*C[4]+A[4]*C[3]+A[4]*C[4]+A[3]*C[3])*z(x)/C[3]+A[1]*C[4]*(diff(y(x), x, x))/C[3]+A[2]*C[4]*(diff(y(x), x))/C[3]+(A[3]*C[4]+A[4]*C[4]+A[4]*C[3])*y(x)/C[3] = 0;

eqa2 := B[4]*C[1]*(diff(z(x), x, x))/C[3]+(B[4]*C[3]+B[4]*C[4]+B[3]*C[3])*z(x)/C[3]+B[1]*(diff(y(x), x, x))+B[2]*(diff(y(x), x))+(B[4]*C[3]+B[4]*C[4]+B[3]*C[3])*y(x)/C[3] = 0;

row := eqa1, eqa2;

sol := dsolve({row}, {y(x), z(x)});

 

Thank you very much for your help.

Ewa.

Dear Maple users,

 

i have a set of 2 Lines: L1 (determined by the intersection of plane x + y -1=0 and plane x - z - 1=0), 

L2 ( intersection of plane x + y-7=0 and plane x-y+1 = 0 ).

which functions or commands of maple should I use "visualize" those 2 lines L1 and L2?

 

thanks for your help,

 

JJ

Hallo guys,

I am newbie in Mapple, i could not solve the problem yet, here is my little function. I want to estimate beta with the Maximum Likelihood Estimation with Weibull: 

> MaximumLikelihoodEstimate(Weibull(beta, eta), F1); F1 := Vector([1500, 1750, 2250, 4000, 4300, 5000, 7000]);
print(`output redirected...`); # input placeholder
[beta = HFloat(HFloat(undefined)), eta = HFloat(HFloat(undefined))

]

 

May someone help me why i just get HFloat(undefined)  ?

 

Kind regards

Solve This Equation...

February 14 2014 Ratch 211

Can anyone tell me how to solve the equation above using Maple.  I know that there is a solution around x=0.995, y=0.743, but I cannot induce Maple to find it.  Any help or suggestions would be appreciated.

Ratch

 

I'm simplifying this Reynolds Equation starting from here:

Reynolds:=Diff(p(x)*h(x)^3/(12*mu)*Diff(p(x),x),x)-u(x)/2*Diff(p(x)*h(x),x)+Diff(p(x)*h(x)^3/(12*mu)*Diff(p(x),z),z)=Diff(p(x)*h(x),t):

 

Then I apply the dchange command:

dchange({p(x)=P(X)*Pa,x=Lx*X,h(x)=H(X)*h2},Reynolds,{P,h,X,u,H});

 

The problem is that it expands the new derivatives and I need the equation in its compact form.

How do I tel Maple only to make the substitution but not to expand the result?

I know that it expands by default, can I modify that?

 

 

In ode solve command i generated a large array data. The output shows a large order matrix of this form

 

[110001x6 Matrix

Datatype:Anything

Storage:rectangular

order:Fortran_order].

 

I want to export this matrix into a notepad. Which can then be used for plotting in TecPlot. 

 

Looking for good response

 

 

Optimization Homework Help...

February 08 2014 Dira 20

I want to begin by saying hello! im new to the forums i hope some one can give me a push in the right direction with some of my maple homework. im sort of stuck on a few of these questions and would be greatfull for some help. 

 

Let .

a) Let g be the tangent line to f when x = c. Use Maple to find g as a function of c.

b) Use Maple to plot f and g(3) using view = [0..5, -25..100].

c) Define a function called plot_tan that plots both f and g(c) where f is blue and g(c) is red. Also use the same view as in part (b). Note that plot_tan is also a function of c.

d) Using your function plot_tan, the following all in one graph using the display command:

plot_tan(1), plot_tan(1.5), plot_tan(2), plot_tan(2.5), plot_tan(3), plot_tan(3.5), plot_tan(4), plot_tan(4.5), plot_tan(5).

e) Try using the option insequence = true in the display command. What does this option do? (You will need to click on the graph and play around with some buttons).

now it seems to me i have to use the point slope formula to get to a fuction g of c. thanks in advance! i hope you can help

 

Data.xlsx

XY.mw

XYZ.mw

 

Hello,

I'm using the Global Optimization Toolbox to solve some examples and fit equations to a given data, finding "unknown" parameters. I generated the data on Excel, and I already know the values of these parameters.

The XY case is (there is no problem here, I just put as a example I follow):

> with(GlobalOptimization);
> with(plots);

> X := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "I5:I25");
> Y := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "J5:J25");

> XY := zip( (X, Y) -> [X, Y] , X, Y);
> fig1 := plot(XY, style = point, view = [.9 .. 3.1, 6 .. 40]);


> Model := A+B*x+C*x^2+D*cos(x)+E*exp(x):
> VarInterv := [A = 0 .. 10, B = 0 .. 10, C = -10 .. 10, D = 0 .. 10, E = 0 .. 10];

> ModelSubs := proc (x, val)

    subs({x = val}, Model)

    end proc;


> SqEr := expand(add((ModelSubs(x, X(i))-Y(i))^2, i = 1 .. 21));
> CoefList := GlobalSolve(SqEr, op(VarInterv), timelimit = 5000);

> Model := subs(CoefList[2], Model):

 

I could find the right values of A, B, C, D and E. 

 

My problem is in the XYZ case, where I don't know how to "write" the right instruction. My last attempt was:

> with(GlobalOptimization);
> with(plots);

> X := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "Q5:Q25"); X2 := convert(X, list);
> Y := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "R5:R25"); Y2 := convert(Y, list);
> Z := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "S5:S25"); Z2 := convert(Z, list);
> NElem := numelems(X);

> pointplot3d(X2, Y2, Z2, axes = normal, labels = ["X", "Y", "Z"], symbol = box, color = red);

 

> Model := A*x+B*y+C*sin(x*y)+D*exp(x/y);

> VarInterv := [A = 0 .. 10, B = 0 .. 10, C = 0 .. 10, D = 0 .. 10];

> ModelSubs:=proc({x,y},val)

subs({(x,y)=val},Model)

end proc:
Error, missing default value for option(s)

> SqEr := expand(add((ModelSubs(x, y, X(i), Y(i))-Z(i))^2, i = 1 .. NElem));
> CoefList := GlobalSolve(SqEr, op(Range), timelimit = 5000);
Error, (in GlobalOptimization:-GlobalSolve) finite bounds must be provided for all variables

 

My actual problem involves six equations, six parameters and four or five independent variables on each equation, but I alread developed a way to solve two or more equations simultaneously.

Thanks

Hello,

I'm using the Global Optimization Toolbox to solve some examples and fit equations to a given data, finding "unknown" parameters. I generated the data on Excel, and I already know the values of these parameters.

The XY case is (there is no problem here, I just put as a example I follow):

> with(GlobalOptimization);
> with(plots);

> X := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "I5:I25");
> Y := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "J5:J25");

> XY := zip( (X, Y) -> [X, Y] , X, Y);
> fig1 := plot(XY, style = point, view = [.9 .. 3.1, 6 .. 40]);


> Model := A+B*x+C*x^2+D*cos(x)+E*exp(x):
> VarInterv := [A = 0 .. 10, B = 0 .. 10, C = -10 .. 10, D = 0 .. 10, E = 0 .. 10];

> ModelSubs := proc (x, val)

    subs({x = val}, Model)

    end proc;


> SqEr := expand(add((ModelSubs(x, X(i))-Y(i))^2, i = 1 .. 21));
> CoefList := GlobalSolve(SqEr, op(VarInterv), timelimit = 5000);

> Model := subs(CoefList[2], Model):

 

I could find the right values of A, B, C, D and E. 

 

My problem is in the XYZ case, where I don't know how to "write" the right instruction. My last attempt was:

> with(GlobalOptimization);
> with(plots);

> X := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "Q5:Q25"); X2 := convert(X, list);
> Y := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "R5:R25"); Y2 := convert(Y, list);
> Z := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "S5:S25"); Z2 := convert(Z, list);
> NElem := numelems(X);

> pointplot3d(X2, Y2, Z2, axes = normal, labels = ["X", "Y", "Z"], symbol = box, color = red);

 

> Model := A*x+B*y+C*sin(x*y)+D*exp(x/y);

> VarInterv := [A = 0 .. 10, B = 0 .. 10, C = 0 .. 10, D = 0 .. 10];

> ModelSubs:=proc({x,y},val)

subs({(x,y)=val},Model)

end proc:
Error, missing default value for option(s)

> SqEr := expand(add((ModelSubs(x, y, X(i), Y(i))-Z(i))^2, i = 1 .. NElem));
> CoefList := GlobalSolve(SqEr, op(Range), timelimit = 5000);
Error, (in GlobalOptimization:-GlobalSolve) finite bounds must be provided for all variables

 

My actual problem involves six equations, six parameters and four or five independent variables on each equation, but I alread developed a way to solve two or more equations simultaneously.

Thanks.

Plotting a Spline...

February 03 2014 Leo BN 5

Hello, Mapleprimes' users.

 

I am using spline to fit a function to a given data (instead of polynomial). I created two examples with data of y=cos(x). 

The first example has a domain X=0..10 and its result is satisfactory.

Ths second example has a larger domain, X=0..15, but I couldn't plot the spline function. The function fits well, but its line ends at X=~10.

Then I ckecked this spline assigning several values of X, and all the results are correct. The problem is on the plot step.

My mw file is:

> restart;
> with(plots);
> with(CurveFitting);
> plotsetup(default);

First Exemple Data (Y=cos(X)):
> X := [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
> Y := [1, .54, -.41, -.99, -.65, .28, .96, .75, -.14, -.91, -.83];
> Piece1 := spline(X, Y, x, 2);
> fig1 := plot(Piece1, view = [0 .. 15, -1 .. 1]);
> fig2 := pointplot(X, Y);
> display(fig1, fig2);
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Second Example Data (Y=cos(X))::
> X := [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
> Y := [1, .54, -.41, -.99, -.65, .28, .96, .75, -.14, -.91, -.83, 0., .84, .91, .13, -.76];
> Piece2 := spline(X, Y, x, 2);
> fig3 := plot(Piece2, view = [0 .. 15, -1 .. 1]);
> fig4 := pointplot(X, Y);
> display(fig3, fig4);
> test := unapply(Piece2, x);
> test(15);

    test(15)=-0.76    #correct value!
 

 

My actual problem involves data from X=0 to X=300, and I have the same issue in this case.

Thanks.

When attempting to use algsubs with a subscripted expression involving powers I am running into a problem.

I have assigned a numerical value to n, and I have a symbol subscripted with n+1 and raised to a power.

In the original expression I have a factor of the form: P^q + R_n^q which I should like to replace with the symbol B.

> n:= 2

> P^q + R_(n+1)^q

> algsubs(P^q + R_(n+1)^q = B, %)

This last input leads to the error message:

Error, (in algsubs) no variables appearing rationally in pattern.

If I attempt to use algsubs on a subscripted symbol which is not raised to a power, the result works. Is there a cure?

Thanks in advance.

1 2 3 4 5 6 7 Last Page 2 of 34