robster

28 Reputation

2 Badges

15 years, 10 days

MaplePrimes Activity


These are answers submitted by robster

puh, never ending story ... f is still e.g. unapply(t+k,t,k) plot3d(Xp+f,0..1,0..1) is working fine, but plot3d(max(0,Xp)+f,0..1,0..1) is not, neither is the equivalent plot3d((Xp+|Xp|)/2+f,0..1,0..1) ? /edit: i guess it is the comparison, 0 to Xp in max, and -Xp to Xp in |.|, that cannot be done. tried sqrt(Xp^2) now and it's giving me what i want. still out of curiosity, what has to be done to get abs and max working? ------------------- next problem ^.^ with axes t and k i'd like to 3d plot the function integral [from 0 to t] Xp + f d(tau) and not the slightest idea how (that means all my tries failed and the help file is of no help at all) /e: most recent development: i modified the expression you brought up, Xp:= unapply(subs(sys,x(t)='X2(t,k)',y(t)='Y2(t,k)',diff(x(t),t)),t,k); into Xq:=unapply(subs(sys,x(t)='X2(t,k)',y(t)='Y2(t,k)', int ( diff(x(t),t) + f(t,k), t=0..T )),T,k); and plot3d(Xq,0..1,0..1) is actually giving me the image i was looking for, but still i am a bit confused that while Xp(2,2) does return a scalar, Xq(2,2) does not. Instead it returns an integral expression (from 0 to 2) including X(t) and Y(t), i don't see why it is not calculated explicitly
mh ok, now since both plot3d(R,t,k) and plot3d(Xq,t,k) return a plot, and plot3d(R+Xq,t,k) does not, the basic question is how to add two functions obtained from the unapply command. /ok, it's working now. i could have sworn i tried it the way you suggested before and it did not work.. anyway, thanks for the answer :-)
thank you very much robert, this is precisely what i needed. now the next obstacle is to 3d-plot the solution x=x(t,k) together with another function in t,k (given explicitly) so, the function i want to plot has basically the following form f(t,k) + x(t,k) , [e.g. f = t + k ] i went for 1. plot3d( f(t,k) + X2(t,k) , t=0..1 , k=0..1) 2. using the unapply function on f: R:=unapply( f(t,k), t,k) and then plot3d( R + Xq, 0..1, 0..1) where Xq is the 'non-derived' equivalent to the Xp you defined, that means Xq:= unapply(subs(sys,x(t)='X2(t,k)',y(t)='Y2(t,k)',x(t)),t,k) but neither of the two nor similar tries worked out so far... could you point me in the right direction once more? thank you very much.
to make the problem more understandable: Since the ODEsystem does not have an explicit solution, I checked [dsolve,numeric] in the help file. The example there is dsys := {x(0) = 1, y(0) = 0, diff(x(t), t) = y(t), diff(y(t), t) = -x(t)} dsn1:=dsolve(dsys,numeric): dsn1(1) [t = 1., x(t) = 0.540302331775852962, y(t) = -0.841471101157619694] What I need is a command which returns the x(t) entry in the upper line, as a function in t - so that i can for instance plot its derivate. As for the parameter, I checked the [dsolve,numeric,interactive (parameters)] help file. Say i use dsolve({parameterized system}, numeric, parameters = [k]) Again, how do I extract the x(t) solution of the system, subject to both t and the parameter k, so that I can plot the function diff(x(t,k),t) against t and k?
Page 1 of 1