1
$\begingroup$

This question already has an answer here:

I solved a problem of solid mechanics, 11 unknown components of displacement functions, i.e., ut0[x, y], wt0[x, y], wc0[x, y], .... NDSolve gives me results in the form of InterpolatingFunction, e.g.:

ut0[x, y] -> InterpolatingFunction[{{0., 0.02}, {0., 0.02}}, <>][x, y]  
wt0[x, y] -> InterpolatingFunction[{{0., 0.02}, {0., 0.02}}, <>][x, y]

Now, my aim is to use the value of ut0[x, y] and wt0[x,y] in the main displacement equation to evaluate the displacement field, which is of the form:

ut[x_, y_, z_] = ut0[x, y] - (z)(Derivative[wt0[x, y], x]);

I'm new to Mathematica, so I don't know, how to do it. If at all NDSolve has given me is an instance of InterpolationFunction as a polynomial in x and y, it would be easy to use them in other differential equations.

I've spent a lot of time on this website but couldn't help myself.

$\endgroup$

marked as duplicate by xzczd differential-equations Dec 26 '18 at 5:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ @xzczd please help! $\endgroup$ – user2718740 Dec 25 '18 at 9:10
  • $\begingroup$ "@" won't remind people that didn't show up in the comment. For more information check this post: meta.stackexchange.com/a/43020/284701 $\endgroup$ – xzczd Dec 26 '18 at 5:54
3
$\begingroup$

Try

Clear[ut0,wt0];
{ut0,wt0}=NDSolveValue[...,{ut0,wt0},...] 

This gives pure function interpolation objects which can be substituted directly in the differential/integral equation!

Or alternativly use NDSolve (as you probably did?) NDSolve[...,{ut0(*[t]*),wt0(*[t]*)},...] without arguments (*[t]*)

example

Your solution is, if you use NDSolve or NDSolveValue as proposed, something like

sol = {ut0 -> Interpolation[RandomReal[{0, 1}, {10, 3 } ] ], wt0 -> Interpolation[RandomReal[{0, 1}, {10, 3 } ] ]}
(*{ut0 -> InterpolatingFunction[{{0.0356158, 0.948513}, {0.13116,0.819281}}, <>], 
wt0 -> InterpolatingFunction[{{0.0672057, 0.977207}, {0.0017383,0.98284}}, <>]}*)     

Two interpolation objects without arguments which can be substituted in the differential expression

ut0[x, y] - (z) (Derivative[wt0[x, y], x]) /. sol
(*-z Derivative[InterpolatingFunction[{{0.0672057, 0.977207},{0.0017383, 0.98284}}, <>][x, y], x] + 
InterpolatingFunction[{{0.0356158, 0.948513}, {0.13116,0.819281}}, <>][x, y]*)

That's it.

$\endgroup$
  • $\begingroup$ Lists {wt[x,y],u0t[x,y],..,..,..,..,..,..,..,..,..} and {{wt[x,y]->InterpolatingFunction[{{0.,0.02},{0.,0.02}},{5,4225,0,{1281,0},{3,3},0,0,0,0,Indeterminate&,{},{},False},{<<1>>},{0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,<<10>>,7.75909*10^-12,7.64796*10^-12,7.31761*10^-12,6.77712*10^-12,6.0418*10^-12,5.13349*10^-12,4.08163*10^-12,2.92745*10^-12,1.73251*10^-12,6.28647*10^-13,0.,0.,1.67508*10^-12,4.10761*10^-12,6.66591*10^-12,9.11237*10^-12,1.13301*10^-11,1.32413*10^-11,1.47873*10^-11,<<1231>>},{Automatic}][x,y],<<9>>,<<1>>}} are not the same shape. $\endgroup$ – user2718740 Dec 25 '18 at 9:40
  • 1
    $\begingroup$ ??? It would be very helpful if you provide your Mathematica code. Because of missing code my answer only describes the solution idea, not usable code! $\endgroup$ – Ulrich Neumann Dec 25 '18 at 9:50
  • $\begingroup$ Here is the file link Link $\endgroup$ – user2718740 Dec 25 '18 at 10:07
  • $\begingroup$ Sorry I cannot acces the link. Look at my edited answer... $\endgroup$ – Ulrich Neumann Dec 25 '18 at 10:17
  • $\begingroup$ Thanks a lot, Let me give it a try! $\endgroup$ – user2718740 Dec 25 '18 at 10:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.