« first day (2040 days earlier)      last day (2742 days later) » 

zhk
zhk
00:25
@xzczd I want to integrate w w.r.t. x and y and want to keep one parameter for plotting.

Module[{y},
NDSolveValue[{(1 + 0.1*I)*(D[w[y], {y, 2}]) - (Ha^2 + 1*I)*w[y] +
Ha*5 == 0, w[1 + 0.1 Sin[0.1 x]] == 0, w[-1 - 0.1 Sin[0.1 x]] == 0},
w, {y, -1 - 0.1 Sin[0.1 x], 1 + 0.1 Sin[0.1 x]}]]
Any suggestion?
here lambda is 1
 
2 hours later…
02:44
@zhk Using NIntegrate directly should be enough, I think. To speed up the calculation, you may need "SymbolicProcessing" -> 0: mathematica.stackexchange.com/a/118180/1871
Since the variation of w[x,y] is "gentle" you can also consider building a InterpolatingFunction with Interpolation first.
zhk
zhk
@xzczd I tried this
sol[x_, Ha_] :=
Module[{y},
NDSolveValue[{(1 + 0.1*I)*(D[w[y], {y, 2}]) - (Ha^2 + 1*I)*w[y] +
Ha*5 == 0, w[1 + 0.1 Sin[0.1 x]] == 0, w[-1 - 0.1 Sin[0.1 x]] == 0},
w, {y, -1 - 0.1 Sin[0.1 x], 1 + 0.1 Sin[0.1 x]}]]
NIntegrate[
sol[x, 0.5][y], {x, 0, 1}, {y, -1 - 0.1 Sin[0.1 x],
1 + 0.1 Sin[0.1 x]}]

but it gives a warrning
NDSolveValue::ndsv: Cannot find starting value for the variable w.
03:41
@zhk That's merely a warning, if you don't want it, just use:
Clear@sol
sol[x_?NumericQ, Ha_] :=
 Module[{y},
  NDSolveValue[{(1 + 0.1*I)*(D[w[y], {y, 2}]) - (Ha^2 + 1*I)*w[y] + Ha*5 == 0,
    w[1 + 0.1 Sin[0.1 x]] == 0, w[-1 - 0.1 Sin[0.1 x]] == 0},
   w, {y, -1 - 0.1 Sin[0.1 x], 1 + 0.1 Sin[0.1 x]}]]
zhk
zhk
@xzczd but when I do this,
wm[Ha_] :=
NIntegrate[
sol[x, Ha][y], {x, 0, 1}, {y, -1 - 0.1 Sin[0.1 x],
1 + 0.1 Sin[0.1 x]}]
dat = Partition[Flatten[Table[{Ha, Re@wm[Ha]}, {Ha, 0, 1, 0.5}]], 3]

it just give errors no output
@ Is there any other elegant way to do this? its very time consuming. I also used ur suggestion.
it took long but no output
Method -> {Automatic, "SymbolicProcessing" -> 0}
with this ?NumericQ, the process take less time but there is no output
zhk
zhk
04:39
@xzczd For some reason which i dont know, there was a problem with my notebook.
After starting a new one,
Clear@sol
sol[x_?NumericQ, Ha_] :=
Module[{y},
NDSolveValue[{(1 + 0.1*I)*(D[w[y], {y, 2}]) - (Ha^2 + 1*I)*w[y] +
Ha*5 == 0, w[1 + 0.1 Sin[0.1 x]] == 0,
w[-1 - 0.1 Sin[0.1 x]] == 0},
w, {y, -1 - 0.1 Sin[0.1 x], 1 + 0.1 Sin[0.1 x]}]]
NIntegrate[
sol[x, 0.5][y], {x, 0, 1}, {y, -1 - 0.1 Sin[0.1 x],
1 + 0.1 Sin[0.1 x]}]
1.27018 - 0.579235 I
it produces a result quickly, but when i do this,

