Skip to content
Discussion options

You must be logged in to vote

I am quite sure you have not found this in any tutorial:

  uh, ph = solve(solver, op, t0, tF, xh0)
  uh_array = collect(uh)
  uh_final = uh_array[end][2] 

Although solve returns an iterable, caches are reused throughout. This means there is aliasing between different iterations, otherwise the memory costs would be prohibitive. Also the solve method returns (t,x), not (u,p). Unless you go into the source code and develop an understanding of how things work, I would try to follow the tutorials/tests.

fesltn = solve(odeslvr, tfeop, t0, tF, xhs0)
for (t_n, xhs_n) in fesltn
  eh_u = u(t_n) - xhs_n[1]
  e_u = sqrt(sum((eh_n  eh_n) * dΩ))

  eh_p = p(t_n) - xhs_n[2]
  e_p = sqrt(sum((eh_n  e…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Narwal-Pooja
Comment options

Answer selected by Narwal-Pooja
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants