farazhedayati

120 Reputation

5 Badges

7 years, 112 days

MaplePrimes Activity


These are replies submitted by farazhedayati

@Rouben Rostamian  

 

Thanks again Rouben. 

The last couple lines, the value of C_2 varies with each input. in your code:

c_2(my_x, my_xbar,1) is 0.00069

c_2(my_x, my_xbar,9) is 0.00076

c_2(my_x, my_xbar,17) is 0.0007

 

I am looking the sum of these numbers from 1 to length of my input

 

Thanks a lot for helping me 

 

@Rouben Rostamian  

 

Thanks Rouben. Please consider Xbar and x[i] as independent variables. like x and y.

Xbar is obtained from a different series of measurments.

My question boils down to:

How can I subtitute x in c1 and c2.

 

Thanks

@tomleslie 

English is my second language and Im learning it. I thought its clear! you can simply say you dont want to/cant/... help. These are some lines from a larger code and some of these "crap" will be used later.

Anyways thank you for your time :)

@tomleslie 

 

I dont know where is the problem when I change your code. I have attached the modification. I simply multiply the integral by a function but cannot get the results.

Really appreciate your time

integral.mw

 

@Markiyan Hirnyk 

 

Thanks man. you saved me.

@Preben Alsholm 

I ran the code for different functions and plotted the contour plots. Coppied and pasted in a new worksheet and then the next function and the next contour plots. 

Doing this for years and first time facing this issue. Very disappointed Maple! Very! 

 

Thank you for your time tho. Appreciate the time you put to help me. 

@Carl Love 

 

many thanks for your attention Carl 

@Kitonum 

I dont know why it doesnt work for me! here is my function

PP:=0.3800179925e-3*exp(-0.6065722618e-3*(x-29.51704536)^2+(0.6650093594e-3*(x-29.51704536))*(a-12.94061928)-0.1106850312e-2*(a-12.94061928)^2)

 

I simply copied and pasted the procedure to a maple sheet and substitute x^2+y^2 with PP! Is it a wrong way? help me please

Thanks for your attention 

 

 

@tomleslie 

Thats why I love phoroshop! lol 

Thanks any way :) 

@Doug Meade 

 

Awesome. Problem solved. 
Thanks a lot :) 

@Kitonum 

 

Thanks for your reply. Im taking the 3d graph. change rho and see what happens to the 3d graph. Maybe the coefficient of (x-constant)*(a-constant) gets large ( in the exponential) abd maple fails to plot. I have attached two pictures to show what I mean.

 

when rho increases, maple plots several pics! 

thank you

@acer 

 

Thanks for your great help.

 

How can I change the colors? 

The colors appear are not different enough, it may be confusing. I need more distinct colors. I changed c1 to

c1:=[Color("#123456")[]]: still in a same color family. I am seeking for more obvious change in colors,

 

thanks again

 

@Christopher2222 

 

Thanks Chris for your attention. 

I cant get the results. I would be grateful if you help me to know what is the problem. I despretly need some help from a pro. I have uploaded the file.

Thanks  

heartview_-_Copy.mw


``

restart

rho := -.1069;

-.1069

(1)

Meanx := 338.8235*.3048;

103.2734028

(2)

Meana := 3.8235*6.4516;

24.66769260

(3)

stda := 3.9857*6.4516;

25.71414212

(4)

stdx := 107.3832*.3048;

32.73039936

(5)

z := (x-Meanx)^2/stdx^2-2*rho*(x-Meanx)*(y-Meana)/(stdx*stda)+(y-Meana)^2/stda^2;

0.9334636080e-3*(x-103.2734028)^2+0.2540296188e-3*(x-103.2734028)*(y-24.66769260)+0.1512362570e-2*(y-24.66769260)^2

(6)

PP := exp(-z/(2*(-rho^2+1)))/((2*3.1415)*stda*stdx*sqrt(-rho^2+1));

0.1901977423e-3*exp(-0.4721270882e-3*(x-103.2734028)^2-0.1284830637e-3*(x-103.2734028)*(y-24.66769260)-0.7649225212e-3*(y-24.66769260)^2)

(7)

 

evalf(int(int(PP, y = 0 .. infinity), x = 0 .. infinity));

.8305932673

(8)

PPP := PP/%;

0.2289902288e-3*exp(-0.4721270882e-3*(x-103.2734028)^2-0.1284830637e-3*(x-103.2734028)*(y-24.66769260)-0.7649225212e-3*(y-24.66769260)^2)

(9)

``

plot3d(PPP, x = 0 .. 200, y = 0 .. 110, labels=["x(m)","a(cm^2)","PDF(x,a)"]);


 

