Answered
solve ode with ode45
Comment out t = [0 5] before calling ode45 in the loop: %t = [0 5];

2 years ago | 0

Answered
Why does solving my equation result in the message "No complex subexpressions allowed in real mode."?
Next time, please report the real problem right at the beginning. %loading the constants eps_w = load('eps_w.mat'); eps_w = e...

2 years ago | 0

Answered
I want 4 solid lines for Fr paramter . but im getting single line why?
S_a() function S_a %%%%note%%%%%%%%% %%%%%%%%%%%%%%%%% decreasing behaviour with F...

2 years ago | 0

| accepted

Answered
two layer transient conduction heat transfer with pde
The boundary condition for pdepe reads p + q*f = 0. In your case this leads to hr_int * (urMax - ul) + k1*k1/(rho1*Cp1)*dT/dx...

2 years ago | 1

Answered
solve a second-order differential equation using finite differences, I keep encountering the 'Index exceeds the number of array
Replace your functions by p.m % p.m function result = p(t) result = 2 * t ./ (1 + t.^2); end q.m % q.m function re...

2 years ago | 0

Answered
Why does solving my equation result in the message "No complex subexpressions allowed in real mode."?
Why don't you simply solve for pw ? pw = (eps_exp^(1/3) - eps_l^(1/3))/(eps_w^(1/3)-eps_l^(1/3)) Note that you use eps_w^(1.3)...

2 years ago | 0

Answered
for loop in bvp4c i get circle in plotting not solid line why?
sss() function sss global Fr Pr f2 f1 shi2 shi3 lambda zeta Sk u Re Kf B A H1 H2 H3 C1 C2 C3 P1 P2 P3 K1 K2 K3 Kb n Z ...

2 years ago | 0

| accepted

Answered
Please help me in solving the given coupled differential equation? Please also tell me the numerical recipe availabe in matlab for handling such equations.
MATLAB has no tools to solve this kind of equations. I guess they are hyperbolic in nature - so take a look at CLAWPACK: https...

2 years ago | 0

Answered
Solve differential and algebraic equation system
S_1 and q_j are symbolic functions. You have to convert them to numerical functions first (by "MatlabFunction") to use them with...

2 years ago | 1

| accepted

Answered
Trouble printing more than one set of data on plot after solving system of odes
Call ode15s three times: the first time to compute the solution for A and R with M(1), the second time with M(2) and the third t...

2 years ago | 1

| accepted

Answered
Trouble printing more than one set of data on plot after solving system of odes
Call ode15s three times: the first time to compute the solution for A and R with M(1), the second time with M(2) and the third t...

2 years ago | 0

Answered
Please help me solve this material balance
This is a typical problem for MATLAB's "pdepe". So I suggest you use this integrator for partial differential equations.

2 years ago | 2

| accepted

Answered
Error function optimisation method to calculate the velocity of a travelling wave
For each of the 200 times, extract the node number where your solution equals 0.5. Plot node number as a function of time. The s...

2 years ago | 1

Answered
How do I find a conditional pdf?
Generate random numbers for l0 and l2 that follow the distributions given. Duduce l1 and use histogram to plot its pdf. Look up...

2 years ago | 0

| accepted

Answered
Find all possible roots of transcendental function
Really all zeros ? Then you cannot save them in any array since for each u and xi, you get an infinite number of them. Is the fu...

2 years ago | 0

Answered
Why does the command window say "Array indices must be positive integers or logical values" when this code is executed?
Maybe you mean (p*(r/12)) instead of (p(r/12)) ?

2 years ago | 0

| accepted

Answered
How to solve such integrations on MATLAB?
Invest a little time and deduce z^(3*n-1)/(1-z^(2*n)) = -z^(n-1) + 0.5*z^(n-1)/(1-z^n) + 0.5*z^(n-1)/(1+z^n) This function can...

2 years ago | 0

| accepted

Answered
the fitted data is far from the origin data in power function by lsqcurvefit
The initial guesses for the parameters are very important for convergence. I deduced them from the linearized model log(Y0) = l...

2 years ago | 0

| accepted

Answered
Global variables to plot variables from ODE45 function
t < pi/2 is necessary: syms t x(t) eqn = diff(x,t) == x^2*cos(t); conds = x(0)==1; dsolve(eqn,conds) tspan= 0:.01:10; x=1;...

2 years ago | 0

Answered
Does MATLAB considers poles while COMPLEX integrating a function?
How should it consider it if you ask MATLAB for an antiderivative to a function ? Should it additionally list the poles ? An an...

2 years ago | 0

Answered
为什么显示要串联的数组的维度不一致?
As you can see in your code above, f1f+g1*(unew1-u1f)+L1*(x1-x1f) f2f+g1*(unew2-u2f)+L1*(x2-x2f) f3f+g1*(unew3-u3f)+L1*(x3-x3...

2 years ago | 0

| accepted

Answered
How to find two unknown variables in explicit function?
You overwrite z - the 2-element input vector to your function eqns - by setting z=4;

2 years ago | 1

| accepted

Answered
Solve the Pendulum problem 2θ¨=-2sinθ-3θ˙
Write your equation as a system of two first-order equations and use ode45 to solve.

2 years ago | 1

Answered
Matrix to Scalar Problem
x=C*exp(-Damp_Coef*W*t).*cos(Wd*t-alfa);

2 years ago | 0

Answered
I have a MATLab invalid expression when calling variables.
@(x) constraints(x;Y_bus; num_gen_buses; num_oltc_buses; svc_bus; V_max;V_min; S_max)... Function inputs are separated by ",", ...

2 years ago | 0

| accepted

Answered
Solving an equation consisting of a PDE and ODE
The discretization can be taken from the attached document (formulae 3.1 (c) and 3.2 (c)). %Given parameters espo=0.269; gamma...

2 years ago | 2

| accepted

Answered
When does an anonymous function reach a specified value?
threshold = 100; a = 0.5; fun = @(x) exp(a*x) - threshold; solx = fsolve(fun,1) exp(a*solx)

2 years ago | 0

| accepted

Answered
Index exceeds the number of array elements. Index must not exceed 100
You initialize eta1 and eta2 as arrays of zeros with 100 elements. When your loop reaches n = 100, you try to access eta1(101) ...

2 years ago | 0

Answered
Writing functions f(x,y)
f = @(x,y)4*(x-1)^2+3*(y-2)^2+2*(x-2)^2*(y-3)^2; z0 = [1 1] sol = fminsearch(@(z)f(z(1),z(2)),z0) f(sol(1),sol(2))

2 years ago | 3

Load more