# BH curve

2 months 1 week ago #4620
BH curve was created by lahoussaine
Good morning community;
is there a way to implment bh curve using ngsolve :
i do somthing like
def nuf(u):
return Norm(grad(u))
nu=CoefficientFunction(nuf)
a+=nu*grad(u)*grad(v)*dx
but always i got nan values !
any tricks ?

Please Log in or Create an account to join the conversation.

2 months 1 week ago #4621
Replied by mrambausek on topic BH curve
Dear Lahoussaine,

what is the actual model you want to implement?
"Norm(grad(u))" does not seem to a suitable model in first place, as it leads to a singular matrix for grad(u) = 0.

Best,
Matthias

Please Log in or Create an account to join the conversation.

2 months 1 week ago #4625
Replied by lahoussaine on topic BH curve
I want something like
1/(B**3+B**2+B )
or :
3.8*exp(2.17*B*+396.2

I ve tried those expression but it gives always NAN;

Thankes for your reply

Please Log in or Create an account to join the conversation.

2 months 1 week ago #4626
Replied by mrambausek on topic BH curve
TBH, I have never seen any magnetic model like that (which might not mean a lot...)

I can't see how the first one could give something reasonable for B=0.

Before using a nonlinear model, did you have a working version for a constant "nu"?

I fear, we need much more information to be able to help you.

Best

Please Log in or Create an account to join the conversation.

2 months 1 week ago #4627
Replied by lahoussaine on topic BH curve
def nuf(u):
IfPos(2.28-B,(1/(-0.003995*B**3+0.005956*B**2+0.00646*B + 0.001925)), ((1902.211*B-4266.42343)/0.016694669))

Here is my formule, but it doesn't work
The problem is whenever i put norm( it returns NAN
even if the formula is well defined( 1/(B**2+1) for example )

Thank you and Sorry to not be claire

Please Log in or Create an account to join the conversation.

2 months 1 week ago #4628
Replied by mrambausek on topic BH curve
Unfortunately, I still miss some information: how is "B" defined?
Where does the "Norm" enter in "1/(B**2 + 1)
Which command did you use for assembly? Where exactly do you get NaN? Already in the matrix or only after solving, i.e. in the solution?

Could you maybe post a complete minimal example that reproduces your problem?

Please Log in or Create an account to join the conversation.

Time to create page: 0.165 seconds