You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, i not managed to find solution for this issue.
When i run this code:
using LsqFit
Ms=70/4000
H=4000
mu=(4/3)*pi*((4.0E-9)^3)
sigma=0.3*mu
Kb=1.38E-23
Ku=24000
M=800/4000
langiv(x)=(coth(x)-1/x)
function Mzfc(T,prms)
count=10000
M=prms[1]
Ku=prms[2]
Vc=(25)*Kb*T/Ku
temp=Array(Float64,count)
V=linspace(mu-3.2*sigma,mu+3.2*sigma,count)
res=0
for i in 1:count
if V[i]<Vc
temp[i]=Ms*langiv((M*V[i]*H)/(T*Kb))*exp(-(V[i]-mu)*(V[i]-mu))/sqrt(2*pi*sigma*sigma)
else
temp[i]=Ms*H*M./(3.*Ku)*exp(-(V[i]-mu)*(V[i]-mu))/sqrt(2*pi*sigma*sigma)
end
end
for i in 2:count
res=(temp[i-1]+temp[i])*(V[i]-V[i-1])/2+res
end
return res
end
T=linspace(5,405,401)
res=Array(Float64,length(T))
params=[M,Ku]
for i in 1:401
res[i]=Mzfc(T[i],params)
end
fit=curve_fit(Mzfc,T,res,[0.5,20000])
It results in error:
MethodError: `isless` has no method matching isless(::Float64, ::LinSpace{Float64})
Closest candidates are:
isless(::Float64, ::Float64)
isless(::AbstractFloat, ::AbstractFloat)
isless(::Real, ::AbstractFloat)
...
in < at operators.jl:33
in Mzfc at In[7]:22
in f at /home/vlad/.julia/v0.4/LsqFit/src/curve_fit.jl:39
in levenberg_marquardt at /home/vlad/.julia/v0.4/LsqFit/src/levenberg_marquardt.jl:62
in lmfit at /home/vlad/.julia/v0.4/LsqFit/src/curve_fit.jl:30
in curve_fit at /home/vlad/.julia/v0.4/LsqFit/src/curve_fit.jl:40
Looks like i do something wrong and it somehow connected with my integration inside function.
The text was updated successfully, but these errors were encountered:
Hello, i not managed to find solution for this issue.
When i run this code:
It results in error:
Looks like i do something wrong and it somehow connected with my integration inside function.
The text was updated successfully, but these errors were encountered: