Community Profile

Torsten

Last seen: 19日 前
2,612 2013 年以降の合計貢献数

Torsten's バッジ

Plotting a piecewise function for an arbitrary itration and then take intersection of them.
n=5; nx=50; x1=linspace(0,1/3,nx); x2=linspace(1/3,2/3,nx); x3=linspace(2/3,1,nx); X = [x1(1:nx-1).';x2(1:nx-1).';x3.'); Y...

19日 前 | 0

Utility of Jacobian in lsqnonlin
Stability of convergence is the main reason to supply an analytic Jacobian. For computation time, it depends on the complexity...

19日 前 | 0

| 採用済み

How to use isAlways to compare two symbolic equations ?
syms x isAlways(sqrt(x^2)==abs(x))

20日 前 | 0

errors in calling function
The k-values are not known in call_myequations. So you must pass them to the function: function [t,n] = call_myequations(k1,k2,...

20日 前 | 0

exclude some elements in array
last = numel(a); idx = [6:8:last,7:8:last,8:8:last]; a(idx) = [];

20日 前 | 0

| 採用済み

Error using horzcat Dimensions of matrices being concatenated are not consistent.
Substitute OG at the end into the equation: OGnum = 2:2:10; W = []; for i=1:numel(OGnum) AUU = subs(AU,OG,OGnum(i)); ...

21日 前 | 0

| 採用済み

unable to write file permission denied
After starting Matlab, type in the command window "cd" followed by a folder where you have writing permission. See http://de.m...

21日 前 | 0

Solving ODE and using conditions
After the call to ode45, insert (without semicolon at the end of the line) expr_at_0 = n(1,1)+2*n(1,2) expr_at_end = n(end,1)+...

21日 前 | 0

| 採用済み

Error in ode45
[t,n] = ode45(@(t,n)ODE(t,n,k1,k2,...),[0 1e-3],IC); Better to write an array for k with 155 entries (k(1),k(2),...) than to d...

22日 前 | 1

| 採用済み

ODE 45 to solve coupled ODE
To be honest, I'd prefer to know what Matlab solves. Order the variables as [z1,z2,z3,z4,z5,z6] = [y1,y2,y3,y1',y2',y3'] Then...

22日 前 | 0

NUMERICAL METHODS DISCRETISATION PROBLEM
Solve -Δv = -5/4*π^2*sin(π*x)*cos(π*y/2) by just modifying the b-vector from exercise part a). Let the solution be v. Then a...

22日 前 | 0

How to set up a function
Differentiating your equation with respect to t gives the differential equation V'(t) = Qdot/(m*R_s*T) * V(t) with solution V...

23日 前 | 0

Using the improved Euler (Huen) method, determine the approximate solution y (t) of the following starting problem:
Untested ! function main H = [1/2 ,1/4,1/8,1/16,1/32]; t0 = 0; t1 = 0.5; y0 = 1; f = @(t,y) y*exp(5*t); for i= 1:numel(...

23日 前 | 0

How to use ode45 in this case?
ydot = y'(t0) + cumtrapz(t,-tan(phi).*(zdd+gravity)); y = y(t0) + cumtrapz(t,ydot), plot(t,y) where t is your (1xn) vector of...

23日 前 | 1

| 採用済み

Objective function with summation
Choose u_0,...,u_N as unknowns. In the objective function, calculate x_1,...x_(N+1) from A and u_0,...u_N. Return u_0^2 + ... ...

23日 前 | 0

| 採用済み

System of 2nd order ODE with Euler.
y0 must be a 4x1 vector, not a scalar. ye = zeros(4,n) instead of ye=zeros(1,n) ye(:,1) = y0 instead of ye(1) = y0 ye(:,i+1) ...

24日 前 | 1

lsqcurvefit to estimate parameters in ODE15s
function C = kinetics(theta,t) instead of function [C,T] = kinetics(theta,t) Define stronger RelTol and AbsTol for ODE15S and...

24日 前 | 0

How to plot a deviation (upper/lower limit)
Include 1.05*signal and 0.95*signal in the same plot.

24日 前 | 1

How to calculate the area under curve?
area_under_curve= trapz(x,y)

24日 前 | 1

| 採用済み

lsqcurvefit to estimate parameters in ODE45
Modifications in the following lines are necessary: [ ... ] = lsqcurvefit(@(theta,t) kinetics(theta,t,precision),...) function...

24日 前 | 0

How to create a function handle for thermodynamics(semi-infinite heat conduction) using erfc with multiple variables?
Use ./ instead of / in your definition of thetafh. But you are asked to write a function, not a function handle.

24日 前 | 0

| 採用済み

How to separate real and imaginary value into different column?
A = [real(v),imag(v)]; if v is the column vector with 1024 complex numbers.

24日 前 | 0

| 採用済み

How to code erf(z) summation series?
function main z = [0.1 0.5 1 2]; for i=1:numel(z) [erfc1(i),n(i)] = myerfc1(z(i)); end erfc_matlab = erfc(z); X = [z.',...

24日 前 | 0

| 採用済み

How can I solve this partial differentiation equation numerically?
A = zeros(M+1); U2 = zeros(M+1,N+1); A(1,1) = 1; for i=2:M A(i,i-1) = -sigma; A(i,i) = 1+2*sigma; A(i,i+1) = -sigma;...

25日 前 | 0

| 採用済み

(Solved) Help with please these are hard
function [n,summa] = threshold(limit) summa = 0; n = 0; while summa <= limit n = n+1; summa = summa + 5*n^2 - 2*n; end...

25日 前 | 0

| 採用済み

Derivative of a function of three variables
syms y S K C(y,S,K) =exp(-y*sqrt(S*K)); g = gradient(C(y,S,K),[y,S,K])

25日 前 | 1

| 採用済み

Integrate a random function
Matlab tools can not be used for this problem because the integral is not simply a numerical value, but a random variable itself...

26日 前 | 0

| 採用済み

Solve partial differential equations coupled
There is no matlab code that can solve this problem directly. Look at the CLAWPACK package available in the internet.

26日 前 | 1

summing columns based on certain interval
sum(sum(A(1:51,:))) sum(sum(A(53:102,:))) sum(sum(A(104:153,:)))

27日 前 | 0

How to draw graph of the following function?
function main a = 1; nu = 2; d0 = 0; nu0 = 1; n = 15; deltat = 0.05; % end of user inputs T = 0:deltat:n ; M = [(1-a/nu...

27日 前 | 1

| 採用済み