ContoursWithLabels := proc (Expr, Range1::(range(realcons)), Range2::(range(realcons)), Number::posint := 8, S::(set(realcons)) := {}, GraphicOptions::list := [color = black, axes = box], Coloring::`=` := NULL) local r1, r2, L, f, L1, h, S1, P, P1, r, M, C, T, p, p1, m, n, A, B, E; f := unapply(Expr, x, y); if S = {} then r1 := rand(convert(Range1, float)); r2 := rand(convert(Range2, float)); L := [seq([r1(), r2()], i = 1 .. 205)]; L1 := convert(sort(select(proc (a) options operator, arrow; type(a, realcons) end proc, [seq(f(op(t)), t = L)]), proc (a, b) options operator, arrow; is(abs(a) < abs(b)) end proc), set); h := (L1[-6]-L1[1])/Number; S1 := [seq(L1[1]+(1/2)*h+h*(n-1), n = 1 .. Number)] else S1 := convert(S, list) end if; print(Contours = evalf[2](S1)); r := proc (k) options operator, arrow; rand(20 .. k-20) end proc; M := []; T := []; for C in S1 do P := plots:-implicitplot(Expr = C, x = Range1, y = Range2, op(GraphicOptions), gridrefine = 3); P1 := [plottools:-getdata(P)]; for p in P1 do p1 := convert(p[3], listlist); n := nops(p1); if n < 500 then m := `if`(40 < n, (r(n))(), round((1/2)*n)); M := `if`(40 < n, [op(M), p1[1 .. m-11], p1[m+11 .. n]], [op(M), p1]); T := [op(T), [op(p1[m]), evalf[2](C)]] else if 500 <= n then h := floor((1/2)*n); m := (r(h))(); M := [op(M), p1[1 .. m-11], p1[m+11 .. m+h-11], p1[m+h+11 .. n]]; T := [op(T), [op(p1[m]), evalf[2](C)], [op(p1[m+h]), evalf[2](C)]] end if end if end do end do; A := plot(M, op(GraphicOptions)); B := plots:-textplot(T); if Coloring = NULL then E := NULL else E := ([plots:-densityplot])(Expr, x = Range1, y = Range2, op(rhs(Coloring))) end if; plots:-display(E, A, B) end proc:

``

ContoursWithLabels(PPP, -1 .. 200, -1 .. 110, thickness = 3)

Error, (in ContoursWithLabels) invalid input: rand expects its 1st argument, r, to be of type {posint, integer .. integer}, but received -1. .. 200.

 

``

``

``

``


Download heartview_-_Copy.mw

@Carl Love 

Thanks again and again ...

restart;

n:=20;
m:=1;
cc:=-200;
zzeta:=0.1;
sefr1:=0.3;
sefr:=0.2;
MM:=0;
lambda:=0.1;
Br:=1;
nn:=3;



u(tau):=421.7129935*tau-2217.587728*tau^2+8897.376593*tau^3-27612.59182*tau^4+64248.00336*tau^5-1.083977605*10^5*tau^6-10.57029600-1.080951714*10^6*tau^13+7.999517316*10^5*tau^14-4.788741005*10^5*tau^15+2.309563748*10^5*tau^16+26511.11102*tau^18-5959.001794*tau^19+1.148523882*10^5*tau^7-95.23809524*tau^21+4.545454545*tau^22-9435.563781*tau^8-2.587683745*10^5*tau^9+6.473880128*10^5*tau^10+948.0272727*tau^20-88660.41892*tau^17-1.008692404*10^6*tau^11+1.175504242*10^6*tau^12;


B := 1+(2*(1-zzeta))*Br*(int(tau*(diff(u(tau), tau))^2, tau = (1/2)*zzeta*(1-zzeta) .. 1/2*(1-zzeta)));
eq4 := 4*B*u(tau)-(1+zzeta)*(diff(tau*(diff(theta(tau), tau)), tau))/tau-(1+zzeta)*Br*(diff(u(tau), tau))^2;


theta(tau):=sum(p^ii*theta[ii](tau),ii=0..nn);
HH:= p*((4*(1+(2*(1-zzeta))*Br*(int(tau*(diff(u(tau), tau))^2, tau = (1/2)*zzeta*(1-zzeta) .. 1/2-(1/2)*zzeta))))*u(tau)-(1+zzeta)*(diff(theta(tau), tau)+tau*(diff(theta(tau), tau, tau)))/tau-(1+zzeta)*Br*(diff(u(tau), tau))^2)+(1-p)*(diff(theta(tau),tau$2)):
eq5:=simplify(HH):
eq6:=collect(expand(eq5),p);

eq7:=
convert(series(collect(expand(eq5), p), p, nn+1), 'polynom');


for ii to nn do
ss[ii] := (coeff(eq7, p^ii)) ;
print (ii);
end do;

ss[0]:=diff(theta[0](tau), tau, tau);

icss[0]:=theta[0](0)=0, D(theta[0])(1)=1;

dsolve({ss[0], icss[0]});
theta[0](tau):= rhs(%);


for ii to nn do
ss[ii]:=(ss[ii]);
icss[ii]:=theta[ii](0)=0, D(theta[ii])(1)=0;
dsolve({ss[ii], icss[ii]});
theta[ii](tau):=value(rhs(%));
end do;





theta(tau):=evalf[10](sum((theta[jj])(tau),jj=0..nn));
> plot(, tau = .1 .. 1);

1 2 Page 1 of 2