How to export data from Maple to Excel?

Due to a do... for cycle I obtain thes data:

....

> for i from 0 to 10 do x1:=0.1*i: T:=Tx1(x1);print('x1'=x1);y1:=eval((p1s*x1*gamma1)/p); print('y1'=y1);print('T'=T);end do:
                            x1 = 0.
                            y1 = 0.
                        T = 100.0000416
                            x1 = 0.1
                       y1 = 0.4454088320
                        T = 85.93510754
                            x1 = 0.2
                       y1 = 0.4597014971
                        T = 85.41761562
                            x1 = 0.3
                       y1 = 0.4343600675
                        T = 85.92005198
                            x1 = 0.4
                       y1 = 0.4122667776
                        T = 86.09782822
                            x1 = 0.5
                       y1 = 0.4080528845
                        T = 86.09991663
                            x1 = 0.6
                       y1 = 0.4306891136
                        T = 86.42991221
                            x1 = 0.7
                       y1 = 0.4904070733
                        T = 87.60592371
                            x1 = 0.8
                       y1 = 0.6013800104
                        T = 89.96757730
                            x1 = 0.9
                       y1 = 0.7762669037
                        T = 93.42524099
                            x1 = 1.0
                        y1 = 1.000000002
                        T = 97.13963466
                       y1 = 0.7762669038
                        T = 93.42524099
                            x1 = 1.0
                        y1 = 1.000000002
                        T = 97.13963466

Do you know how to export these data to Excel?Cause my problem is to plot T(x1),T(y1),y1(x1) and it is impossible for Maple to define T:=->y1 because the equation is very complex. [I can plot T(x1) cause it is easier]. This is my exercise if you need:

the sistem I have to solve is the sequent:

system of                        p*y1=p1s(T)*x1*gamma1(x1)
                                        {
                                          p*(1-y1)=p2s(T)*(1-y1)gamma2(x1)

So I wrote:

> restart;
> print("1 - ?");
                            "1 - ?"                #unknow fluid
> print("2 - H2O");
                           "2 - H2O"           #water
> A1:=7.74439:                           #experimental data
> B1:=1437.686:
> C1:=198.463:
> A2:=8.07126:
> B2:=1730.63:
> C2:=233.426:
> p:=760:
> A12:=2.7549:
> A21:=0.925:
> p1s:=10^(A1+(-B1/(T+C1))):
> p2s:=10^(A2+(-B2/(T+C2))):
> gamma1:=exp((A12+2*(A21-A12)*(x1))*(1-x1)^2):
> gamma2:=exp((A21+2*(A12-A21)*(1-x1))*(x1)^2):
> Teb1:=evalf(-(B1/(log[10](p)-A1))-C1):print(Tbp1=Teb1);                                     #Boiling Point Temperature of 1, useless
                       Tbp1 = 97.1396347
> Teb2:=evalf(-(B2/(log[10](p)-A2))-C2):print(Tbp2=Teb2);                                     #Boiling Point Temperature of 2, useless
                       Tbp2 = 100.0000416
> gx:= solve(((p1s*x1*gamma1)/p)+((p2s*(1-x1)*gamma2)/p)-1,T):                     #solution of the system
> Tx1:=x1->evalf(RootOf(10^(1/100000*(774439000*_Z+9928887257)/(1000*_Z+198463))*x1*exp(-1/10000*(-27549+36598*x1)*(-1+x1)^2)+10^(1/50000*(201781500*_Z+3835298419)/(500*_Z+116713))*exp(-1/5000*(-22924+18299*x1)*x1^2)-10^(1/50000*(201781500*_Z+3835298419)/(500*_Z+116713))*exp(-1/5000*(-22924+18299*x1)*x1^2)*x1-760)):
> hy:=solve(p1s*x1*gamma1 - p*y1,x1):
> #gy:=solve(p*(1-y1) + p2s*(h-1)*exp((A21+2*(A12-A21)*(1-h))*(h)^2),T):         # this is the complex equation ( I put # )

> Ty1:=y1->evalf(what I'd find from the gy):
> plot([Tx1,Ty1] ,0..1);

Sorry for the very complex reading but I'm an Italian Chemical Engineer student

 

 

 

alec's picture

h

1. The problem with gy is not that it is complicated, but because it contains undefined variable h. If you assigned h to something, there won't be a problem with it.

2. Tx1 and Ty1 can be defined as unapply(gx, x1) and unapply(gy, y1). You don't have to type them manually.

3. For exporting to Excel, instead of for cycle, you can put your data into a Matrix (see an example at the end of that thread), and then either move your mouse over the Matrix, click right button, select Export As and then Tab Delimited, or use ExportMatrix command, see ?ExportMatrix help page.

Alec

Ops it's not h but hy!I

Ops it's not h but hy!I wrong!Sorry, I'll try the Matrix method and I'll send you the results if I have problems...Really ty for answer me...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}