Table[NIntegrate[
zhk
zhk
05:04
@xzczd The problem was with Ha=0, if we take something close to zero then its working fine. Thx dear
 
2 hours later…
07:33
@zhk Also, don't forget the sol[x_?NumericQ, Ha_] := sol[x, Ha] = trick
zhk
zhk
08:33
@xzczd OK I will not. thx. Any hint for the interpolating function w[x,y,Ha]?
@xzczd here is the final form, its working fine just a little slow
https://www.dropbox.com/s/9zy5tzityvbhagk/mv.nb?dl=0
09:17
Is it just me, or does anyone think it is kind of weird for someone to take a new technique from an answer, and then use it to write new answers to several old questions that are essentially duplicates, instead of to just flag those questions as duplicates?
I didn't flag the duplicates myself because I assumed someone with 3 magnitudes more rep than me knows what they are doing, but I guess I'm the only one who wants to centralize identical resources in one place.
09:37
@hftf Centralization is perfectly fine. As for deciding whether posts are dupes or not, that's why it takes a few (non-mod) people to close. At least you've set up a signpost.
(Also, since you've linked to them, they will now show up in the sidebar, too.)
Thanks. I think they might also have first appeared in the sidebar after I commented on the linked questions, but before I edited the post with the links.
09:51
@zhk The GFW seems to be a bit… tight at the moment so I can't access dropbox now… The interpolation is quite straightforward, just combine Table and ListInterpolation. Remember this needs to be done in a regular region i.e. you need to use a Table similar to the one mentioned here.
@b3m2a1 I enjoyed your blog posts investigating the stack exchange data.
However I might interpret "there are more higher voted questions late at night" as due to "fewer questions are asked during that time, and so they tend to stay up on the front page longer, exposing more people to see it and vote on it". I also wanted to recommend adding axis labels and other such labels to your plots, since it was tough to skim them quickly.
I thought it was a little strange to look for the correlation "peaks in total questions over time vs. new versions of Mathematica" using "functions introduced in specific versions" as a proxy for "questions pertaining to a specific version" - you could easily plot "questions containing the new function's name" using the same dataset instead, right?
 
2 hours later…
11:58
@b3m2a1 Any chance you know why `URLDispatcher` not allowing the `APIFunction` to access the body of a HTTP request. I posted a question on that. Thought of asking you here as you have worked with hosting pages and web services.
 
4 hours later…
15:48
guys can you explain me why if PrimeQ[x] /. Solve[x*(1 + x) == 30 && x >= 0, x, Integers ] evaluate as false when is clearly true? also when i use x/. Solve[] i get a List[List[5]] instead of a simple list, why?
16:07
@Alucard Try running Clear[x]; PrimeQ[x] all by itself.
The nested list is because an equation can have multiple solutions, which Solve[] anticipates; compare Solve[x^2 + 1 == 0, x] and Solve[x + 1 == 0, x].
16:29
@J.M. it still gives me false. let's suppose i want to save the first solution in a variable y:
if i write y /. Solve[y^2 + 1 == 0, y][[1]] i get as output -i but when i write y again mathematica return it unevaluated. what the fuck is happening? i just want to use the first result i get from Solve as a common variable
16:56
Yes, the point is that x is manifestly not a prime, so PrimeQ[] evaluates at once.
@Alucard You didn't do any assignment, only a replacement. So: ys = y /. Solve[y^2 + 1 == 0, y][[1]].
17:27
@J.M. ahh got it , thank you
 
3 hours later…
20:44
@PlatoManiac I think URLDispatcher is some APIFunction like construct (it seems to be less glitchy than it once was). So it does some form of HTTPRedirect rather than configuring actual pages on the cloud servers.
@hftf I definitely could. I have all that data. I'll post some updates when I finish up another little exploration looking at user's answers/questions ratio (motivated by trying to figure out who on this site works for WRI and who doesn't). I've got some other blog ideas I want to explore too, so I can't promise it'll be up this week, but it'll be up pretty soon. If you want to play with the data too, it's really easy to import (e.g. CloudImport["user:b3m2a1/mse_question_list.mx"]).
21:02
@b3m2a1 Hey @b3m2a1 can check the question I posted today....I am totally clueless about what is really going wrong with the body part of the response. mathematica.stackexchange.com/questions/154065/…
The problem is somehow under URLDespatcher it is failing to encode the HTTPResponse body coming from the APIFunction.

« first day (2040 days earlier)      last day (2742 days later) »